From a2447a0084705f1a08fa4d19d092654e75eaf16e Mon Sep 17 00:00:00 2001 From: Leo Balter <leonardo.balter@gmail.com> Date: Tue, 31 Jul 2018 14:58:05 -0400 Subject: [PATCH] Curation of the stress folder These are not spec tests neither identify points not already covered in the tests to cover something new from the specs --- .../stress/Number-isNaN-basics.js | 221 - ..._Object.getOwnPropertyDescriptors-proxy.js | 113 - ...ethods_Object.getOwnPropertyDescriptors.js | 153 - ...-not-branch-across-register-allocations.js | 16 - .../stress/SharedArrayBuffer-opt.js | 134 - .../stress/SharedArrayBuffer.js | 134 - ...activation-sink-default-value-tdz-error.js | 45 - .../stress/activation-sink-default-value.js | 31 - ...on-sink-osrexit-default-value-tdz-error.js | 46 - .../activation-sink-osrexit-default-value.js | 37 - .../stress/activation-sink-osrexit.js | 25 - .../javascriptcore/stress/activation-sink.js | 24 - .../stress/activation-test-loop.js | 24 - .../stress/add-constant-overflow-recovery.js | 15 - ...ferred-type-table-to-existing-structure.js | 31 - .../add-int52-constant-overflow-recovery.js | 15 - ...-int52-large-constant-overflow-recovery.js | 15 - .../stress/add-overflow-recovery.js | 15 - .../stress/add-overflows-after-not-equal.js | 16 - .../add-small-constant-overflow-recovery.js | 15 - .../stress/ai-consistency-filter-cells.js | 30 - .../ai-create-this-to-new-object-fire.js | 61 - .../stress/ai-create-this-to-new-object.js | 41 - .../ai-needs-to-model-spreads-effects.js | 33 - ...tion-sinking-defs-may-have-replacements.js | 31 - ...tion-sinking-new-object-with-poly-proto.js | 53 - ...allocation-sinking-puthint-control-flow.js | 41 - ...er-dictionary-indexing-mode-with-getter.js | 29 - .../stress/any-int-as-double-add.js | 43 - .../stress/arguments-callee-uninitialized.js | 11 - .../stress/arguments-captured.js | 23 - ...ments-copy-register-array-backing-store.js | 32 - .../stress/arguments-custom-properties-gc.js | 36 - .../stress/arguments-define-property.js | 34 - ...istings-should-respect-pseudo-terminals.js | 28 - .../arguments-elimination-force-exit.js | 29 - .../stress/arguments-elimination-throw.js | 51 - ...ination-varargs-too-many-args-arg-count.js | 30 - .../stress/arguments-exit-fixed.js | 16 - .../arguments-exit-strict-mode-fixed.js | 18 - .../stress/arguments-exit-strict-mode.js | 18 - .../javascriptcore/stress/arguments-exit.js | 16 - ...rguments-inlined-exit-strict-mode-fixed.js | 22 - .../arguments-inlined-exit-strict-mode.js | 22 - .../stress/arguments-inlined-exit.js | 20 - .../stress/arguments-interference-cfg.js | 24 - .../stress/arguments-interference.js | 18 - .../stress/arguments-iterator.js | 70 - .../arguments-length-always-dont-enum.js | 15 - .../stress/arguments-non-configurable.js | 27 - .../stress/arith-abs-overflow.js | 22 - ...h-abs-to-arith-negate-range-optimizaton.js | 427 -- .../stress/arith-abs-with-bitwise-or-zero.js | 54 - .../arith-add-on-double-array-with-holes.js | 100 - .../arith-add-with-constant-overflow.js | 21 - .../stress/arith-add-with-constants.js | 271 - .../stress/arith-clz32-effects.js | 30 - .../stress/arith-modulo-node-behaviors.js | 106 - .../stress/arith-modulo-twice.js | 61 - .../stress/arith-mul-with-constants.js | 222 - ...h-nodes-abstract-interpreter-untypeduse.js | 373 -- ...on-number-due-to-dfg-osr-exit-profiling.js | 32 - .../arith-sub-on-double-array-with-holes.js | 98 - .../stress/arity-check-ftl-throw-more-args.js | 23 - .../stress/arity-check-ftl-throw.js | 35 - ...ixup-inlining-dont-generate-invalid-use.js | 26 - ...up-should-not-touch-stack-area-below-sp.js | 3 - .../stress/arity-mismatch-arguments-length.js | 50 - .../arity-mismatch-inlining-extra-slots.js | 17 - .../stress/arity-mismatch-inlining.js | 24 - .../stress/arity-mismatch-rest.js | 65 - .../stress/array-buffer-byte-length.js | 66 - .../stress/array-concat-fast-spread-proxy.js | 41 - .../stress/array-concat-on-frozen-object.js | 72 - .../stress/array-concat-spread-object.js | 48 - ...ray-concat-spread-proxy-exception-check.js | 34 - .../stress/array-concat-spread-proxy.js | 40 - .../array-concat-with-slow-indexingtypes.js | 35 - .../stress/array-constructor-no-result.js | 13 - .../javascriptcore/stress/array-copywithin.js | 281 - .../stress/array-fill-put-by-val.js | 44 - .../stress/array-filter-put-by-val-direct.js | 27 - .../array-find-does-not-lookup-twice.js | 47 - .../javascriptcore/stress/array-flatmap.js | 97 - .../javascriptcore/stress/array-flatten.js | 108 - .../stress/array-from-abs-and-floor.js | 42 - .../stress/array-from-put-by-val-direct.js | 25 - .../stress/array-from-set-length.js | 45 - .../stress/array-from-with-accessors.js | 22 - .../stress/array-from-with-iterable.js | 69 - .../stress/array-from-with-iterator.js | 129 - .../array-indexof-array-prototype-change.js | 24 - .../stress/array-indexof-arraystorage.js | 85 - .../stress/array-indexof-constant-folding.js | 72 - .../array-indexof-have-a-bad-time-getter.js | 28 - .../stress/array-indexof-have-a-bad-time.js | 35 - .../stress/array-indexof-hole-and-other.js | 38 - .../array-indexof-hole-with-prototype.js | 35 - .../stress/array-indexof-hole.js | 33 - .../stress/array-indexof-index.js | 63 - .../stress/array-indexof-negative-index.js | 72 - .../array-indexof-non-int32-start-index.js | 21 - .../array-indexof-object-prototype-change.js | 24 - .../stress/array-indexof-object.js | 42 - .../stress/array-indexof-original-array.js | 46 - .../stress/array-indexof-other.js | 50 - .../stress/array-indexof-string.js | 37 - .../array-indexof-structure-change-convert.js | 32 - .../stress/array-indexof-structure-change.js | 20 - .../stress/array-indexof-symbol.js | 52 - .../javascriptcore/stress/array-indexof.js | 35 - .../array-iterators-next-error-messages.js | 18 - .../stress/array-iterators-next-with-call.js | 117 - .../stress/array-iterators-next.js | 108 - ...ay-join-on-strings-need-overflow-checks.js | 33 - ...array-length-array-storage-plain-object.js | 16 - .../stress/array-length-not-writable.js | 22 - .../stress/array-length-plain-object.js | 15 - .../stress/array-map-put-by-val-direct.js | 27 - .../stress/array-pop-array-storage.js | 65 - .../stress/array-pop-contiguous.js | 11 - .../stress/array-pop-double-hole.js | 14 - .../javascriptcore/stress/array-pop-double.js | 11 - .../javascriptcore/stress/array-pop-int32.js | 11 - ...ray-profile-should-record-copy-on-write.js | 39 - ...prototype-concat-of-long-spliced-arrays.js | 36 - ...rototype-concat-of-long-spliced-arrays2.js | 26 - ...-prototype-slow-put-having-a-bad-time-2.js | 14 - ...ay-prototype-slow-put-having-a-bad-time.js | 15 - ...ray-prototype-splice-making-typed-array.js | 66 - .../array-push-array-storage-beyond-int32.js | 27 - .../stress/array-push-array-storage.js | 40 - .../stress/array-push-contiguous.js | 18 - .../stress/array-push-double-then-nan.js | 23 - .../stress/array-push-double.js | 18 - ...ush-multiple-array-storage-beyond-int32.js | 29 - .../stress/array-push-multiple-contiguous.js | 19 - .../stress/array-push-multiple-double-nan.js | 25 - .../stress/array-push-multiple-double.js | 32 - .../stress/array-push-multiple-int32.js | 24 - .../array-push-multiple-many-contiguous.js | 20 - .../stress/array-push-multiple-many-double.js | 20 - .../stress/array-push-multiple-many-int32.js | 20 - .../array-push-multiple-many-storage.js | 21 - .../array-push-multiple-storage-continuous.js | 31 - .../stress/array-push-multiple-storage.js | 29 - ...-double-array-cse-sane-and-insane-chain.js | 23 - .../stress/array-push-nan-to-double-array.js | 20 - .../javascriptcore/stress/array-push.js | 18 - .../stress/array-reverse-doesnt-clobber.js | 63 - .../stress/array-reverse-proxy.js | 221 - ...tLength-on-ArrayClass-with-large-length.js | 19 - ...tLength-on-ArrayClass-with-small-length.js | 19 - .../javascriptcore/stress/array-slice-cow.js | 31 - .../stress/array-slice-intrinsic.js | 49 - ...ay-slice-jettison-on-constructor-change.js | 72 - .../stress/array-slice-on-frozen-object.js | 64 - .../stress/array-slice-osr-exit-2.js | 76 - .../stress/array-slice-osr-exit.js | 74 - .../stress/array-slice-with-zero.js | 34 - .../stress/array-slice-zero-args.js | 19 - .../stress/array-sort-bad-comparator.js | 28 - .../array-species-config-array-constructor.js | 49 - .../stress/array-species-functions.js | 83 - .../stress/array-storage-array-unshift.js | 8 - .../stress/array-storage-get-by-val.js | 76 - .../stress/array-storage-length.js | 60 - .../array-symbol-species-lazy-watchpoints.js | 47 - .../stress/array-to-locale-string.js | 7 - .../array-unshift-zero-property-storage.js | 34 - .../stress/arrayify-array-storage-array.js | 29 - .../arrayify-array-storage-non-array.js | 28 - .../arrayify-array-storage-typed-array.js | 36 - .../stress/arrayify-array-storage.js | 25 - .../stress/arrayify-fires-watchpoint.js | 28 - .../stress/arrayify-int32-typed-array.js | 34 - ...ow-put-array-storage-pass-array-storage.js | 40 - .../stress/arrayify-slow-put-array-storage.js | 31 - .../stress/arrayify-structure-bad-test.js | 22 - .../arrayify-to-structure-contradiction.js | 16 - .../javascriptcore/stress/arrayify.js | 41 - .../arrow-function-needs-its-own-structure.js | 23 - .../arrow-function-token-is-not-keyword.js | 15 - ...w-functions-as-default-parameter-values.js | 203 - ...on-sink-osrexit-default-value-tdz-error.js | 46 - ...n-activation-sink-osrexit-default-value.js | 37 - .../arrowfunction-activation-sink-osrexit.js | 25 - .../stress/arrowfunction-activation-sink.js | 24 - .../stress/arrowfunction-bound.js | 18 - .../stress/arrowfunction-call.js | 18 - .../stress/arrowfunction-constructor.js | 22 - ...ion-lexical-bind-arguments-non-strict-1.js | 252 - ...ion-lexical-bind-arguments-non-strict-2.js | 100 - ...wfunction-lexical-bind-arguments-strict.js | 169 - .../arrowfunction-lexical-bind-newtarget.js | 194 - .../arrowfunction-lexical-bind-supercall-1.js | 67 - .../arrowfunction-lexical-bind-supercall-2.js | 176 - .../arrowfunction-lexical-bind-supercall-3.js | 52 - .../arrowfunction-lexical-bind-supercall-4.js | 198 - ...rrowfunction-lexical-bind-superproperty.js | 290 -- .../arrowfunction-lexical-bind-this-1.js | 21 - .../arrowfunction-lexical-bind-this-2.js | 92 - .../arrowfunction-lexical-bind-this-3.js | 28 - .../arrowfunction-lexical-bind-this-4.js | 26 - .../arrowfunction-lexical-bind-this-5.js | 48 - .../arrowfunction-lexical-bind-this-6.js | 24 - .../arrowfunction-lexical-bind-this-7.js | 24 - .../arrowfunction-lexical-bind-this-8.js | 104 - ...on-lexical-this-activation-sink-osrexit.js | 34 - ...owfunction-lexical-this-activation-sink.js | 38 - ...lexical-this-sinking-no-double-allocate.js | 37 - ...owfunction-lexical-this-sinking-osrexit.js | 36 - .../arrowfunction-lexical-this-sinking-put.js | 45 - .../stress/arrowfunction-name.js | 15 - .../stress/arrowfunction-others.js | 27 - .../stress/arrowfunction-prototype.js | 22 - .../stress/arrowfunction-run-10-1.js | 24 - .../stress/arrowfunction-run-10-2.js | 25 - .../stress/arrowfunction-run-10000-1.js | 23 - .../stress/arrowfunction-run-10000-2.js | 23 - ...rrowfunction-sinking-no-double-allocate.js | 28 - .../stress/arrowfunction-sinking-osrexit.js | 21 - .../stress/arrowfunction-sinking-put.js | 28 - .../stress/arrowfunction-tdz-1.js | 31 - .../stress/arrowfunction-tdz-2.js | 32 - .../stress/arrowfunction-tdz-3.js | 177 - .../stress/arrowfunction-tdz-4.js | 46 - .../stress/arrowfunction-tostring.js | 20 - .../stress/arrowfunction-typeof.js | 27 - .../stress/atomics-add-uint32.js | 14 - .../stress/atomics-known-int-use.js | 32 - .../javascriptcore/stress/atomics-neg-zero.js | 4 - .../stress/atomics-store-return.js | 27 - ...ould-neutralize-upsilons-with-dead-phis.js | 9 - .../baseline-osrentry-catch-is-reachable.js | 17 - .../stress/basic-eden-gc-test.js | 4 - .../javascriptcore/stress/basic-weakmap.js | 45 - .../javascriptcore/stress/basic-weakset.js | 43 - .../stress/big-int-add-wrapped-value.js | 37 - .../stress/big-int-addition-basic.js | 170 - .../stress/big-int-addition-jit.js | 19 - .../stress/big-int-addition-memory-stress.js | 14 - .../big-int-addition-string-coercion.js | 25 - ...ig-int-addition-to-primitive-precedence.js | 39 - .../stress/big-int-addition-to-primitive.js | 39 - .../stress/big-int-addition-type-error.js | 104 - .../javascriptcore/stress/big-int-as-key.js | 14 - .../stress/big-int-constructor-gc.js | 19 - .../stress/big-int-constructor-oom.js | 21 - .../stress/big-int-constructor-properties.js | 23 - ...t-constructor-prototype-prop-descriptor.js | 13 - .../stress/big-int-constructor-prototype.js | 10 - .../stress/big-int-constructor.js | 276 - .../javascriptcore/stress/big-int-div-jit.js | 19 - .../stress/big-int-div-memory-stress.js | 15 - .../stress/big-int-div-to-primitive.js | 34 - .../stress/big-int-div-type-error.js | 106 - .../stress/big-int-div-wrapped-value.js | 46 - .../javascriptcore/stress/big-int-division.js | 131 - .../stress/big-int-equals-basic.js | 124 - .../big-int-equals-to-primitive-precedence.js | 39 - .../stress/big-int-equals-wrapped-value.js | 37 - .../stress/big-int-function-apply.js | 18 - .../stress/big-int-greater-than-general.js | 140 - .../stress/big-int-greater-than-jit.js | 24 - .../big-int-greater-than-or-equal-jit.js | 24 - ...eater-than-or-equal-order-of-evaluation.js | 55 - ...nt-greater-than-or-equal-wrapped-values.js | 63 - .../stress/big-int-greater-than-or-equal.js | 140 - ...ig-int-greater-than-order-of-evaluation.js | 55 - .../big-int-greater-than-wrapped-values.js | 63 - .../javascriptcore/stress/big-int-length.js | 13 - .../stress/big-int-less-than-general.js | 148 - .../stress/big-int-less-than-jit.js | 24 - .../big-int-less-than-or-equal-general.js | 148 - .../stress/big-int-less-than-or-equal-jit.js | 24 - ...-less-than-or-equal-order-of-evaluation.js | 55 - ...g-int-less-than-or-equal-wrapped-values.js | 63 - .../big-int-less-than-order-of-evaluation.js | 55 - .../big-int-less-than-wrapped-values.js | 63 - .../stress/big-int-literal-line-terminator.js | 33 - .../javascriptcore/stress/big-int-literals.js | 113 - .../javascriptcore/stress/big-int-mod-jit.js | 33 - .../stress/big-int-mod-memory-stress.js | 15 - .../big-int-mod-to-primitive-precedence.js | 38 - .../stress/big-int-mod-to-primitive.js | 34 - .../stress/big-int-mod-type-error.js | 117 - .../stress/big-int-mod-wrapped-value.js | 36 - .../javascriptcore/stress/big-int-mod.js | 276 - .../javascriptcore/stress/big-int-mul-jit.js | 19 - .../big-int-mul-to-primitive-precedence.js | 39 - .../stress/big-int-mul-to-primitive.js | 35 - .../stress/big-int-mul-type-error.js | 106 - .../stress/big-int-mul-wrapped-value.js | 37 - .../stress/big-int-multiplication.js | 83 - .../stress/big-int-multiply-memory-stress.js | 15 - .../stress/big-int-negate-basic.js | 71 - .../stress/big-int-negate-jit.js | 48 - .../stress/big-int-no-conversion-to-number.js | 12 - .../stress/big-int-operations-error.js | 44 - .../stress/big-int-prop-descriptor.js | 12 - .../stress/big-int-proto-constructor.js | 14 - .../stress/big-int-proto-name.js | 13 - .../stress/big-int-prototype-properties.js | 39 - .../stress/big-int-prototype-proto.js | 11 - .../big-int-prototype-symbol-to-string-tag.js | 30 - .../big-int-prototype-to-string-apply.js | 24 - ...g-int-prototype-to-string-cast-overflow.js | 20 - .../big-int-prototype-to-string-exception.js | 22 - ...ig-int-prototype-to-string-wrong-values.js | 31 - .../stress/big-int-prototype-value-of.js | 22 - .../stress/big-int-spec-to-primitive.js | 17 - .../stress/big-int-spec-to-this.js | 23 - .../stress/big-int-strict-equals-jit.js | 37 - .../stress/big-int-strict-spec-to-this.js | 23 - .../stress/big-int-sub-wrapped-value.js | 36 - .../stress/big-int-subtraction-basic.js | 303 -- .../stress/big-int-subtraction-jit.js | 19 - .../stress/big-int-subtraction-type-error.js | 125 - .../stress/big-int-to-object.js | 13 - .../stress/big-int-to-string.js | 33 - .../stress/big-int-type-of-proven-type.js | 18 - .../javascriptcore/stress/big-int-type-of.js | 10 - .../stress/big-int-unary-plus.js | 51 - .../big-int-white-space-trailing-leading.js | 111 - .../javascriptcore/stress/big-match.js | 20 - .../stress/big-split-captures.js | 27 - .../javascriptcore/stress/big-split.js | 21 - .../bit-op-value-to-int32-input-liveness.js | 20 - .../block-scoped-function-declarations.js | 227 - ...tion-does-not-have-caller-and-arguments.js | 15 - .../bound-function-lazy-name-generation.js | 23 - ...bound-function-tail-call-with-exception.js | 23 - .../stress/bound-function-uses-prototype.js | 31 - .../bounds-check-not-eliminated-by-licm.js | 30 - ...heck-int32-on-boolean-to-number-untyped.js | 23 - ...eck-number-on-boolean-to-number-untyped.js | 23 - ...ay-exit-due-to-object-or-other-use-kind.js | 46 - ...-bad-time-with-arguments-for-gc-testing.js | 140 - .../stress/cached-prototype-setter.js | 45 - ...ly-builtin-functions-dont-use-iterators.js | 27 - .../call-apply-exponential-bytecode-size.js | 109 - ...d-varargs-for-inlined-escaped-arguments.js | 23 - ...-non-calleable-constructors-as-function.js | 59 - .../stress/call-object-constructor.js | 18 - .../call-varargs-double-new-array-buffer.js | 33 - ...lined-code-with-odd-number-of-arguments.js | 30 - .../stress/call-varargs-from-inlined-code.js | 30 - .../stress/call-varargs-length-effects.js | 24 - .../call-varargs-spread-new-array-buffer.js | 29 - .../call-varargs-spread-new-array-buffer2.js | 33 - .../stress/call-varargs-spread.js | 28 - ...different-arguments-length-after-warmup.js | 91 - ...rties-for-functions-that-dont-have-them.js | 74 - .../stress/caller-native-code.js | 25 - .../stress/capture-escape-and-throw.js | 28 - .../stress/captured-arguments-variable.js | 17 - .../catch-clause-should-be-under-tdz1.js | 10 - .../catch-clause-should-be-under-tdz2.js | 10 - .../catch-clause-should-be-under-tdz3.js | 10 - .../catch-clause-should-be-under-tdz4.js | 11 - .../catch-clause-should-be-under-tdz5.js | 10 - .../stress/catch-parameter-destructuring.js | 146 - .../stress/catch-parameter-syntax.js | 171 - .../catch-set-argument-speculation-failure.js | 53 - .../stress/catch-variables-under-tdz.js | 21 - .../stress/check-string-ident.js | 16 - ...-ir-ensures-empty-does-not-flow-through.js | 26 - .../stress/chill-mod-chill-mod.js | 10 - .../stress/class-derived-from-null.js | 130 - .../class-expression-generates-environment.js | 64 - ...ss-expression-should-be-tdz-in-heritage.js | 20 - ...oes-not-declare-variable-to-upper-scope.js | 29 - .../stress/class-static-get-weird.js | 19 - .../stress/class-subclassing-array.js | 35 - .../stress/class-subclassing-function.js | 37 - .../stress/class-subclassing-misc.js | 59 - .../stress/class-subclassing-string.js | 38 - .../stress/class-subclassing-typedarray.js | 19 - .../stress/class-syntax-block-scoping.js | 49 - .../class-syntax-definition-semantics.js | 36 - ...lass-syntax-derived-default-constructor.js | 26 - .../stress/class-syntax-double-constructor.js | 183 - .../stress/class-syntax-no-loop-tdz.js | 20 - .../stress/class-syntax-no-tdz-in-catch.js | 19 - .../class-syntax-no-tdz-in-conditional.js | 18 - .../stress/class-syntax-no-tdz-in-eval.js | 18 - ...s-syntax-no-tdz-in-loop-no-inline-super.js | 25 - .../stress/class-syntax-no-tdz-in-loop.js | 23 - .../stress/class-syntax-no-tdz.js | 16 - .../stress/class-syntax-super-in-eval.js | 93 - .../stress/class-syntax-tdz-in-catch.js | 30 - .../stress/class-syntax-tdz-in-conditional.js | 28 - .../stress/class-syntax-tdz-in-eval.js | 26 - .../stress/class-syntax-tdz-in-loop.js | 30 - .../class-syntax-tdz-osr-entry-in-loop.js | 58 - .../javascriptcore/stress/class-syntax-tdz.js | 80 - .../javascriptcore/stress/class_elements.js | 24 - .../stress/cloned-arguments-elimination.js | 33 - ...loned-arguments-get-by-val-double-array.js | 13 - .../stress/cloned-arguments-modification.js | 37 - ...arguments-should-visit-callee-during-gc.js | 34 - .../stress/compare-clobber-untypeduse.js | 12 - .../compare-eq-object-or-other-to-object.js | 24 - .../compare-eq-object-to-object-or-other.js | 24 - ...e-eq-on-null-and-undefined-non-peephole.js | 45 - ...undefined-optimized-in-constant-folding.js | 70 - .../compare-eq-on-null-and-undefined.js | 174 - .../compare-eq-should-use-known-other-use.js | 29 - .../stress/compare-number-and-other.js | 75 - ...egate-method-of-getting-a-value-profile.js | 18 - .../compare-strict-eq-integer-to-misc.js | 25 - .../compare-strict-eq-on-various-types.js | 242 - ...t-closure-var-with-dynamic-invalidation.js | 17 - ...offset-on-prototype-and-sink-allocation.js | 38 - .../stress/constant-folding-osr-exit.js | 132 - ...lding-phase-insert-check-handle-varargs.js | 151 - ...hould-fold-make-rope-with-empty-strings.js | 61 - ...d-varargs-for-inlined-escaped-arguments.js | 23 - .../stress/construct-overwritten-variable.js | 6 - ...construct-spread-overwritten-variable-2.js | 6 - .../construct-spread-overwritten-variable.js | 7 - .../construct-varargs-inline-smaller-Foo.js | 35 - .../stress/construct-varargs-inline.js | 39 - .../stress/construct-varargs-no-inline.js | 41 - .../stress/constructor-with-return.js | 41 - .../stress/contiguous-array-unshift.js | 6 - .../stress/date-negative-zero.js | 7 - .../stress/date-parse-ranges.js | 145 - .../javascriptcore/stress/date-relaxed.js | 64 - .../stress/date-symbol-toprimitive.js | 6 - ...-in-function-with-multiple-basic-blocks.js | 26 - ...tured-variable-preceded-by-a-live-store.js | 17 - ...iat-double-to-int52-then-exit-not-int52.js | 15 - .../stress/dead-fiat-double-to-int52.js | 12 - .../stress/dead-fiat-int32-to-int52.js | 11 - .../dead-fiat-value-to-int52-double-path.js | 19 - .../stress/dead-get-closure-var.js | 23 - .../stress/dead-int32-to-double.js | 16 - .../stress/dead-speculating-argument-use.js | 17 - .../stress/dead-uint32-to-number.js | 16 - ...ad-value-with-mov-hint-in-another-block.js | 17 - ...ClearingWatchpoint-destructor-recursion.js | 8 - .../stress/deeply-nested-finallys.js | 78 - .../default-proto-for-async-generator.js | 11 - .../stress/default-proto-for-generator.js | 11 - ...lt-value-parsing-should-propagate-error.js | 21 - .../javascriptcore/stress/delete-by-id.js | 28 - .../stress/delete-by-val-ftl.js | 28 - .../javascriptcore/stress/delete-by-val.js | 15 - .../stress/delete-to-object-exception.js | 24 - ...tructuring-assignment-accepts-iterables.js | 441 -- ...ing-assignment-require-object-coercible.js | 68 - .../stress/destructuring-assignment-syntax.js | 72 - .../stress/destructuring-rest-element.js | 107 - .../stress/dfg-call-class-constructor.js | 14 - .../dfg-create-arguments-inline-alloc.js | 19 - .../javascriptcore/stress/dfg-del-by-id.js | 14 - ...catch-in-constructor-with-inlined-throw.js | 27 - ...d-should-not-assert-non-null-prediction.js | 18 - .../stress/dfg-internal-function-call.js | 14 - .../stress/dfg-internal-function-construct.js | 14 - ...rt-to-constant-must-clear-varargs-flags.js | 14 - .../stress/dfg-object-proto-accessor.js | 115 - .../stress/dfg-object-proto-getter.js | 117 - .../stress/dfg-object-prototype-of.js | 115 - .../stress/dfg-put-accessors-by-id-class.js | 82 - .../stress/dfg-put-accessors-by-id.js | 75 - ...dfg-put-by-val-direct-with-edge-numbers.js | 104 - .../stress/dfg-put-getter-by-id-class.js | 45 - .../stress/dfg-put-getter-by-id.js | 39 - .../stress/dfg-put-getter-by-val-class.js | 42 - .../stress/dfg-put-getter-by-val.js | 39 - .../stress/dfg-put-setter-by-id-class.js | 46 - .../stress/dfg-put-setter-by-id.js | 41 - .../stress/dfg-put-setter-by-val-class.js | 44 - .../stress/dfg-put-setter-by-val.js | 41 - .../javascriptcore/stress/dfg-rare-data.js | 9 - .../stress/dfg-reflect-get-prototype-of.js | 58 - .../javascriptcore/stress/dfg-ssa-swap.js | 8 - .../javascriptcore/stress/dfg-tail-calls.js | 56 - .../stress/dfg-to-primitive-pass-symbol.js | 35 - ...y-catch-wrong-value-recovery-on-ic-miss.js | 50 - .../stress/direct-arguments-check-array.js | 40 - ...ct-arguments-in-bounds-to-out-of-bounds.js | 17 - .../stress/direct-arguments-osr-entry.js | 22 - ...rguments-out-of-bounds-change-structure.js | 30 - ...rect-arguments-out-of-bounds-watchpoint.js | 19 - ...erride-length-then-access-normal-length.js | 25 - .../stress/direct-binding-return-result.js | 17 - .../direct-eval-in-object-literal-methods.js | 62 - ...ect-tail-call-arity-mismatch-count-args.js | 20 - ...azy-materializing-error-property-on-put.js | 27 - .../stress/disable-function-dot-arguments.js | 20 - .../stress/disable-gigacage-arrays.js | 24 - .../stress/disable-gigacage-strings.js | 25 - .../stress/disable-gigacage-typed-arrays.js | 25 - ...-fold-check-type-info-on-bound-function.js | 17 - .../stress/dont-crash-ftl-osr-entry.js | 26 - .../dont-crash-in-cfg-simplification.js | 17 - .../dont-crash-on-bad-invalidation-point.js | 16 - ...-on-stack-overflow-when-parsing-builtin.js | 13 - ...erflow-when-parsing-default-constructor.js | 17 - ...crash-when-hoist-check-structure-on-tdz.js | 28 - .../dont-dead-lock-put-by-val-as-put-by-id.js | 17 - .../dont-reserve-huge-capacity-lexer.js | 17 - .../stress/dont-run-cleanup-after-licm.js | 14 - ...t-strength-reduce-valuerep-of-doublerep.js | 15 - .../stress/dont-unwind-past-vm-entry-frame.js | 39 - ...use-it-might-be-guarded-by-control-flow.js | 26 - .../stress/double-array-to-array-storage.js | 33 - .../stress/double-array-unshift.js | 6 - .../javascriptcore/stress/double-as-int32.js | 22 - .../stress/double-compare-to-float.js | 49 - .../double-rep-real-number-use-on-nan.js | 46 - .../stress/double-rep-with-non-cell.js | 32 - .../stress/double-rep-with-null.js | 107 - .../stress/double-rep-with-undefined.js | 131 - .../javascriptcore/stress/double-to-float.js | 157 - .../double-to-string-in-loop-removed.js | 8 - .../stress/duplicate-computed-accessors.js | 402 -- ...ymorphic-call-inlining-should-be-exitOK.js | 19 - .../stress/eden-gc-with-retired-blocks.js | 24 - ...y-get-should-not-handled-with-get-by-id.js | 18 - ...lidable-new-object-roflcopter-then-exit.js | 23 - .../stress/elide-new-object-dag-then-exit.js | 43 - .../stress/empty_eos_regex_split.js | 3 - .../stress/float32-array-nan-inlined.js | 20 - .../stress/float32-array-nan.js | 20 - .../stress/float32-array-out-of-bounds.js | 23 - .../stress/float32-repeat-out-of-bounds.js | 17 - .../stress/float32array-out-of-bounds.js | 29 - .../stress/float64-array-nan-inlined.js | 37 - .../stress/float64-array-nan.js | 34 - .../stress/floating-point-div-to-mul.js | 216 - ...rser-needs-to-update-argument-positions.js | 32 - .../stress/fold-based-on-int32-proof-mul.js | 14 - .../fold-based-on-int32-proof-or-zero.js | 15 - .../stress/fold-based-on-int32-proof.js | 14 - ...ld-load-varargs-arity-check-fail-barely.js | 28 - .../fold-load-varargs-arity-check-fail.js | 29 - ...offset-to-get-by-offset-with-watchpoint.js | 26 - ...without-folding-the-structure-check-new.js | 42 - ...set-without-folding-the-structure-check.js | 50 - ...ld-multi-get-by-offset-to-get-by-offset.js | 26 - ...set-without-folding-the-structure-check.js | 56 - ...ld-multi-put-by-offset-to-put-by-offset.js | 40 - .../stress/fold-typed-array-properties.js | 35 - ...utable-butterfly-out-of-bounds-foldable.js | 56 - ...-with-immutable-butterfly-out-of-bounds.js | 66 - ...val-with-immutable-butterfly-with-types.js | 56 - ...ing-get-by-val-with-immutable-butterfly.js | 30 - ...y-val-with-read-only-dont-delete-object.js | 60 - ...ith-read-only-dont-delete-runtime-array.js | 35 - ...g-get-by-val-with-read-only-dont-delete.js | 60 - .../stress/for-in-array-mode.js | 89 - ...e-reassigned-later-and-change-structure.js | 18 - .../stress/for-in-base-reassigned-later.js | 18 - .../stress/for-in-base-reassigned.js | 17 - .../stress/for-in-capture-string-loop-var.js | 22 - .../stress/for-in-delete-during-iteration.js | 69 - ...in-invalidate-context-weird-assignments.js | 82 - .../for-in-invalidation-for-any-write.js | 146 - .../stress/for-in-modify-int-loop-var.js | 21 - .../stress/for-in-modify-string-loop-var.js | 19 - .../javascriptcore/stress/for-in-of-const.js | 49 - .../stress/for-in-postfix-ignored-index.js | 14 - .../stress/for-in-postfix-index.js | 15 - .../stress/for-in-prefix-index.js | 12 - ...dexed-properties-should-prevent-caching.js | 77 - .../javascriptcore/stress/for-in-prototype.js | 57 - .../for-in-shadow-prototype-property.js | 22 - .../stress/for-in-side-effects.js | 79 - .../javascriptcore/stress/for-in-string.js | 16 - .../javascriptcore/stress/for-in-tests.js | 211 - .../stress/for-in-typed-array.js | 18 - .../javascriptcore/stress/for-let-comma.js | 16 - .../stress/force-exit-then-eval-dfg.js | 14 - .../stress/force-exit-then-eval.js | 23 - ...forward-varargs-double-new-array-buffer.js | 33 - ...d-varargs-for-inlined-escaped-arguments.js | 21 - ...eeze-and-seal-should-prevent-extensions.js | 51 - .../javascriptcore/stress/freeze-setter.js | 20 - .../javascriptcore/stress/freeze_leek.js | 41 - .../stress/fromCharCode-exception-check.js | 8 - .../javascriptcore/stress/ftl-arithcos.js | 15 - .../javascriptcore/stress/ftl-arithsin.js | 13 - .../javascriptcore/stress/ftl-arithsqrt.js | 13 - .../javascriptcore/stress/ftl-arithtan.js | 14 - .../ftl-bit-xor-right-result-interference.js | 31 - ...callee-exception-interesting-live-state.js | 57 - ...l-call-exception-interesting-live-state.js | 60 - .../stress/ftl-call-exception-no-catch.js | 51 - .../stress/ftl-call-exception.js | 59 - ...d-args-exception-interesting-live-state.js | 60 - ...callee-exception-interesting-live-state.js | 57 - ...arargs-exception-interesting-live-state.js | 60 - .../ftl-call-varargs-exception-no-catch.js | 51 - .../stress/ftl-call-varargs-exception.js | 59 - .../stress/ftl-checkin-variable.js | 17 - .../javascriptcore/stress/ftl-checkin.js | 17 - .../stress/ftl-force-osr-exit.js | 21 - ...unction-dot-arguments-with-callee-saves.js | 23 - ...getter-exception-interesting-live-state.js | 61 - ...ftl-get-by-id-getter-exception-no-catch.js | 53 - .../stress/ftl-get-by-id-getter-exception.js | 60 - ...d-slow-exception-interesting-live-state.js | 58 - .../ftl-get-by-id-slow-exception-no-catch.js | 49 - .../stress/ftl-get-by-id-slow-exception.js | 57 - ...argument-by-val-inlined-and-not-inlined.js | 27 - .../ftl-get-my-argument-by-val-inlined.js | 16 - .../stress/ftl-get-my-argument-by-val.js | 12 - .../stress/ftl-getmyargumentslength-inline.js | 9 - .../stress/ftl-getmyargumentslength.js | 11 - .../stress/ftl-gettypedarrayoffset-simple.js | 12 - .../ftl-gettypedarrayoffset-wasteful.js | 12 - .../stress/ftl-has-a-bad-time.js | 18 - .../javascriptcore/stress/ftl-in-overflow.js | 13 - .../stress/ftl-library-exception.js | 21 - .../ftl-library-inline-gettimezoneoffset.js | 16 - ...tl-library-inlining-exceptions-dataview.js | 26 - .../stress/ftl-library-inlining-exceptions.js | 19 - .../stress/ftl-library-inlining-loops.js | 28 - .../stress/ftl-library-inlining-random.js | 11 - .../stress/ftl-library-substring.js | 15 - .../javascriptcore/stress/ftl-negate-zero.js | 12 - .../stress/ftl-new-negative-array-size.js | 20 - ...ration-exception-interesting-live-state.js | 63 - .../ftl-operation-exception-no-catch.js | 52 - .../stress/ftl-operation-exception.js | 62 - ...setter-exception-interesting-live-state.js | 61 - ...ftl-put-by-id-setter-exception-no-catch.js | 54 - .../stress/ftl-put-by-id-setter-exception.js | 60 - ...d-slow-exception-interesting-live-state.js | 56 - .../ftl-put-by-id-slow-exception-no-catch.js | 51 - .../stress/ftl-put-by-id-slow-exception.js | 55 - .../javascriptcore/stress/ftl-putbyid.js | 13 - .../stress/ftl-putbyiddirect.js | 12 - .../stress/ftl-reallocatepropertystorage.js | 28 - .../javascriptcore/stress/ftl-regexp-exec.js | 17 - .../javascriptcore/stress/ftl-regexp-test.js | 12 - .../stress/ftl-shr-exception.js | 19 - .../stress/ftl-string-equality.js | 35 - .../stress/ftl-string-ident-equality.js | 18 - .../stress/ftl-string-strict-equality.js | 35 - .../stress/ftl-sub-exception.js | 19 - .../ftl-switch-string-slow-duplicate-cases.js | 31 - ...ion-from-slow-path-recover-stack-values.js | 31 - .../javascriptcore/stress/ftl-tail-call.js | 20 - .../stress/ftl-to-ftl-arity-fixup.js | 36 - .../ftl-try-catch-arith-sub-exception.js | 59 - ...r-ic-fail-to-call-operation-throw-error.js | 49 - ...getter-throw-interesting-value-recovery.js | 65 - .../stress/ftl-try-catch-getter-throw.js | 57 - .../ftl-try-catch-oom-error-lazy-slow-path.js | 69 - ...atch-patchpoint-with-volatile-registers.js | 73 - .../stress/ftl-try-catch-setter-throw.js | 46 - .../ftl-try-catch-tail-call-inilned-caller.js | 60 - .../ftl-try-catch-varargs-call-throws.js | 32 - .../stress/ftl-xor-exception.js | 19 - .../stress/generator-and-super.js | 42 - .../generator-arguments-from-function.js | 18 - .../stress/generator-arguments.js | 107 - .../stress/generator-class-methods-syntax.js | 48 - .../stress/generator-class-methods.js | 62 - .../stress/generator-eval-this.js | 65 - .../stress/generator-fib-ftl-and-array.js | 23 - .../stress/generator-fib-ftl-and-object.js | 23 - .../stress/generator-fib-ftl-and-string.js | 22 - .../stress/generator-fib-ftl.js | 21 - .../stress/generator-frame-empty.js | 34 - ...or-function-constructor-is-subclassible.js | 24 - .../stress/generator-function-constructor.js | 31 - .../generator-function-create-optimized.js | 33 - ...-declaration-sinking-no-double-allocate.js | 36 - ...or-function-declaration-sinking-osrexit.js | 30 - ...erator-function-declaration-sinking-put.js | 38 - ...n-expression-sinking-no-double-allocate.js | 36 - ...tor-function-expression-sinking-osrexit.js | 29 - ...nerator-function-expression-sinking-put.js | 37 - .../stress/generator-function-name.js | 19 - .../stress/generator-is-not-constructible.js | 41 - .../generator-methods-with-non-generator.js | 31 - .../stress/generator-methods.js | 60 - .../stress/generator-prototype-copy.js | 12 - ...nerator-reduced-save-point-put-to-scope.js | 28 - .../stress/generator-relations.js | 30 - .../generator-return-before-first-call.js | 23 - .../javascriptcore/stress/generator-return.js | 133 - .../javascriptcore/stress/generator-syntax.js | 166 - .../javascriptcore/stress/generator-this.js | 67 - .../generator-throw-before-first-call.js | 20 - .../javascriptcore/stress/generator-throw.js | 132 - ...transfer-register-beyond-mutiple-yields.js | 18 - .../stress/generator-type-check.js | 54 - .../stress/generator-with-new-target.js | 31 - .../stress/generator-with-super.js | 80 - .../stress/generator-with-this-strict.js | 20 - .../stress/generator-with-this.js | 20 - .../stress/generator-yield-star.js | 329 -- ...neric-arguments-correct-delete-behavior.js | 47 - ...l-in-inlined-varargs-call-out-of-bounds.js | 31 - ...e-in-inlined-varargs-call-out-of-bounds.js | 35 - .../stress/get-array-length-on-undecided.js | 76 - ...t-array-length-phantom-new-array-buffer.js | 14 - .../stress/get-array-length-undecided.js | 10 - .../stress/get-by-id-strict-arguments.js | 28 - .../stress/get-by-id-strict-callee.js | 24 - .../stress/get-by-id-strict-caller.js | 28 - .../get-by-id-strict-nested-arguments-2.js | 42 - .../get-by-id-strict-nested-arguments.js | 27 - ...hrow-from-getter-through-optimized-code.js | 37 - ...rough-optimized-code-that-does-not-exit.js | 35 - ...nexpected-getter-through-optimized-code.js | 35 - .../stress/get-by-id-untyped.js | 21 - .../stress/get-by-offset-double.js | 25 - .../get-by-pname-only-prototype-properties.js | 50 - .../stress/get-by-val-double-predicted-int.js | 16 - .../get-by-val-fold-did-clobber-world.js | 9 - .../get-by-val-on-undecided-array-type.js | 358 -- .../get-by-val-on-undecided-out-of-bounds.js | 20 - .../get-by-val-on-undecided-sane-chain-1.js | 63 - .../get-by-val-on-undecided-sane-chain-2.js | 52 - .../get-by-val-on-undecided-sane-chain-3.js | 51 - .../get-by-val-on-undecided-sane-chain-4.js | 53 - .../get-by-val-on-undecided-sane-chain-5.js | 53 - .../get-by-val-on-undecided-sane-chain-6.js | 54 - .../stress/get-by-val-on-undecided-trivial.js | 37 - .../stress/get-by-val-out-of-bounds-basics.js | 221 - .../stress/get-by-val-string.js | 66 - .../stress/get-by-val-to-id-with-getter.js | 25 - .../get-by-val-with-string-constructor.js | 23 - .../stress/get-by-val-with-string-exit.js | 34 - .../get-by-val-with-string-generated.js | 33 - .../stress/get-by-val-with-string-getter.js | 16 - .../stress/get-by-val-with-string.js | 31 - .../get-by-val-with-symbol-constructor.js | 23 - .../stress/get-by-val-with-symbol-exit.js | 38 - .../stress/get-by-val-with-symbol-getter.js | 23 - .../stress/get-by-val-with-symbol.js | 33 - ...d-unpassed-argument-in-direct-arguments.js | 13 - ...d-unpassed-argument-in-scoped-arguments.js | 15 - .../get-from-scope-dynamic-onto-proxy.js | 106 - .../stress/get-local-elimination.js | 15 - ...get-my-argument-by-val-constant-folding.js | 14 - ...et-my-argument-by-val-creates-arguments.js | 42 - ...nt-by-val-for-inlined-escaped-arguments.js | 18 - ...ent-by-val-inlined-no-formal-parameters.js | 33 - ...rgument-by-val-out-of-bounds-no-warm-up.js | 9 - .../get-my-argument-by-val-out-of-bounds.js | 15 - ...t-my-argument-by-val-safe-out-of-bounds.js | 17 - ...get-my-argument-by-val-safe-wrap-around.js | 17 - ...-argument-by-val-wrap-around-no-warm-up.js | 9 - .../get-my-argument-by-val-wrap-around.js | 15 - .../get-prototype-create-this-effectful.js | 40 - .../get-stack-identity-due-to-sinking.js | 18 - .../get-stack-mapping-with-dead-get-stack.js | 27 - .../stress/get-stack-mapping.js | 26 - ...e-of-on-poly-proto-opc-should-not-crash.js | 28 - .../instanceof-custom-hasinstancesymbol.js | 24 - ...nstanceof-dynamic-proxy-check-structure.js | 159 - .../stress/instanceof-dynamic-proxy-loop.js | 159 - .../stress/instanceof-dynamic-proxy.js | 150 - .../instanceof-hit-one-object-then-another.js | 19 - ...instanceof-hit-two-objects-then-another.js | 23 - .../instanceof-late-constant-folding.js | 19 - .../stress/instanceof-non-object-prototype.js | 21 - .../stress/instanceof-not-cell.js | 44 - .../instanceof-prototype-change-to-hit.js | 27 - .../instanceof-prototype-change-to-null.js | 25 - ...tanceof-prototype-change-watchpointable.js | 22 - .../stress/instanceof-prototype-change.js | 25 - .../instanceof-proxy-check-structure.js | 59 - .../stress/instanceof-proxy-loop.js | 59 - .../javascriptcore/stress/instanceof-proxy.js | 47 - .../javascriptcore/stress/instanceof.js | 39 - .../int16-put-by-val-in-and-out-of-bounds.js | 18 - ...y-val-in-bounds-then-exit-out-of-bounds.js | 19 - ...-out-of-bounds-bounds-then-do-in-bounds.js | 19 - .../stress/int32-array-unshift.js | 6 - .../stress/int32-min-to-string.js | 43 - .../stress/int32-object-out-of-bounds.js | 37 - .../stress/int32-out-of-bounds.js | 31 - .../stress/int32-to-string-in-loop-removed.js | 8 - .../stress/int32array-transition-on-nan.js | 88 - ...int52-ai-mul-then-filter-int32-directly.js | 14 - .../javascriptcore/stress/int52-argument.js | 18 - .../stress/int52-force-osr-exit-path.js | 15 - .../stress/int52-inlined-call-argument.js | 19 - .../stress/int52-to-string-in-loop-removed.js | 8 - .../javascriptcore/stress/int52-variable.js | 18 - .../stress/int8-repeat-out-of-bounds.js | 17 - ...-optimization-constant-representation-1.js | 46 - ...-optimization-constant-representation-2.js | 43 - .../stress/internal-function-call.js | 9 - .../stress/internal-function-construct.js | 12 - .../stress/intl-constructors-with-proxy.js | 38 - ...ic-getter-with-poly-proto-getter-change.js | 33 - ...sic-getter-with-poly-proto-proto-change.js | 32 - .../intrinsic-getter-with-poly-proto.js | 31 - .../stress/invalidation-point.js | 24 - .../stress/inverted-additive-subsumption.js | 15 - .../is-undefined-exit-on-masquerader.js | 33 - .../is-undefined-jettison-on-masquerader.js | 21 - .../stress/is-undefined-masquerader.js | 20 - .../isInteger-doesnt-overwrite-argument.js | 13 - .../javascriptcore/stress/isLockFree.js | 75 - .../stress/iterator-field-order.js | 38 - .../stress/iterator-functions.js | 33 - .../javascriptcore/stress/iterator-names.js | 35 - .../stress/iterator-prototype.js | 53 - ...return-beyond-multiple-iteration-scopes.js | 172 - .../javascriptcore/stress/iterators-shape.js | 63 - ...then-cache-get-and-fold-then-invalidate.js | 33 - ...then-cache-get-and-fold-then-invalidate.js | 30 - ...ndle-double-constants-in-math-operators.js | 25 - ...cope-global-cache-watchpoint-invalidate.js | 26 - ...ngs-should-not-exceed-max-string-length.js | 30 - .../stress/js-fixed-array-out-of-memory.js | 25 - .../javascriptcore/stress/jsc-read.js | 36 - .../stress/json-parse-on-frozen-object.js | 75 - .../stress/large-unshift-splice.js | 18 - .../javascriptcore/stress/lars-sab-workers.js | 127 - .../stress/length-of-new-array-with-spread.js | 31 - .../stress/lexical-let-and-with-statement.js | 78 - .../stress/lexical-let-exception-handling.js | 202 - ...xical-let-global-not-captured-variables.js | 31 - .../stress/lexical-let-loop-semantics.js | 381 -- .../stress/lexical-let-not-strict-mode.js | 128 - .../stress/lexical-let-semantics.js | 412 -- .../javascriptcore/stress/lexical-let-tdz.js | 473 -- .../stress/lexical-scoping-break-continue.js | 216 - .../stress/lexical-scoping-for-loop.js | 61 - .../stress/licm-no-pre-header-nested.js | 23 - .../stress/licm-no-pre-header.js | 17 - .../stress/lift-tdz-bypass-catch.js | 10 - .../stress/lift-template-literal.js | 69 - ...uning-needed-for-osr-availability-eager.js | 16 - ...ess-pruning-needed-for-osr-availability.js | 15 - ...then-cache-get-and-fold-then-invalidate.js | 26 - ...id-cache-prototype-load-from-dictionary.js | 19 - ...-proto-get-by-id-cache-change-prototype.js | 19 - ...t-proto-get-by-id-cache-intercept-value.js | 17 - ...cope-global-cache-watchpoint-invalidate.js | 22 - .../llint-stack-overflow-debugging-opcodes.js | 8 - .../stress/llint-stack-overflow-location.js | 35 - .../load-hole-from-scope-into-live-var.js | 14 - ...varargs-elimination-bounds-check-barely.js | 35 - .../load-varargs-elimination-bounds-check.js | 35 - ...ray-with-spread-convert-to-static-loads.js | 28 - ...rargs-then-inlined-call-and-exit-strict.js | 43 - ...load-varargs-then-inlined-call-and-exit.js | 41 - ...d-varargs-then-inlined-call-exit-in-foo.js | 46 - .../load-varargs-then-inlined-call-inlined.js | 43 - .../stress/load-varargs-then-inlined-call.js | 39 - .../logical-not-masquerades-as-undefined.js | 35 - .../stress/logical-not-masquerades.js | 33 - .../javascriptcore/stress/logical-not.js | 34 - .../stress/make-dictionary-repatch.js | 36 - .../stress/make-large-string-jit-strcat.js | 25 - .../stress/make-large-string-jit.js | 24 - .../stress/make-large-string-strcat.js | 14 - .../stress/make-large-string.js | 14 - .../javascriptcore/stress/make-rope-2.js | 16 - .../javascriptcore/stress/make-rope-3.js | 16 - .../map-clone-instance-iterator-change.js | 20 - .../stress/map-clone-iterator-change.js | 20 - .../stress/map-clone-next-change.js | 21 - .../javascriptcore/stress/map-clone.js | 20 - .../stress/map-constructor-adder.js | 46 - .../javascriptcore/stress/map-constructor.js | 133 - .../stress/map-cse-correctness.js | 66 - .../javascriptcore/stress/map-delete.js | 19 - .../javascriptcore/stress/map-inherit-set.js | 31 - .../javascriptcore/stress/map-iteration.js | 395 -- ...rator-result-should-have-expected-shape.js | 33 - .../stress/map-iterators-next.js | 111 - .../javascriptcore/stress/map-rehash-2.js | 13 - .../javascriptcore/stress/map-rehash.js | 26 - .../stress/map-set-change-get.js | 21 - .../stress/map-set-check-failure.js | 35 - .../stress/map-set-clobber-map-get.js | 18 - .../stress/map-set-create-bucket.js | 23 - .../map-set-does-not-clobber-set-has.js | 19 - .../map-set-does-not-clobber-weak-map-get.js | 26 - .../stress/map-untyped-normalize-cse.js | 46 - .../stress/map-untyped-normalize.js | 44 - .../stress/marked-argument-buffer.js | 96 - ...vation-referenced-from-phantom-function.js | 42 - ...e-object-referenced-from-phantom-object.js | 37 - .../materialize-past-butterfly-allocation.js | 89 - .../stress/materialize-past-put-structure.js | 14 - .../stress/materialize-regexp-at-osr-exit.js | 24 - ...ialize-regexp-cyclic-regexp-at-osr-exit.js | 28 - .../materialize-regexp-cyclic-regexp.js | 46 - .../stress/materialize-regexp-cyclic.js | 39 - ...p-referenced-from-phantom-regexp-cyclic.js | 43 - ...e-regexp-referenced-from-phantom-regexp.js | 40 - .../stress/materialize-regexp.js | 24 - ...ect-last-index-set-by-match-at-osr-exit.js | 41 - ...exp-has-correct-last-index-set-by-match.js | 28 - .../multiply-typed-double-and-object.js | 63 - .../mutual-tail-call-no-stack-overflow.js | 73 - .../stress/nan-equal-untyped.js | 24 - .../javascriptcore/stress/nan-equal.js | 12 - .../stress/native-constructors-length.js | 41 - .../stress/native-error-properties.js | 79 - ...ness-for-unreachable-blocks-at-dfg-time.js | 31 - .../new-array-buffer-sinking-osrexit.js | 17 - .../javascriptcore/stress/new-array-dead.js | 42 - .../new-array-having-a-bad-time-double.js | 25 - .../new-array-storage-array-with-size.js | 29 - .../stress/new-array-then-exit.js | 14 - .../stress/new-array-with-size-div.js | 22 - ...-throw-exception-and-tear-off-arguments.js | 26 - .../new-array-with-size-with-bad-time.js | 34 - ...ray-with-spread-double-new-array-buffer.js | 18 - ...d-with-normal-spread-and-phantom-spread.js | 33 - ...th-spread-with-phantom-new-array-buffer.js | 28 - .../stress/new-contiguous-array-with-size.js | 31 - .../stress/new-double-array-with-size.js | 25 - .../new-function-expression-has-structures.js | 11 - .../stress/new-int32-array-with-size.js | 25 - ...new-largeish-contiguous-array-with-size.js | 47 - ...omise-capabilities-requires-constructor.js | 18 - .../javascriptcore/stress/new-regex-inline.js | 82 - .../stress/new-string-object.js | 16 - .../stress/new-target-syntax-errors.js | 184 - .../javascriptcore/stress/new-target.js | 201 - .../stress/new-typed-array-cse-effects.js | 28 - .../stress/new-undecided-array-with-size.js | 22 - .../stress/no-abc-skippy-loop.js | 24 - .../stress/no-abc-skippy-paired-loop.js | 20 - .../javascriptcore/stress/non-constructors.js | 116 - .../normalize-map-key-constant-folding.js | 13 - .../javascriptcore/stress/not-cell-use.js | 29 - .../javascriptcore/stress/number-is-finite.js | 37 - .../stress/number-is-integer-intrinsic.js | 72 - .../javascriptcore/stress/number-is-nan.js | 38 - ...umber-prototype-to-string-cast-overflow.js | 18 - .../number-prototype-to-string-exception.js | 20 - ...number-prototype-to-string-wrong-values.js | 29 - ...ng-should-accept-strange-number-objects.js | 11 - .../number-to-string-abstract-operation.js | 80 - .../stress/number-to-string-radix.js | 80 - .../number-to-string-strength-reduction.js | 14 - .../stress/number-to-string-with-add.js | 40 - .../stress/number-to-string-with-radix-10.js | 15 - .../stress/number-to-string-with-radix-cse.js | 21 - .../number-to-string-with-radix-invalid.js | 24 - .../number-to-string-with-radix-watchpoint.js | 27 - .../stress/number-to-string-with-radix.js | 21 - .../javascriptcore/stress/number-to-string.js | 80 - ...ric-setter-on-prototype-non-blank-array.js | 36 - .../stress/numeric-setter-on-prototype.js | 32 - .../stress/numeric-setter-on-self.js | 32 - .../stress/obj-rest-destructuring-order.js | 45 - .../javascriptcore/stress/obj-spread-order.js | 45 - .../javascriptcore/stress/object-add.js | 16 - ...with-uninitialized-property-on-one-path.js | 53 - .../object-assign-changing-properties.js | 80 - .../stress/object-assign-correctness.js | 180 - .../stress/object-assign-enumerable.js | 14 - .../stress/object-assign-order.js | 40 - .../stress/object-assign-proxy.js | 31 - .../stress/object-assign-string-first.js | 32 - .../stress/object-assign-symbols.js | 38 - .../javascriptcore/stress/object-assign.js | 26 - .../javascriptcore/stress/object-bit-and.js | 16 - .../javascriptcore/stress/object-bit-or.js | 16 - .../javascriptcore/stress/object-bit-xor.js | 16 - .../stress/object-constructor-boolean-edge.js | 18 - .../stress/object-constructor-global.js | 22 - .../stress/object-constructor-null-edge.js | 17 - .../stress/object-constructor-number-edge.js | 22 - .../stress/object-constructor-object-edge.js | 26 - ...-constructor-should-be-new-target-aware.js | 18 - .../stress/object-constructor-string-edge.js | 18 - .../stress/object-constructor-symbol-edge.js | 18 - .../object-constructor-undefined-edge.js | 17 - .../stress/object-create-define.js | 31 - .../stress/object-create-null-external.js | 16 - .../stress/object-create-null.js | 16 - .../stress/object-create-prototype.js | 17 - .../stress/object-create-undefined.js | 26 - .../javascriptcore/stress/object-div.js | 16 - .../javascriptcore/stress/object-entries.js | 123 - .../stress/object-escapes-in-loop.js | 17 - .../stress/object-freeze-accept-non-object.js | 15 - ...ect-freeze-with-proxy-preventExtensions.js | 29 - ...n-property-descriptor-perform-to-object.js | 43 - ...et-own-property-names-perform-to-object.js | 39 - ...-own-property-symbols-perform-to-object.js | 39 - .../stress/object-get-own-property-symbols.js | 35 - .../object-get-prototype-of-filtered.js | 64 - .../object-get-prototype-of-mono-proto.js | 34 - ...ject-get-prototype-of-perform-to-object.js | 29 - ...object-get-prototype-of-poly-mono-proto.js | 33 - .../object-get-prototype-of-poly-proto.js | 30 - .../object-is-extensible-accept-non-object.js | 15 - .../object-is-frozen-accept-non-object.js | 15 - .../object-is-sealed-accept-non-object.js | 15 - .../javascriptcore/stress/object-is.js | 72 - .../stress/object-iterate-symbols.js | 32 - .../javascriptcore/stress/object-iterate.js | 26 - .../stress/object-keys-perform-to-object.js | 39 - .../stress/object-literal-methods.js | 105 - .../javascriptcore/stress/object-lshift.js | 16 - .../javascriptcore/stress/object-mul.js | 16 - .../stress/object-number-properties.js | 148 - .../stress/object-own-property-keys.js | 45 - ...ct-prevent-extensions-accept-non-object.js | 15 - .../stress/object-proto-getter-filtered.js | 62 - .../object-proto-getter-poly-mono-proto.js | 34 - .../stress/object-proto-getter-poly-proto.js | 29 - ...ccessors-should-throw-on-undefined-this.js | 38 - .../stress/object-rest-deconstruct.js | 216 - .../javascriptcore/stress/object-rshift.js | 16 - .../stress/object-seal-accept-non-object.js | 15 - ...bject-seal-with-proxy-preventExtensions.js | 29 - .../javascriptcore/stress/object-spread.js | 313 -- .../javascriptcore/stress/object-sub.js | 16 - .../javascriptcore/stress/object-urshift.js | 16 - .../object-values-changing-properties.js | 96 - .../javascriptcore/stress/object-values.js | 113 - .../obscure-error-message-dont-crash.js | 13 - ...obviously-elidable-new-object-then-exit.js | 23 - .../stress/op-add-exceptions.js | 79 - .../stress/op-negate-inline-cache.js | 300 -- .../op-push-name-scope-crashes-profiler.js | 17 - .../javascriptcore/stress/op_add.js | 63 - .../javascriptcore/stress/op_bitand.js | 69 - .../javascriptcore/stress/op_bitor.js | 69 - .../javascriptcore/stress/op_bitxor.js | 69 - .../javascriptcore/stress/op_div-ConstVar.js | 19 - .../javascriptcore/stress/op_div-VarConst.js | 19 - .../javascriptcore/stress/op_div-VarVar.js | 19 - .../stress/op_lshift-ConstVar.js | 19 - .../stress/op_lshift-VarConst.js | 19 - .../javascriptcore/stress/op_lshift-VarVar.js | 19 - .../javascriptcore/stress/op_mod-ConstVar.js | 19 - .../javascriptcore/stress/op_mod-VarConst.js | 19 - .../javascriptcore/stress/op_mod-VarVar.js | 19 - .../javascriptcore/stress/op_mul-ConstVar.js | 19 - .../javascriptcore/stress/op_mul-VarConst.js | 19 - .../javascriptcore/stress/op_mul-VarVar.js | 19 - .../javascriptcore/stress/op_negate.js | 75 - .../javascriptcore/stress/op_postdec.js | 75 - .../javascriptcore/stress/op_postinc.js | 75 - .../javascriptcore/stress/op_predec.js | 75 - .../javascriptcore/stress/op_preinc.js | 75 - .../stress/op_rshift-ConstVar.js | 19 - .../stress/op_rshift-VarConst.js | 19 - .../javascriptcore/stress/op_rshift-VarVar.js | 19 - .../javascriptcore/stress/op_sub-ConstVar.js | 19 - .../javascriptcore/stress/op_sub-VarConst.js | 19 - .../javascriptcore/stress/op_sub-VarVar.js | 19 - .../stress/op_urshift-ConstVar.js | 19 - .../stress/op_urshift-VarConst.js | 19 - .../stress/op_urshift-VarVar.js | 19 - ...d-not-called-for-already-optimized-site.js | 12 - ...n-may-have-negative-int32-array-storage.js | 19 - ...ay-have-negative-int32-contiguous-array.js | 18 - ...in-may-have-negative-int32-double-array.js | 18 - ...n-may-have-negative-int32-generic-array.js | 18 - ...-in-may-have-negative-int32-int32-array.js | 18 - .../operation-in-may-have-negative-int32.js | 32 - .../operation-in-negative-int32-cast.js | 20 - .../stress/operation-in-throw-error.js | 28 - .../stress/optional-catch-binding-syntax.js | 30 - .../stress/optional-catch-binding.js | 50 - .../stress/ordinary-set-exceptions.js | 100 - ...catch-with-set-local-type-check-failure.js | 38 - ...-on-op-negate-should-no-fail-assertions.js | 22 - .../stress/other-is-object-or-null.js | 13 - .../stress/override-map-constructor.js | 4 - ...tart-calls-repeat-character-with-double.js | 43 - .../stress/parameter-scoping.js | 236 - .../parse-int-intrinsic-dfg-backend-flush.js | 14 - .../stress/parse-int-intrinsic.js | 97 - .../stress/parse-regexp-as-token.js | 7 - .../stress/path-sensitive-known-cell-crash.js | 21 - .../javascriptcore/stress/pathname-resolve.js | 64 - ...ments-set-local-then-exit-in-same-block.js | 17 - ...direct-arguments-clobber-argument-count.js | 20 - ...phantom-direct-arguments-clobber-callee.js | 21 - .../stress/phantom-inadequacy.js | 33 - ...m-local-captured-but-not-flushed-to-ssa.js | 21 - ...hantom-new-array-buffer-forward-varargs.js | 97 - ...antom-new-array-buffer-forward-varargs2.js | 33 - .../phantom-new-array-buffer-osr-exit.js | 46 - .../phantom-new-array-with-spread-osr-exit.js | 45 - .../stress/phantom-regexp-regexp-exec.js | 26 - .../stress/phantom-regexp-string-match.js | 26 - .../stress/phantom-spread-forward-varargs.js | 117 - .../stress/phantom-spread-osr-exit.js | 43 - .../stress/plus-boolean-exit.js | 22 - .../stress/plus-boolean-or-double.js | 24 - .../stress/plus-boolean-or-int.js | 24 - .../stress/poly-call-exit-this.js | 29 - .../javascriptcore/stress/poly-call-exit.js | 29 - .../stress/poly-call-stub-in-getter-stub.js | 37 - .../stress/poly-chain-getter.js | 30 - .../stress/poly-chain-setter.js | 32 - .../stress/poly-chain-then-getter.js | 31 - .../stress/poly-chain-then-setter.js | 33 - .../stress/poly-getter-combo.js | 40 - .../stress/poly-getter-then-chain.js | 31 - .../stress/poly-getter-then-self.js | 26 - .../stress/poly-proto-clear-stub.js | 101 - ...poly-proto-intrinsic-getter-correctness.js | 37 - .../javascriptcore/stress/poly-proto-miss.js | 51 - .../stress/poly-proto-op-in-caching.js | 64 - ...y-proto-prototype-map-having-a-bad-time.js | 30 - .../stress/poly-proto-put-transition.js | 52 - .../stress/poly-proto-set-prototype.js | 65 - .../stress/poly-proto-setter.js | 71 - .../stress/poly-proto-using-inheritance.js | 51 - .../javascriptcore/stress/poly-self-getter.js | 31 - .../stress/poly-self-then-getter.js | 26 - .../stress/poly-setter-combo.js | 77 - .../stress/poly-setter-then-self.js | 28 - .../stress/polymorphic-prototype-accesses.js | 28 - .../stress/promise-cannot-be-called.js | 44 - .../javascriptcore/stress/promise-finally.js | 387 -- ...ise-infinite-recursion-should-not-crash.js | 14 - .../stress/promise-species-functions.js | 72 - .../stress/prop-type-boolean-then-string.js | 29 - .../stress/prop-type-int32-then-string.js | 25 - .../stress/prop-type-number-then-string.js | 25 - .../prop-type-object-or-other-then-string.js | 33 - .../stress/prop-type-object-then-string.js | 25 - .../stress/prop-type-other-then-string.js | 25 - .../stress/prop-type-string-then-object.js | 25 - .../prop-type-struct-or-other-then-string.js | 36 - .../prop-type-struct-then-object-opt-fold.js | 34 - .../prop-type-struct-then-object-opt-multi.js | 30 - .../prop-type-struct-then-object-opt.js | 28 - .../stress/prop-type-struct-then-object.js | 25 - .../stress/prop-type-symbol-then-object.js | 25 - .../stress/prop-type-symbol-then-string.js | 26 - ...ble-after-force-exit-in-bytecode-parser.js | 27 - ...prototype-property-that-is-not-writable.js | 13 - ...-indexed-values-when-it-is-a-dictionary.js | 38 - ...called-for-bound-arguments-list-entries.js | 8 - .../javascriptcore/stress/proto-setter.js | 8 - ...has-dictionary-structure-for-in-caching.js | 36 - .../stress/prototype-for-async-generator.js | 19 - .../javascriptcore/stress/prototype-getter.js | 21 - .../stress/prototype-is-not-js-object.js | 32 - ...by-offset-replace-or-transition-variant.js | 58 - .../put-by-id-build-list-order-recurse.js | 35 - ...t-should-be-done-for-non-index-property.js | 41 - .../put-by-id-direct-strict-transition.js | 13 - .../stress/put-by-id-direct-transition.js | 11 - ...t-after-prototype-transition-non-strict.js | 31 - ...bject-after-prototype-transition-strict.js | 33 - .../put-by-id-strict-build-list-order.js | 16 - .../put-by-id-throw-through-optimized-code.js | 33 - .../put-by-id-transition-null-prototype.js | 13 - .../stress/put-by-val-array-storage.js | 40 - .../stress/put-by-val-out-of-bounds-basics.js | 87 - .../put-by-val-slow-put-array-storage.js | 67 - .../stress/put-by-val-with-string-break.js | 25 - .../put-by-val-with-string-generated.js | 34 - .../stress/put-by-val-with-string-generic.js | 25 - .../stress/put-by-val-with-symbol-break.js | 25 - .../stress/put-by-val-with-symbol-generic.js | 25 - .../stress/put-direct-index-broken-2.js | 248 - .../stress/put-direct-index-broken.js | 25 - ...t-getter-setter-by-id-strict-transition.js | 13 - .../put-getter-setter-by-id-transition.js | 11 - .../stress/put-indexed-getter-setter.js | 18 - .../stress/put-inline-cache-side-effects.js | 30 - .../stress/put-local-conservative.js | 47 - .../stress/put-on-cow-prototype.js | 18 - .../stress/raise-error-in-iterator-close.js | 118 - .../javascriptcore/stress/random-53bit.js | 28 - .../javascriptcore/stress/random-in-range.js | 14 - ...d-varargs-for-inlined-escaped-arguments.js | 25 - .../stress/recurse-infinitely-on-getter.js | 23 - ...tail-call-with-different-argument-count.js | 25 - .../stress/recursive-try-catch.js | 89 - ...property_redefine_during_inline_caching.js | 23 - .../stress/redundant-add-overflow-checks.js | 18 - ...array-bounds-checks-addition-skip-first.js | 50 - .../redundant-array-bounds-checks-addition.js | 50 - ...-array-bounds-checks-unchecked-addition.js | 50 - .../stress/redundant-array-bounds-checks.js | 46 - .../javascriptcore/stress/reflect-apply.js | 91 - .../stress/reflect-construct.js | 228 - .../stress/reflect-define-property.js | 286 - .../stress/reflect-delete-property.js | 56 - .../stress/reflect-get-own-property.js | 147 - .../stress/reflect-get-prototype-of.js | 50 - .../javascriptcore/stress/reflect-get.js | 91 - .../javascriptcore/stress/reflect-has.js | 65 - .../stress/reflect-is-extensible.js | 28 - .../javascriptcore/stress/reflect-own-keys.js | 46 - .../stress/reflect-prevent-extensions.js | 31 - .../stress/reflect-set-prototype-of.js | 75 - .../stress/reflect-set-proxy-set.js | 671 --- .../stress/reflect-set-receiver-proxy-set.js | 704 --- .../stress/reflect-set-with-global-proxy.js | 206 - .../javascriptcore/stress/reflect-set.js | 1225 ----- .../javascriptcore/stress/reflect.js | 9 - .../regexp-exec-effect-after-exception.js | 26 - .../regexp-exec-test-effectful-last-index.js | 50 - .../stress/regexp-large-quantifier.js | 16 - .../stress/regexp-last-index-sinking.js | 23 - .../stress/regexp-last-index-writable.js | 52 - ...regexp-match-in-other-realm-should-work.js | 10 - .../stress/regexp-match-proxy.js | 166 - ...objects-not-inheriting-object-prototype.js | 11 - .../javascriptcore/stress/regexp-match.js | 102 - .../stress/regexp-matches-array-bad-time.js | 19 - .../stress/regexp-matches-array-slow-put.js | 15 - .../stress/regexp-matches-array.js | 14 - .../regexp-prototype-exec-on-too-long-rope.js | 33 - ...regexp-prototype-match-on-too-long-rope.js | 33 - ...e-replace-builtin-should-not-use-for-of.js | 6 - .../regexp-prototype-test-on-too-long-rope.js | 33 - .../stress/regexp-prototype-tostring.js | 90 - ...gexp-replace-in-other-realm-should-work.js | 10 - .../stress/regexp-replace-proxy.js | 154 - ...objects-not-inheriting-object-prototype.js | 11 - .../javascriptcore/stress/regexp-search.js | 104 - .../regexp-syntax-error-invalid-flags.js | 23 - .../stress/regexp-with-nonBMP-any.js | 10 - .../regexp-with-runtime-syntax-errors.js | 66 - .../relaxed-line-terminators-in-string.js | 14 - .../stress/remove-phantom-after-setlocal.js | 18 - ...l-with-same-value-watchpoint-invalidate.js | 23 - .../stress/repeated-arity-check-fail.js | 8 - ...eated-put-by-id-reallocating-transition.js | 87 - .../replacement-watchpoint-dictionary.js | 27 - .../stress/replacement-watchpoint.js | 22 - .../javascriptcore/stress/rest-elements.js | 193 - ...er-allocation-elimination-watchpoints-2.js | 19 - ...er-allocation-elimination-watchpoints-3.js | 22 - ...er-allocation-elimination-watchpoints-4.js | 20 - ...er-allocation-elimination-watchpoints-5.js | 25 - ...eter-allocation-elimination-watchpoints.js | 22 - .../rest-parameter-and-default-arguments.js | 36 - .../stress/rest-parameter-basics.js | 103 - .../rest-parameter-having-a-bad-time.js | 68 - .../stress/rest-parameter-inlined.js | 38 - .../stress/rest-parameter-is-destructuring.js | 88 - .../stress/rest-parameter-many-arguments.js | 51 - .../stress/rest-parameter-negative.js | 21 - .../stress/rest-parameter-various-types.js | 98 - .../stress/retry-cache-later.js | 18 - ...right-left-context-invalidated-by-input.js | 25 - .../stress/ropes-symbol-toprimitive.js | 28 - .../runtime-throw-through-optimized-code.js | 33 - .../sampling-profiler-anonymous-function.js | 22 - .../stress/sampling-profiler-basic.js | 44 - .../sampling-profiler-bound-function-name.js | 28 - .../stress/sampling-profiler-deep-stack.js | 33 - .../stress/sampling-profiler-display-name.js | 49 - ...ampling-profiler-internal-function-name.js | 17 - .../stress/scoped-arguments-array-length.js | 17 - .../stress/scoped-arguments-check-array.js | 41 - ...rguments-out-of-bounds-change-structure.js | 30 - .../stress/scoped-arguments-test.js | 16 - ...write-barrier-should-be-on-scope-object.js | 35 - ...direct-arguments-get-by-val-in-baseline.js | 30 - .../stress/set-add-check-failure.js | 35 - .../stress/set-add-clobber-set-has.js | 20 - .../stress/set-add-create-bucket.js | 26 - .../set-add-does-not-clobber-map-get.js | 19 - .../set-clone-instance-iterator-change.js | 17 - .../stress/set-clone-iterator-change.js | 17 - .../stress/set-clone-next-change.js | 17 - .../javascriptcore/stress/set-clone.js | 16 - .../stress/set-constructor-adder.js | 34 - .../javascriptcore/stress/set-constructor.js | 69 - .../javascriptcore/stress/set-inherit-add.js | 28 - ...rator-result-should-have-expected-shape.js | 33 - .../stress/set-iterators-next.js | 115 - .../stress/set-same-prototype.js | 38 - .../stress/set-untyped-normalize-cse.js | 44 - .../stress/set-untyped-normalize.js | 44 - .../javascriptcore/stress/simple-ai-effect.js | 39 - ...imple-polyvariant-call-inlining-example.js | 32 - ...-polyvariant-get-by-id-inlining-example.js | 24 - ...-polyvariant-put-by-id-inlining-example.js | 26 - .../stress/simple-prototype-accesses.js | 20 - .../stress/simple-regexp-exec-folding-fail.js | 11 - .../stress/simple-regexp-exec-folding.js | 19 - .../stress/simple-regexp-test-folding-fail.js | 11 - .../stress/simple-regexp-test-folding.js | 11 - ...gs-mandatory-minimum-smaller-than-limit.js | 15 - .../stress/singleton-scope-then-overwrite.js | 20 - ...gleton-scope-then-realloc-and-overwrite.js | 20 - .../stress/singleton-scope-then-realloc.js | 20 - .../sink-arguments-past-invalid-check-dfg.js | 17 - ...-arguments-past-invalid-check-int32-dfg.js | 12 - ...sink-arguments-past-invalid-check-int32.js | 24 - ...k-arguments-past-invalid-check-sneakier.js | 37 - .../sink-arguments-past-invalid-check.js | 23 - ...nk-function-past-invalid-check-sneakier.js | 35 - ...sink-function-past-invalid-check-sneaky.js | 13 - .../stress/sink-multigetbyoffset.js | 27 - .../sink-object-past-invalid-check-int32.js | 24 - ...sink-object-past-invalid-check-sneakier.js | 32 - .../sink-object-past-invalid-check-sneaky.js | 20 - .../stress/sink-object-past-invalid-check.js | 20 - .../sink-phantom-new-array-buffer-exit-ok.js | 8 - .../stress/sink-put-stack-over-kill-stack.js | 16 - ...sible-multi-get-by-offset-on-prototypes.js | 41 - .../stress/sink_checkstructure.js | 17 - ...ult-to-fold-reflective-arguments-access.js | 16 - .../stress/sloppy-mode-function-hoisting.js | 743 --- ...ents-function-non-simple-parameter-list.js | 158 - ...ath-generator-updating-current-node-dfg.js | 27 - .../stress/sort-array-with-undecided.js | 1 - .../sorting-boolean-result-comparator.js | 15 - .../javascriptcore/stress/source-origin.js | 11 - .../stress/sparse-define-empty-descriptor.js | 6 - .../stress/sparse-map-non-overlapping.js | 26 - .../sparse-map-non-skip-getter-overriding.js | 21 - .../stress/sparse-map-non-skip.js | 44 - .../javascriptcore/stress/sparse_splice.js | 12 - .../spec-empty-flows-through-cell-checks.js | 24 - .../stress/splay-flash-access-1ms.js | 903 ---- .../stress/splay-flash-access.js | 904 ---- .../spread-array-iterator-watchpoint-2.js | 22 - .../spread-array-iterator-watchpoint.js | 25 - .../spread-call-convert-to-static-call.js | 29 - .../javascriptcore/stress/spread-calling.js | 83 - .../stress/spread-capture-rest.js | 80 - .../spread-consults-correct-global-object.js | 18 - ...spread-escapes-but-create-rest-does-not.js | 35 - ...es-but-new-array-buffer-does-not-double.js | 35 - ...d-escapes-but-new-array-buffer-does-not.js | 35 - ...ead-forward-call-varargs-stack-overflow.js | 58 - ...st-parameter-change-iterator-protocol-2.js | 46 - ...rest-parameter-change-iterator-protocol.js | 49 - .../spread-forward-varargs-stack-overflow.js | 52 - .../javascriptcore/stress/spread-in-tail.js | 18 - .../stress/spread-multi-layers.js | 47 - .../javascriptcore/stress/spread-non-array.js | 62 - .../stress/spread-non-varargs.js | 35 - .../stress/spread-optimized-properly.js | 155 - .../stress/spread-outer-create-rest.js | 22 - .../stress/static-function-delete.js | 10 - .../stress/static-function-put.js | 11 - .../stress/static-getter-delete.js | 47 - .../stress/static-getter-descriptors.js | 12 - .../stress/static-getter-enumeration.js | 8 - .../stress/static-getter-get.js | 22 - .../stress/static-getter-in-names.js | 7 - .../stress/static-getter-names.js | 16 - .../stress/static-getter-put.js | 38 - .../javascriptcore/stress/strcat-emtpy.js | 14 - .../stress/strict-function-structure.js | 8 - .../stress/strict-mode-arguments-caller.js | 13 - .../strict-nested-function-structure.js | 12 - .../stress/strict-to-this-int.js | 25 - .../javascriptcore/stress/string-compare.js | 78 - ...rom-char-code-change-structure-not-dead.js | 31 - .../string-from-char-code-change-structure.js | 29 - .../stress/string-from-char-code-slow.js | 10 - .../stress/string-from-code-point.js | 135 - ...string-ident-to-not-string-var-equality.js | 32 - .../stress/string-instanceof.js | 13 - .../javascriptcore/stress/string-iterators.js | 212 - ...g-joining-long-strings-should-not-crash.js | 16 - .../javascriptcore/stress/string-normalize.js | 120 - .../string-object-define-own-property.js | 69 - .../stress/string-object-put-by-index.js | 41 - ...ring-out-of-bounds-negative-proto-value.js | 14 - .../javascriptcore/stress/string-proto.js | 12 - ...g-prototype-charCodeAt-on-too-long-rope.js | 33 - ...ndsWith-startsWith-includes-correctness.js | 180 - ...memory-error-when-using-too-much-memory.js | 23 - ...copes-global-lexical-environment-strict.js | 15 - ...otype-scopes-global-lexical-environment.js | 13 - .../stress/string-prototype-scopes-strict.js | 51 - .../stress/string-prototype-scopes.js | 54 - .../javascriptcore/stress/string-raw.js | 154 - .../stress/string-repeat-copy-chars-crash.js | 8 - .../stress/string-repeat-edge-cases.js | 57 - ...ce-constant-folding-replacer-not-string.js | 13 - .../stress/string-replace-proxy.js | 50 - .../stress/string-rope-with-custom-valueof.js | 61 - .../stress/string-symbol-customization.js | 108 - .../stress/sub-order-evaluation.js | 27 - .../stress/sub-overflows-after-not-equal.js | 16 - ...super-call-does-not-look-up-constructor.js | 20 - .../stress/super-call-function-subclass.js | 15 - .../stress/super-dot-call-and-apply.js | 50 - .../stress/super-force-ic-fail.js | 56 - .../stress/super-getter-reset-ic.js | 33 - .../stress/super-in-lexical-scope.js | 63 - .../stress/super-method-calls-check-tdz.js | 25 - .../super-property-access-exceptions.js | 153 - ...roperty-access-object-literal-to-this-2.js | 58 - ...-property-access-object-literal-to-this.js | 108 - .../stress/super-property-access-tdz.js | 92 - .../stress/super-property-access-to-this.js | 48 - .../stress/super-property-access.js | 586 --- .../stress/switch-typeof-indirect.js | 41 - .../stress/switch-typeof-slightly-indirect.js | 39 - .../javascriptcore/stress/switch-typeof.js | 36 - .../stress/symbol-and-string-constructor.js | 10 - .../stress/symbol-array-from.js | 26 - .../stress/symbol-define-property.js | 33 - .../stress/symbol-description.js | 83 - .../stress/symbol-equality-over-gc.js | 23 - .../javascriptcore/stress/symbol-equality.js | 34 - .../stress/symbol-error-messages.js | 46 - .../stress/symbol-get-own-property.js | 14 - .../stress/symbol-hasInstance.js | 54 - .../stress/symbol-instanceof.js | 13 - .../javascriptcore/stress/symbol-registry.js | 125 - .../stress/symbol-seal-and-freeze.js | 26 - .../stress/symbol-should-not-break-for-in.js | 29 - .../javascriptcore/stress/symbol-species.js | 15 - .../stress/symbol-toprimitive-errors.js | 46 - .../stress/symbol-toprimitive.js | 18 - .../stress/symbol-tostringtag-watchpoints.js | 62 - .../stress/symbol-tostringtag.js | 48 - .../javascriptcore/stress/symbol-with-json.js | 29 - .../stress/tagged-template-object-collect.js | 16 - .../stress/tagged-template-object.js | 25 - .../stress/tagged-template-tdz.js | 51 - .../stress/tagged-templates-identity.js | 141 - .../stress/tagged-templates-raw-strings.js | 63 - .../stress/tagged-templates-syntax.js | 70 - .../tagged-templates-template-object.js | 43 - .../stress/tagged-templates-this.js | 26 - .../javascriptcore/stress/tagged-templates.js | 67 - .../stress/tail-call-host-call-throw.js | 36 - .../stress/tail-call-in-inline-cache.js | 10 - .../stress/tail-call-no-stack-overflow.js | 45 - .../stress/tail-call-profiler.js | 29 - .../stress/tail-call-recognize.js | 183 - .../tail-call-varargs-no-stack-overflow.js | 28 - .../tail-calls-dont-overwrite-live-stack.js | 30 - .../stress/tdz-this-in-try-catch.js | 22 - .../template-literal-line-terminators.js | 57 - .../stress/template-literal-syntax.js | 111 - .../javascriptcore/stress/template-literal.js | 239 - .../stress/template-string-tags-eval.js | 17 - .../javascriptcore/stress/test-finally.js | 1446 ------ .../throw-from-ftl-call-ic-slow-path-cells.js | 192 - ...ow-from-ftl-call-ic-slow-path-undefined.js | 192 - .../throw-from-ftl-call-ic-slow-path.js | 192 - .../stress/throw-from-ftl-in-loop.js | 13 - .../javascriptcore/stress/throw-from-ftl.js | 25 - .../stress/throw-through-optimized-code.js | 30 - ...tier-up-in-loop-with-cfg-simplification.js | 24 - .../stress/to-int32-sensible.js | 40 - .../stress/to-int32-sensible2.js | 55 - .../to-lower-case-intrinsic-on-empty-rope.js | 26 - .../javascriptcore/stress/to-lower-case.js | 30 - .../javascriptcore/stress/to-number-basics.js | 22 - ...mber-convert-identity-without-execution.js | 26 - .../javascriptcore/stress/to-number-int52.js | 29 - ...c-convert-to-identity-without-execution.js | 22 - .../stress/to-number-intrinsic-int52.js | 29 - ...mber-intrinsic-object-without-execution.js | 18 - .../to-number-intrinsic-value-profiling.js | 18 - .../to-number-object-without-execution.js | 20 - .../javascriptcore/stress/to-number-object.js | 70 - .../to-number-throws-correct-exception.js | 121 - .../stress/to-number-value-profiling.js | 19 - .../stress/to-property-key-correctness.js | 130 - .../javascriptcore/stress/to-string-int32.js | 59 - .../javascriptcore/stress/to-string-int52.js | 59 - .../stress/to-string-non-cell-use.js | 43 - .../stress/to-string-on-object-or-string.js | 27 - .../stress/to-string-on-object.js | 19 - .../stress/to-string-on-string-object.js | 15 - ...-on-string-or-string-object-then-object.js | 35 - .../to-string-on-string-or-string-object.js | 23 - .../stress/to-string-on-value-or-string.js | 23 - .../stress/to-string-on-value.js | 15 - .../stress/to-string-with-int52.js | 15 - ...this-that-starts-as-lexical-environment.js | 58 - .../javascriptcore/stress/to-this-boolean.js | 22 - .../javascriptcore/stress/to-this-double.js | 8 - .../stress/to-this-global-object.js | 25 - .../javascriptcore/stress/to-this-int32.js | 8 - .../javascriptcore/stress/to-this-int52.js | 8 - .../javascriptcore/stress/to-this-number.js | 20 - .../javascriptcore/stress/to-this-numbers.js | 19 - ...to-this-on-constant-lexical-environment.js | 19 - .../stress/to-this-polymorphic.js | 25 - .../javascriptcore/stress/to-this-string.js | 27 - .../javascriptcore/stress/to-this-symbol.js | 18 - .../stress/toprimitive-speculated-types.js | 27 - .../trailing-comma-in-function-parameters.js | 63 - .../stress/trailing-comma-in-patterns.js | 157 - ...creates-the-activation-outside-the-loop.js | 36 - ...creates-the-activation-outside-the-loop.js | 33 - ...creates-the-activation-outside-the-loop.js | 31 - ...inite-loop-that-uses-captured-variables.js | 30 - .../javascriptcore/stress/trim.js | 53 - ...ly-foldable-reflective-arguments-access.js | 15 - ...etter-as-get-by-id-register-restoration.js | 57 - .../stress/try-catch-getter-as-get-by-id.js | 53 - .../stress/try-catch-setter-as-put-by-id.js | 54 - .../stress/try-catch-stub-routine-replaced.js | 87 - ...hoist-check-structure-on-tdz-this-value.js | 51 - .../stress/type-of-functions-and-objects.js | 86 - .../stress/typed-array-byte-offset.js | 17 - .../typed-array-get-by-val-profiling.js | 91 - .../typed-array-put-by-val-profiling.js | 98 - ...-view-set-should-not-crash-on-exception.js | 27 - .../typedarray-access-monomorphic-neutered.js | 54 - .../stress/typedarray-access-neutered.js | 30 - .../typedarray-add-property-to-base-object.js | 21 - .../stress/typedarray-bad-getter.js | 36 - .../stress/typedarray-configure-index.js | 57 - .../stress/typedarray-construct-iterator.js | 66 - .../stress/typedarray-constructor.js | 69 - .../stress/typedarray-copyWithin.js | 16 - .../javascriptcore/stress/typedarray-every.js | 56 - .../javascriptcore/stress/typedarray-fill.js | 49 - .../stress/typedarray-filter.js | 103 - .../javascriptcore/stress/typedarray-find.js | 53 - .../stress/typedarray-findIndex.js | 53 - .../stress/typedarray-forEach.js | 91 - .../javascriptcore/stress/typedarray-from.js | 47 - .../typedarray-functions-with-neutered.js | 169 - ...edarray-getownproperty-not-configurable.js | 20 - .../stress/typedarray-getter-on-self.js | 43 - ...typedarray-hasOwnProperty-out-of-bounds.js | 20 - .../stress/typedarray-includes.js | 10 - .../stress/typedarray-indexOf.js | 67 - ...rray-intrinsic-getters-change-prototype.js | 39 - .../stress/typedarray-lastIndexOf.js | 64 - .../stress/typedarray-length-dictionary.js | 19 - .../javascriptcore/stress/typedarray-map.js | 102 - .../javascriptcore/stress/typedarray-of.js | 21 - .../stress/typedarray-reduce.js | 59 - .../stress/typedarray-reduceRight.js | 59 - .../javascriptcore/stress/typedarray-set.js | 27 - .../javascriptcore/stress/typedarray-slice.js | 172 - .../javascriptcore/stress/typedarray-some.js | 56 - .../javascriptcore/stress/typedarray-sort.js | 57 - .../stress/typedarray-subarray.js | 78 - ...edarray-view-string-properties-neutered.js | 49 - .../stress/typeof-dfg-function-or-object.js | 25 - .../javascriptcore/stress/typeof-symbol.js | 16 - .../stress/uint32-comparison-jump.js | 141 - .../stress/uint32-comparison.js | 88 - .../uint32-to-number-constant-folding.js | 84 - ...o-number-fold-constant-with-do-overflow.js | 27 - .../uint32-to-number-overflows-to-uint52.js | 50 - .../stress/uint32array-unsigned-load.js | 15 - .../javascriptcore/stress/undecided-concat.js | 8 - .../javascriptcore/stress/undecided-length.js | 25 - ...ned-access-dictionary-then-proto-change.js | 17 - .../undefined-access-then-proto-change.js | 19 - .../undefined-access-then-self-change.js | 18 - .../javascriptcore/stress/unescape.js | 7 - .../javascriptcore/stress/unscopables.js | 239 - .../stress/unshift-array-storage.js | 13 - ...shiftCountSlowCase-correct-postCapacity.js | 26 - .../javascriptcore/stress/untyped-add.js | 16 - .../javascriptcore/stress/untyped-bit-and.js | 16 - .../javascriptcore/stress/untyped-bit-or.js | 16 - .../javascriptcore/stress/untyped-bit-xor.js | 16 - .../javascriptcore/stress/untyped-div.js | 16 - .../javascriptcore/stress/untyped-equality.js | 20 - .../stress/untyped-less-than.js | 23 - .../javascriptcore/stress/untyped-lshift.js | 16 - .../javascriptcore/stress/untyped-mul.js | 16 - .../javascriptcore/stress/untyped-rshift.js | 16 - .../javascriptcore/stress/untyped-sub.js | 16 - .../javascriptcore/stress/untyped-urshift.js | 16 - .../stress/use-arguments-as-object-pointer.js | 13 - .../javascriptcore/stress/v8-crypto-strict.js | 1697 ------ .../stress/v8-deltablue-strict.js | 878 ---- .../stress/v8-earley-boyer-strict.js | 4592 ----------------- .../stress/v8-parameter-scoping.js | 103 - .../stress/v8-raytrace-strict.js | 904 ---- .../javascriptcore/stress/v8-regexp-strict.js | 1615 ------ .../stress/v8-richards-strict.js | 539 -- .../javascriptcore/stress/v8-splay-strict.js | 395 -- .../value-add-on-double-array-with-holes.js | 100 - .../javascriptcore/stress/value-to-boolean.js | 67 - .../value-to-int32-undefined-constant.js | 12 - .../stress/value-to-int32-undefined.js | 12 - .../stress/values-unscopables.js | 53 - .../var-injection-cache-invalidation.js | 21 - ...arargs-closure-inlined-exit-strict-mode.js | 26 - .../stress/varargs-closure-inlined-exit.js | 24 - .../javascriptcore/stress/varargs-exit.js | 21 - .../stress/varargs-inlined-exit.js | 25 - ...imple-exit-aliasing-weird-reversed-args.js | 42 - ...args-inlined-simple-exit-aliasing-weird.js | 42 - .../varargs-inlined-simple-exit-aliasing.js | 41 - .../stress/varargs-inlined-simple-exit.js | 28 - .../stress/varargs-inlining-underflow.js | 18 - .../stress/varargs-no-forward.js | 18 - .../javascriptcore/stress/varargs-simple.js | 18 - .../stress/varargs-then-slow-call.js | 40 - .../stress/varargs-too-few-arguments.js | 16 - .../stress/varargs-two-level.js | 22 - .../varargs-varargs-closure-inlined-exit.js | 24 - ...arargs-varargs-inlined-exit-strict-mode.js | 27 - .../stress/varargs-varargs-inlined-exit.js | 25 - .../stress/varargs-with-unused-count.js | 23 - .../stress/variable-named-eval-under-tdz.js | 87 - .../stress/variable-under-tdz-eval-tricky.js | 60 - .../vector-length-hint-array-constructor.js | 18 - .../stress/vector-length-hint-new-array.js | 18 - .../watchdog-dont-malloc-when-in-c-code.js | 5 - .../stress/weak-map-constructor-adder.js | 51 - .../stress/weak-map-constructor.js | 144 - .../stress/weak-set-constructor-adder.js | 51 - .../stress/weak-set-constructor.js | 146 - .../stress/weakmap-cse-set-break.js | 24 - .../javascriptcore/stress/weakmap-cse.js | 21 - .../javascriptcore/stress/weakmap-gc.js | 11 - .../javascriptcore/stress/weakmap-set-cse.js | 22 - .../javascriptcore/stress/weakset-add-cse.js | 22 - .../stress/weakset-cse-add-break.js | 24 - .../javascriptcore/stress/weakset-cse.js | 21 - .../javascriptcore/stress/weakset-gc.js | 11 - .../stress/weird-equality-folding-cases.js | 13 - .../stress/weird-getter-counter.js | 24 - .../stress/weird-put-stack-varargs.js | 26 - .../stress/weird-setter-counter-syntactic.js | 29 - .../stress/weird-setter-counter.js | 26 - .../javascriptcore/stress/with.js | 24 - .../javascriptcore/stress/with_and_arith.js | 6 - .../stress/yield-and-line-terminator.js | 36 - .../stress/yield-label-generator.js | 58 - .../javascriptcore/stress/yield-label.js | 64 - .../stress/yield-named-accessors-generator.js | 17 - .../stress/yield-named-accessors.js | 17 - .../stress/yield-named-variable-generator.js | 112 - .../stress/yield-named-variable.js | 198 - .../stress/yield-out-of-generator.js | 166 - .../stress/yield-reserved-word.js | 196 - .../stress/yield-star-throw-continue.js | 73 - 1642 files changed, 92320 deletions(-) delete mode 100644 implementation-contributed/javascriptcore/stress/Number-isNaN-basics.js delete mode 100644 implementation-contributed/javascriptcore/stress/Object_static_methods_Object.getOwnPropertyDescriptors-proxy.js delete mode 100644 implementation-contributed/javascriptcore/stress/Object_static_methods_Object.getOwnPropertyDescriptors.js delete mode 100644 implementation-contributed/javascriptcore/stress/OverrideHasInstance-should-not-branch-across-register-allocations.js delete mode 100644 implementation-contributed/javascriptcore/stress/SharedArrayBuffer-opt.js delete mode 100644 implementation-contributed/javascriptcore/stress/SharedArrayBuffer.js delete mode 100644 implementation-contributed/javascriptcore/stress/activation-sink-default-value-tdz-error.js delete mode 100644 implementation-contributed/javascriptcore/stress/activation-sink-default-value.js delete mode 100644 implementation-contributed/javascriptcore/stress/activation-sink-osrexit-default-value-tdz-error.js delete mode 100644 implementation-contributed/javascriptcore/stress/activation-sink-osrexit-default-value.js delete mode 100644 implementation-contributed/javascriptcore/stress/activation-sink-osrexit.js delete mode 100644 implementation-contributed/javascriptcore/stress/activation-sink.js delete mode 100644 implementation-contributed/javascriptcore/stress/activation-test-loop.js delete mode 100644 implementation-contributed/javascriptcore/stress/add-constant-overflow-recovery.js delete mode 100644 implementation-contributed/javascriptcore/stress/add-inferred-type-table-to-existing-structure.js delete mode 100644 implementation-contributed/javascriptcore/stress/add-int52-constant-overflow-recovery.js delete mode 100644 implementation-contributed/javascriptcore/stress/add-int52-large-constant-overflow-recovery.js delete mode 100644 implementation-contributed/javascriptcore/stress/add-overflow-recovery.js delete mode 100644 implementation-contributed/javascriptcore/stress/add-overflows-after-not-equal.js delete mode 100644 implementation-contributed/javascriptcore/stress/add-small-constant-overflow-recovery.js delete mode 100644 implementation-contributed/javascriptcore/stress/ai-consistency-filter-cells.js delete mode 100644 implementation-contributed/javascriptcore/stress/ai-create-this-to-new-object-fire.js delete mode 100644 implementation-contributed/javascriptcore/stress/ai-create-this-to-new-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/ai-needs-to-model-spreads-effects.js delete mode 100644 implementation-contributed/javascriptcore/stress/allocation-sinking-defs-may-have-replacements.js delete mode 100644 implementation-contributed/javascriptcore/stress/allocation-sinking-new-object-with-poly-proto.js delete mode 100644 implementation-contributed/javascriptcore/stress/allocation-sinking-puthint-control-flow.js delete mode 100644 implementation-contributed/javascriptcore/stress/always-enter-dictionary-indexing-mode-with-getter.js delete mode 100644 implementation-contributed/javascriptcore/stress/any-int-as-double-add.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-callee-uninitialized.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-captured.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-copy-register-array-backing-store.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-custom-properties-gc.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-define-property.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-elimination-candidate-listings-should-respect-pseudo-terminals.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-elimination-force-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-elimination-throw.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-elimination-varargs-too-many-args-arg-count.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-exit-fixed.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-exit-strict-mode-fixed.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-exit-strict-mode.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-inlined-exit-strict-mode-fixed.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-inlined-exit-strict-mode.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-inlined-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-interference-cfg.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-interference.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-iterator.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-length-always-dont-enum.js delete mode 100644 implementation-contributed/javascriptcore/stress/arguments-non-configurable.js delete mode 100644 implementation-contributed/javascriptcore/stress/arith-abs-overflow.js delete mode 100644 implementation-contributed/javascriptcore/stress/arith-abs-to-arith-negate-range-optimizaton.js delete mode 100644 implementation-contributed/javascriptcore/stress/arith-abs-with-bitwise-or-zero.js delete mode 100644 implementation-contributed/javascriptcore/stress/arith-add-on-double-array-with-holes.js delete mode 100644 implementation-contributed/javascriptcore/stress/arith-add-with-constant-overflow.js delete mode 100644 implementation-contributed/javascriptcore/stress/arith-add-with-constants.js delete mode 100644 implementation-contributed/javascriptcore/stress/arith-clz32-effects.js delete mode 100644 implementation-contributed/javascriptcore/stress/arith-modulo-node-behaviors.js delete mode 100644 implementation-contributed/javascriptcore/stress/arith-modulo-twice.js delete mode 100644 implementation-contributed/javascriptcore/stress/arith-mul-with-constants.js delete mode 100644 implementation-contributed/javascriptcore/stress/arith-nodes-abstract-interpreter-untypeduse.js delete mode 100644 implementation-contributed/javascriptcore/stress/arith-profile-for-negate-can-see-non-number-due-to-dfg-osr-exit-profiling.js delete mode 100644 implementation-contributed/javascriptcore/stress/arith-sub-on-double-array-with-holes.js delete mode 100644 implementation-contributed/javascriptcore/stress/arity-check-ftl-throw-more-args.js delete mode 100644 implementation-contributed/javascriptcore/stress/arity-check-ftl-throw.js delete mode 100644 implementation-contributed/javascriptcore/stress/arity-fixup-inlining-dont-generate-invalid-use.js delete mode 100644 implementation-contributed/javascriptcore/stress/arity-fixup-should-not-touch-stack-area-below-sp.js delete mode 100644 implementation-contributed/javascriptcore/stress/arity-mismatch-arguments-length.js delete mode 100644 implementation-contributed/javascriptcore/stress/arity-mismatch-inlining-extra-slots.js delete mode 100644 implementation-contributed/javascriptcore/stress/arity-mismatch-inlining.js delete mode 100644 implementation-contributed/javascriptcore/stress/arity-mismatch-rest.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-buffer-byte-length.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-concat-fast-spread-proxy.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-concat-on-frozen-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-concat-spread-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-concat-spread-proxy-exception-check.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-concat-spread-proxy.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-concat-with-slow-indexingtypes.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-constructor-no-result.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-copywithin.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-fill-put-by-val.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-filter-put-by-val-direct.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-find-does-not-lookup-twice.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-flatmap.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-flatten.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-from-abs-and-floor.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-from-put-by-val-direct.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-from-set-length.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-from-with-accessors.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-from-with-iterable.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-from-with-iterator.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-array-prototype-change.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-arraystorage.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-constant-folding.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-have-a-bad-time-getter.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-have-a-bad-time.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-hole-and-other.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-hole-with-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-hole.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-index.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-negative-index.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-non-int32-start-index.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-object-prototype-change.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-original-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-other.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-structure-change-convert.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-structure-change.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof-symbol.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-indexof.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-iterators-next-error-messages.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-iterators-next-with-call.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-iterators-next.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-join-on-strings-need-overflow-checks.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-length-array-storage-plain-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-length-not-writable.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-length-plain-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-map-put-by-val-direct.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-pop-array-storage.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-pop-contiguous.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-pop-double-hole.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-pop-double.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-pop-int32.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-profile-should-record-copy-on-write.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-prototype-concat-of-long-spliced-arrays.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-prototype-concat-of-long-spliced-arrays2.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-prototype-slow-put-having-a-bad-time-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-prototype-slow-put-having-a-bad-time.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-prototype-splice-making-typed-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-array-storage-beyond-int32.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-array-storage.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-contiguous.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-double-then-nan.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-double.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-multiple-array-storage-beyond-int32.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-multiple-contiguous.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-multiple-double-nan.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-multiple-double.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-multiple-int32.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-multiple-many-contiguous.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-multiple-many-double.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-multiple-many-int32.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-multiple-many-storage.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-multiple-storage-continuous.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-multiple-storage.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-nan-to-double-array-cse-sane-and-insane-chain.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push-nan-to-double-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-push.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-reverse-doesnt-clobber.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-reverse-proxy.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-setLength-on-ArrayClass-with-large-length.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-setLength-on-ArrayClass-with-small-length.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-slice-cow.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-slice-intrinsic.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-slice-jettison-on-constructor-change.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-slice-on-frozen-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-slice-osr-exit-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-slice-osr-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-slice-with-zero.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-slice-zero-args.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-sort-bad-comparator.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-species-config-array-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-species-functions.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-storage-array-unshift.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-storage-get-by-val.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-storage-length.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-symbol-species-lazy-watchpoints.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-to-locale-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/array-unshift-zero-property-storage.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrayify-array-storage-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrayify-array-storage-non-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrayify-array-storage-typed-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrayify-array-storage.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrayify-fires-watchpoint.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrayify-int32-typed-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrayify-slow-put-array-storage-pass-array-storage.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrayify-slow-put-array-storage.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrayify-structure-bad-test.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrayify-to-structure-contradiction.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrayify.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrow-function-needs-its-own-structure.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrow-function-token-is-not-keyword.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrow-functions-as-default-parameter-values.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-activation-sink-osrexit-default-value-tdz-error.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-activation-sink-osrexit-default-value.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-activation-sink-osrexit.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-activation-sink.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-bound.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-call.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-arguments-non-strict-1.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-arguments-non-strict-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-arguments-strict.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-newtarget.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-supercall-1.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-supercall-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-supercall-3.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-supercall-4.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-superproperty.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-1.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-3.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-4.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-5.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-6.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-7.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-8.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-activation-sink-osrexit.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-activation-sink.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-sinking-no-double-allocate.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-sinking-osrexit.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-sinking-put.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-name.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-others.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-run-10-1.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-run-10-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-run-10000-1.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-run-10000-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-sinking-no-double-allocate.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-sinking-osrexit.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-sinking-put.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-tdz-1.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-tdz-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-tdz-3.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-tdz-4.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-tostring.js delete mode 100644 implementation-contributed/javascriptcore/stress/arrowfunction-typeof.js delete mode 100644 implementation-contributed/javascriptcore/stress/atomics-add-uint32.js delete mode 100644 implementation-contributed/javascriptcore/stress/atomics-known-int-use.js delete mode 100644 implementation-contributed/javascriptcore/stress/atomics-neg-zero.js delete mode 100644 implementation-contributed/javascriptcore/stress/atomics-store-return.js delete mode 100644 implementation-contributed/javascriptcore/stress/b3-delete-orphans-should-neutralize-upsilons-with-dead-phis.js delete mode 100644 implementation-contributed/javascriptcore/stress/baseline-osrentry-catch-is-reachable.js delete mode 100644 implementation-contributed/javascriptcore/stress/basic-eden-gc-test.js delete mode 100644 implementation-contributed/javascriptcore/stress/basic-weakmap.js delete mode 100644 implementation-contributed/javascriptcore/stress/basic-weakset.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-add-wrapped-value.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-addition-basic.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-addition-jit.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-addition-memory-stress.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-addition-string-coercion.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-addition-to-primitive-precedence.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-addition-to-primitive.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-addition-type-error.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-as-key.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-constructor-gc.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-constructor-oom.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-constructor-properties.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-constructor-prototype-prop-descriptor.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-constructor-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-div-jit.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-div-memory-stress.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-div-to-primitive.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-div-type-error.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-div-wrapped-value.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-division.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-equals-basic.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-equals-to-primitive-precedence.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-equals-wrapped-value.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-function-apply.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-greater-than-general.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-greater-than-jit.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-greater-than-or-equal-jit.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-greater-than-or-equal-order-of-evaluation.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-greater-than-or-equal-wrapped-values.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-greater-than-or-equal.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-greater-than-order-of-evaluation.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-greater-than-wrapped-values.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-length.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-less-than-general.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-less-than-jit.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-less-than-or-equal-general.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-less-than-or-equal-jit.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-less-than-or-equal-order-of-evaluation.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-less-than-or-equal-wrapped-values.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-less-than-order-of-evaluation.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-less-than-wrapped-values.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-literal-line-terminator.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-literals.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-mod-jit.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-mod-memory-stress.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-mod-to-primitive-precedence.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-mod-to-primitive.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-mod-type-error.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-mod-wrapped-value.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-mod.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-mul-jit.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-mul-to-primitive-precedence.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-mul-to-primitive.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-mul-type-error.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-mul-wrapped-value.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-multiplication.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-multiply-memory-stress.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-negate-basic.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-negate-jit.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-no-conversion-to-number.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-operations-error.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-prop-descriptor.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-proto-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-proto-name.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-prototype-properties.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-prototype-proto.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-prototype-symbol-to-string-tag.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-prototype-to-string-apply.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-prototype-to-string-cast-overflow.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-prototype-to-string-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-prototype-to-string-wrong-values.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-prototype-value-of.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-spec-to-primitive.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-spec-to-this.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-strict-equals-jit.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-strict-spec-to-this.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-sub-wrapped-value.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-subtraction-basic.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-subtraction-jit.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-subtraction-type-error.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-to-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-to-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-type-of-proven-type.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-type-of.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-unary-plus.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-int-white-space-trailing-leading.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-match.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-split-captures.js delete mode 100644 implementation-contributed/javascriptcore/stress/big-split.js delete mode 100644 implementation-contributed/javascriptcore/stress/bit-op-value-to-int32-input-liveness.js delete mode 100644 implementation-contributed/javascriptcore/stress/block-scoped-function-declarations.js delete mode 100644 implementation-contributed/javascriptcore/stress/bound-function-does-not-have-caller-and-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/bound-function-lazy-name-generation.js delete mode 100644 implementation-contributed/javascriptcore/stress/bound-function-tail-call-with-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/bound-function-uses-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/bounds-check-not-eliminated-by-licm.js delete mode 100644 implementation-contributed/javascriptcore/stress/branch-check-int32-on-boolean-to-number-untyped.js delete mode 100644 implementation-contributed/javascriptcore/stress/branch-check-number-on-boolean-to-number-untyped.js delete mode 100644 implementation-contributed/javascriptcore/stress/branch-may-exit-due-to-object-or-other-use-kind.js delete mode 100644 implementation-contributed/javascriptcore/stress/broken-have-a-bad-time-with-arguments-for-gc-testing.js delete mode 100644 implementation-contributed/javascriptcore/stress/cached-prototype-setter.js delete mode 100644 implementation-contributed/javascriptcore/stress/call-apply-builtin-functions-dont-use-iterators.js delete mode 100644 implementation-contributed/javascriptcore/stress/call-apply-exponential-bytecode-size.js delete mode 100644 implementation-contributed/javascriptcore/stress/call-forward-varargs-for-inlined-escaped-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/call-non-calleable-constructors-as-function.js delete mode 100644 implementation-contributed/javascriptcore/stress/call-object-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/call-varargs-double-new-array-buffer.js delete mode 100644 implementation-contributed/javascriptcore/stress/call-varargs-from-inlined-code-with-odd-number-of-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/call-varargs-from-inlined-code.js delete mode 100644 implementation-contributed/javascriptcore/stress/call-varargs-length-effects.js delete mode 100644 implementation-contributed/javascriptcore/stress/call-varargs-spread-new-array-buffer.js delete mode 100644 implementation-contributed/javascriptcore/stress/call-varargs-spread-new-array-buffer2.js delete mode 100644 implementation-contributed/javascriptcore/stress/call-varargs-spread.js delete mode 100644 implementation-contributed/javascriptcore/stress/call-varargs-with-different-arguments-length-after-warmup.js delete mode 100644 implementation-contributed/javascriptcore/stress/caller-and-arguments-properties-for-functions-that-dont-have-them.js delete mode 100644 implementation-contributed/javascriptcore/stress/caller-native-code.js delete mode 100644 implementation-contributed/javascriptcore/stress/capture-escape-and-throw.js delete mode 100644 implementation-contributed/javascriptcore/stress/captured-arguments-variable.js delete mode 100644 implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz1.js delete mode 100644 implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz2.js delete mode 100644 implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz3.js delete mode 100644 implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz4.js delete mode 100644 implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz5.js delete mode 100644 implementation-contributed/javascriptcore/stress/catch-parameter-destructuring.js delete mode 100644 implementation-contributed/javascriptcore/stress/catch-parameter-syntax.js delete mode 100644 implementation-contributed/javascriptcore/stress/catch-set-argument-speculation-failure.js delete mode 100644 implementation-contributed/javascriptcore/stress/catch-variables-under-tdz.js delete mode 100644 implementation-contributed/javascriptcore/stress/check-string-ident.js delete mode 100644 implementation-contributed/javascriptcore/stress/check-structure-ir-ensures-empty-does-not-flow-through.js delete mode 100644 implementation-contributed/javascriptcore/stress/chill-mod-chill-mod.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-derived-from-null.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-expression-generates-environment.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-expression-should-be-tdz-in-heritage.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-method-does-not-declare-variable-to-upper-scope.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-static-get-weird.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-subclassing-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-subclassing-function.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-subclassing-misc.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-subclassing-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-subclassing-typedarray.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-block-scoping.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-definition-semantics.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-derived-default-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-double-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-no-loop-tdz.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-catch.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-conditional.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-eval.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-loop-no-inline-super.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-loop.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-no-tdz.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-super-in-eval.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-tdz-in-catch.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-tdz-in-conditional.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-tdz-in-eval.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-tdz-in-loop.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-tdz-osr-entry-in-loop.js delete mode 100644 implementation-contributed/javascriptcore/stress/class-syntax-tdz.js delete mode 100644 implementation-contributed/javascriptcore/stress/class_elements.js delete mode 100644 implementation-contributed/javascriptcore/stress/cloned-arguments-elimination.js delete mode 100644 implementation-contributed/javascriptcore/stress/cloned-arguments-get-by-val-double-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/cloned-arguments-modification.js delete mode 100644 implementation-contributed/javascriptcore/stress/cloned-arguments-should-visit-callee-during-gc.js delete mode 100644 implementation-contributed/javascriptcore/stress/compare-clobber-untypeduse.js delete mode 100644 implementation-contributed/javascriptcore/stress/compare-eq-object-or-other-to-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/compare-eq-object-to-object-or-other.js delete mode 100644 implementation-contributed/javascriptcore/stress/compare-eq-on-null-and-undefined-non-peephole.js delete mode 100644 implementation-contributed/javascriptcore/stress/compare-eq-on-null-and-undefined-optimized-in-constant-folding.js delete mode 100644 implementation-contributed/javascriptcore/stress/compare-eq-on-null-and-undefined.js delete mode 100644 implementation-contributed/javascriptcore/stress/compare-eq-should-use-known-other-use.js delete mode 100644 implementation-contributed/javascriptcore/stress/compare-number-and-other.js delete mode 100644 implementation-contributed/javascriptcore/stress/compare-semantic-origin-op-negate-method-of-getting-a-value-profile.js delete mode 100644 implementation-contributed/javascriptcore/stress/compare-strict-eq-integer-to-misc.js delete mode 100644 implementation-contributed/javascriptcore/stress/compare-strict-eq-on-various-types.js delete mode 100644 implementation-contributed/javascriptcore/stress/constant-closure-var-with-dynamic-invalidation.js delete mode 100644 implementation-contributed/javascriptcore/stress/constant-fold-multi-get-by-offset-to-get-by-offset-on-prototype-and-sink-allocation.js delete mode 100644 implementation-contributed/javascriptcore/stress/constant-folding-osr-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/constant-folding-phase-insert-check-handle-varargs.js delete mode 100644 implementation-contributed/javascriptcore/stress/constant-folding-should-fold-make-rope-with-empty-strings.js delete mode 100644 implementation-contributed/javascriptcore/stress/construct-forward-varargs-for-inlined-escaped-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/construct-overwritten-variable.js delete mode 100644 implementation-contributed/javascriptcore/stress/construct-spread-overwritten-variable-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/construct-spread-overwritten-variable.js delete mode 100644 implementation-contributed/javascriptcore/stress/construct-varargs-inline-smaller-Foo.js delete mode 100644 implementation-contributed/javascriptcore/stress/construct-varargs-inline.js delete mode 100644 implementation-contributed/javascriptcore/stress/construct-varargs-no-inline.js delete mode 100644 implementation-contributed/javascriptcore/stress/constructor-with-return.js delete mode 100644 implementation-contributed/javascriptcore/stress/contiguous-array-unshift.js delete mode 100644 implementation-contributed/javascriptcore/stress/date-negative-zero.js delete mode 100644 implementation-contributed/javascriptcore/stress/date-parse-ranges.js delete mode 100644 implementation-contributed/javascriptcore/stress/date-relaxed.js delete mode 100644 implementation-contributed/javascriptcore/stress/date-symbol-toprimitive.js delete mode 100644 implementation-contributed/javascriptcore/stress/dead-access-to-captured-variable-preceded-by-a-live-store-in-function-with-multiple-basic-blocks.js delete mode 100644 implementation-contributed/javascriptcore/stress/dead-access-to-captured-variable-preceded-by-a-live-store.js delete mode 100644 implementation-contributed/javascriptcore/stress/dead-fiat-double-to-int52-then-exit-not-int52.js delete mode 100644 implementation-contributed/javascriptcore/stress/dead-fiat-double-to-int52.js delete mode 100644 implementation-contributed/javascriptcore/stress/dead-fiat-int32-to-int52.js delete mode 100644 implementation-contributed/javascriptcore/stress/dead-fiat-value-to-int52-double-path.js delete mode 100644 implementation-contributed/javascriptcore/stress/dead-get-closure-var.js delete mode 100644 implementation-contributed/javascriptcore/stress/dead-int32-to-double.js delete mode 100644 implementation-contributed/javascriptcore/stress/dead-speculating-argument-use.js delete mode 100644 implementation-contributed/javascriptcore/stress/dead-uint32-to-number.js delete mode 100644 implementation-contributed/javascriptcore/stress/dead-value-with-mov-hint-in-another-block.js delete mode 100644 implementation-contributed/javascriptcore/stress/deep-StructureStubClearingWatchpoint-destructor-recursion.js delete mode 100644 implementation-contributed/javascriptcore/stress/deeply-nested-finallys.js delete mode 100644 implementation-contributed/javascriptcore/stress/default-proto-for-async-generator.js delete mode 100644 implementation-contributed/javascriptcore/stress/default-proto-for-generator.js delete mode 100644 implementation-contributed/javascriptcore/stress/default-value-parsing-should-propagate-error.js delete mode 100644 implementation-contributed/javascriptcore/stress/delete-by-id.js delete mode 100644 implementation-contributed/javascriptcore/stress/delete-by-val-ftl.js delete mode 100644 implementation-contributed/javascriptcore/stress/delete-by-val.js delete mode 100644 implementation-contributed/javascriptcore/stress/delete-to-object-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/destructuring-assignment-accepts-iterables.js delete mode 100644 implementation-contributed/javascriptcore/stress/destructuring-assignment-require-object-coercible.js delete mode 100644 implementation-contributed/javascriptcore/stress/destructuring-assignment-syntax.js delete mode 100644 implementation-contributed/javascriptcore/stress/destructuring-rest-element.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-call-class-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-create-arguments-inline-alloc.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-del-by-id.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-exception-try-catch-in-constructor-with-inlined-throw.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-get-by-id-should-not-assert-non-null-prediction.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-internal-function-call.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-internal-function-construct.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-node-convert-to-constant-must-clear-varargs-flags.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-object-proto-accessor.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-object-proto-getter.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-object-prototype-of.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-put-accessors-by-id-class.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-put-accessors-by-id.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-put-by-val-direct-with-edge-numbers.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-put-getter-by-id-class.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-put-getter-by-id.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-put-getter-by-val-class.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-put-getter-by-val.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-put-setter-by-id-class.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-put-setter-by-id.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-put-setter-by-val-class.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-put-setter-by-val.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-rare-data.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-reflect-get-prototype-of.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-ssa-swap.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-tail-calls.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-to-primitive-pass-symbol.js delete mode 100644 implementation-contributed/javascriptcore/stress/dfg-try-catch-wrong-value-recovery-on-ic-miss.js delete mode 100644 implementation-contributed/javascriptcore/stress/direct-arguments-check-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/direct-arguments-in-bounds-to-out-of-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/direct-arguments-osr-entry.js delete mode 100644 implementation-contributed/javascriptcore/stress/direct-arguments-out-of-bounds-change-structure.js delete mode 100644 implementation-contributed/javascriptcore/stress/direct-arguments-out-of-bounds-watchpoint.js delete mode 100644 implementation-contributed/javascriptcore/stress/direct-arguments-override-length-then-access-normal-length.js delete mode 100644 implementation-contributed/javascriptcore/stress/direct-binding-return-result.js delete mode 100644 implementation-contributed/javascriptcore/stress/direct-eval-in-object-literal-methods.js delete mode 100644 implementation-contributed/javascriptcore/stress/direct-tail-call-arity-mismatch-count-args.js delete mode 100644 implementation-contributed/javascriptcore/stress/disable-caching-when-lazy-materializing-error-property-on-put.js delete mode 100644 implementation-contributed/javascriptcore/stress/disable-function-dot-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/disable-gigacage-arrays.js delete mode 100644 implementation-contributed/javascriptcore/stress/disable-gigacage-strings.js delete mode 100644 implementation-contributed/javascriptcore/stress/disable-gigacage-typed-arrays.js delete mode 100644 implementation-contributed/javascriptcore/stress/dont-constant-fold-check-type-info-on-bound-function.js delete mode 100644 implementation-contributed/javascriptcore/stress/dont-crash-ftl-osr-entry.js delete mode 100644 implementation-contributed/javascriptcore/stress/dont-crash-in-cfg-simplification.js delete mode 100644 implementation-contributed/javascriptcore/stress/dont-crash-on-bad-invalidation-point.js delete mode 100644 implementation-contributed/javascriptcore/stress/dont-crash-on-stack-overflow-when-parsing-builtin.js delete mode 100644 implementation-contributed/javascriptcore/stress/dont-crash-on-stack-overflow-when-parsing-default-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/dont-crash-when-hoist-check-structure-on-tdz.js delete mode 100644 implementation-contributed/javascriptcore/stress/dont-dead-lock-put-by-val-as-put-by-id.js delete mode 100644 implementation-contributed/javascriptcore/stress/dont-reserve-huge-capacity-lexer.js delete mode 100644 implementation-contributed/javascriptcore/stress/dont-run-cleanup-after-licm.js delete mode 100644 implementation-contributed/javascriptcore/stress/dont-strength-reduce-valuerep-of-doublerep.js delete mode 100644 implementation-contributed/javascriptcore/stress/dont-unwind-past-vm-entry-frame.js delete mode 100644 implementation-contributed/javascriptcore/stress/dont-validate-stack-offset-in-b3-because-it-might-be-guarded-by-control-flow.js delete mode 100644 implementation-contributed/javascriptcore/stress/double-array-to-array-storage.js delete mode 100644 implementation-contributed/javascriptcore/stress/double-array-unshift.js delete mode 100644 implementation-contributed/javascriptcore/stress/double-as-int32.js delete mode 100644 implementation-contributed/javascriptcore/stress/double-compare-to-float.js delete mode 100644 implementation-contributed/javascriptcore/stress/double-rep-real-number-use-on-nan.js delete mode 100644 implementation-contributed/javascriptcore/stress/double-rep-with-non-cell.js delete mode 100644 implementation-contributed/javascriptcore/stress/double-rep-with-null.js delete mode 100644 implementation-contributed/javascriptcore/stress/double-rep-with-undefined.js delete mode 100644 implementation-contributed/javascriptcore/stress/double-to-float.js delete mode 100644 implementation-contributed/javascriptcore/stress/double-to-string-in-loop-removed.js delete mode 100644 implementation-contributed/javascriptcore/stress/duplicate-computed-accessors.js delete mode 100644 implementation-contributed/javascriptcore/stress/each-block-at-top-of-polymorphic-call-inlining-should-be-exitOK.js delete mode 100644 implementation-contributed/javascriptcore/stress/eden-gc-with-retired-blocks.js delete mode 100644 implementation-contributed/javascriptcore/stress/element-property-get-should-not-handled-with-get-by-id.js delete mode 100644 implementation-contributed/javascriptcore/stress/elidable-new-object-roflcopter-then-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/elide-new-object-dag-then-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/empty_eos_regex_split.js delete mode 100644 implementation-contributed/javascriptcore/stress/float32-array-nan-inlined.js delete mode 100644 implementation-contributed/javascriptcore/stress/float32-array-nan.js delete mode 100644 implementation-contributed/javascriptcore/stress/float32-array-out-of-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/float32-repeat-out-of-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/float32array-out-of-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/float64-array-nan-inlined.js delete mode 100644 implementation-contributed/javascriptcore/stress/float64-array-nan.js delete mode 100644 implementation-contributed/javascriptcore/stress/floating-point-div-to-mul.js delete mode 100644 implementation-contributed/javascriptcore/stress/flush-after-force-exit-in-bytecodeparser-needs-to-update-argument-positions.js delete mode 100644 implementation-contributed/javascriptcore/stress/fold-based-on-int32-proof-mul.js delete mode 100644 implementation-contributed/javascriptcore/stress/fold-based-on-int32-proof-or-zero.js delete mode 100644 implementation-contributed/javascriptcore/stress/fold-based-on-int32-proof.js delete mode 100644 implementation-contributed/javascriptcore/stress/fold-load-varargs-arity-check-fail-barely.js delete mode 100644 implementation-contributed/javascriptcore/stress/fold-load-varargs-arity-check-fail.js delete mode 100644 implementation-contributed/javascriptcore/stress/fold-multi-get-by-offset-to-get-by-offset-with-watchpoint.js delete mode 100644 implementation-contributed/javascriptcore/stress/fold-multi-get-by-offset-to-get-by-offset-without-folding-the-structure-check-new.js delete mode 100644 implementation-contributed/javascriptcore/stress/fold-multi-get-by-offset-to-get-by-offset-without-folding-the-structure-check.js delete mode 100644 implementation-contributed/javascriptcore/stress/fold-multi-get-by-offset-to-get-by-offset.js delete mode 100644 implementation-contributed/javascriptcore/stress/fold-multi-put-by-offset-to-put-by-offset-without-folding-the-structure-check.js delete mode 100644 implementation-contributed/javascriptcore/stress/fold-multi-put-by-offset-to-put-by-offset.js delete mode 100644 implementation-contributed/javascriptcore/stress/fold-typed-array-properties.js delete mode 100644 implementation-contributed/javascriptcore/stress/folding-get-by-val-with-immutable-butterfly-out-of-bounds-foldable.js delete mode 100644 implementation-contributed/javascriptcore/stress/folding-get-by-val-with-immutable-butterfly-out-of-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/folding-get-by-val-with-immutable-butterfly-with-types.js delete mode 100644 implementation-contributed/javascriptcore/stress/folding-get-by-val-with-immutable-butterfly.js delete mode 100644 implementation-contributed/javascriptcore/stress/folding-get-by-val-with-read-only-dont-delete-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/folding-get-by-val-with-read-only-dont-delete-runtime-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/folding-get-by-val-with-read-only-dont-delete.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-array-mode.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-base-reassigned-later-and-change-structure.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-base-reassigned-later.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-base-reassigned.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-capture-string-loop-var.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-delete-during-iteration.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-invalidate-context-weird-assignments.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-invalidation-for-any-write.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-modify-int-loop-var.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-modify-string-loop-var.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-of-const.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-postfix-ignored-index.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-postfix-index.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-prefix-index.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-prototype-with-indexed-properties-should-prevent-caching.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-shadow-prototype-property.js delete mode 100755 implementation-contributed/javascriptcore/stress/for-in-side-effects.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-tests.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-in-typed-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/for-let-comma.js delete mode 100644 implementation-contributed/javascriptcore/stress/force-exit-then-eval-dfg.js delete mode 100644 implementation-contributed/javascriptcore/stress/force-exit-then-eval.js delete mode 100644 implementation-contributed/javascriptcore/stress/forward-varargs-double-new-array-buffer.js delete mode 100644 implementation-contributed/javascriptcore/stress/forward-varargs-for-inlined-escaped-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/freeze-and-seal-should-prevent-extensions.js delete mode 100644 implementation-contributed/javascriptcore/stress/freeze-setter.js delete mode 100644 implementation-contributed/javascriptcore/stress/freeze_leek.js delete mode 100644 implementation-contributed/javascriptcore/stress/fromCharCode-exception-check.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-arithcos.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-arithsin.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-arithsqrt.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-arithtan.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-bit-xor-right-result-interference.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-call-bad-callee-exception-interesting-live-state.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-call-exception-interesting-live-state.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-call-exception-no-catch.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-call-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-call-varargs-bad-args-exception-interesting-live-state.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-call-varargs-bad-callee-exception-interesting-live-state.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-call-varargs-exception-interesting-live-state.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-call-varargs-exception-no-catch.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-call-varargs-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-checkin-variable.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-checkin.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-force-osr-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-function-dot-arguments-with-callee-saves.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-get-by-id-getter-exception-interesting-live-state.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-get-by-id-getter-exception-no-catch.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-get-by-id-getter-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-get-by-id-slow-exception-interesting-live-state.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-get-by-id-slow-exception-no-catch.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-get-by-id-slow-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-get-my-argument-by-val-inlined-and-not-inlined.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-get-my-argument-by-val-inlined.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-get-my-argument-by-val.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-getmyargumentslength-inline.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-getmyargumentslength.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-gettypedarrayoffset-simple.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-gettypedarrayoffset-wasteful.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-has-a-bad-time.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-in-overflow.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-library-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-library-inline-gettimezoneoffset.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-library-inlining-exceptions-dataview.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-library-inlining-exceptions.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-library-inlining-loops.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-library-inlining-random.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-library-substring.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-negate-zero.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-new-negative-array-size.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-operation-exception-interesting-live-state.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-operation-exception-no-catch.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-operation-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-put-by-id-setter-exception-interesting-live-state.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-put-by-id-setter-exception-no-catch.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-put-by-id-setter-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-put-by-id-slow-exception-interesting-live-state.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-put-by-id-slow-exception-no-catch.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-put-by-id-slow-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-putbyid.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-putbyiddirect.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-reallocatepropertystorage.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-regexp-exec.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-regexp-test.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-shr-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-string-equality.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-string-ident-equality.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-string-strict-equality.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-sub-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-switch-string-slow-duplicate-cases.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-tail-call-throw-exception-from-slow-path-recover-stack-values.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-tail-call.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-to-ftl-arity-fixup.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-try-catch-arith-sub-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-try-catch-getter-ic-fail-to-call-operation-throw-error.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-try-catch-getter-throw-interesting-value-recovery.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-try-catch-getter-throw.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-try-catch-oom-error-lazy-slow-path.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-try-catch-patchpoint-with-volatile-registers.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-try-catch-setter-throw.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-try-catch-tail-call-inilned-caller.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-try-catch-varargs-call-throws.js delete mode 100644 implementation-contributed/javascriptcore/stress/ftl-xor-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-and-super.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-arguments-from-function.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-class-methods-syntax.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-class-methods.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-eval-this.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-fib-ftl-and-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-fib-ftl-and-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-fib-ftl-and-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-fib-ftl.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-frame-empty.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-function-constructor-is-subclassible.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-function-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-function-create-optimized.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-function-declaration-sinking-no-double-allocate.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-function-declaration-sinking-osrexit.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-function-declaration-sinking-put.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-function-expression-sinking-no-double-allocate.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-function-expression-sinking-osrexit.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-function-expression-sinking-put.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-function-name.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-is-not-constructible.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-methods-with-non-generator.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-methods.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-prototype-copy.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-reduced-save-point-put-to-scope.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-relations.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-return-before-first-call.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-return.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-syntax.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-this.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-throw-before-first-call.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-throw.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-transfer-register-beyond-mutiple-yields.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-type-check.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-with-new-target.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-with-super.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-with-this-strict.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-with-this.js delete mode 100644 implementation-contributed/javascriptcore/stress/generator-yield-star.js delete mode 100644 implementation-contributed/javascriptcore/stress/generic-arguments-correct-delete-behavior.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-argument-by-val-in-inlined-varargs-call-out-of-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-argument-by-val-safe-in-inlined-varargs-call-out-of-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-array-length-on-undecided.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-array-length-phantom-new-array-buffer.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-array-length-undecided.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-id-strict-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-id-strict-callee.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-id-strict-caller.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-id-strict-nested-arguments-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-id-strict-nested-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-id-throw-from-getter-through-optimized-code.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-id-throw-from-unexpected-getter-through-optimized-code-that-does-not-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-id-throw-from-unexpected-getter-through-optimized-code.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-id-untyped.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-offset-double.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-pname-only-prototype-properties.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-double-predicted-int.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-fold-did-clobber-world.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-array-type.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-out-of-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-1.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-3.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-4.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-5.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-6.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-trivial.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-out-of-bounds-basics.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-to-id-with-getter.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-with-string-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-with-string-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-with-string-generated.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-with-string-getter.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-with-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-with-symbol-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-with-symbol-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-with-symbol-getter.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-by-val-with-symbol.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-declared-unpassed-argument-in-direct-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-declared-unpassed-argument-in-scoped-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-from-scope-dynamic-onto-proxy.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-local-elimination.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-my-argument-by-val-constant-folding.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-my-argument-by-val-creates-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-my-argument-by-val-for-inlined-escaped-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-my-argument-by-val-inlined-no-formal-parameters.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-my-argument-by-val-out-of-bounds-no-warm-up.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-my-argument-by-val-out-of-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-my-argument-by-val-safe-out-of-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-my-argument-by-val-safe-wrap-around.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-my-argument-by-val-wrap-around-no-warm-up.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-my-argument-by-val-wrap-around.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-prototype-create-this-effectful.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-stack-identity-due-to-sinking.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-stack-mapping-with-dead-get-stack.js delete mode 100644 implementation-contributed/javascriptcore/stress/get-stack-mapping.js delete mode 100644 implementation-contributed/javascriptcore/stress/instance-of-on-poly-proto-opc-should-not-crash.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof-custom-hasinstancesymbol.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof-dynamic-proxy-check-structure.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof-dynamic-proxy-loop.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof-dynamic-proxy.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof-hit-one-object-then-another.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof-hit-two-objects-then-another.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof-late-constant-folding.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof-non-object-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof-not-cell.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof-prototype-change-to-hit.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof-prototype-change-to-null.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof-prototype-change-watchpointable.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof-prototype-change.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof-proxy-check-structure.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof-proxy-loop.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof-proxy.js delete mode 100644 implementation-contributed/javascriptcore/stress/instanceof.js delete mode 100644 implementation-contributed/javascriptcore/stress/int16-put-by-val-in-and-out-of-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/int16-put-by-val-in-bounds-then-exit-out-of-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/int16-put-by-val-out-of-bounds-bounds-then-do-in-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/int32-array-unshift.js delete mode 100644 implementation-contributed/javascriptcore/stress/int32-min-to-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/int32-object-out-of-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/int32-out-of-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/int32-to-string-in-loop-removed.js delete mode 100644 implementation-contributed/javascriptcore/stress/int32array-transition-on-nan.js delete mode 100644 implementation-contributed/javascriptcore/stress/int52-ai-mul-then-filter-int32-directly.js delete mode 100644 implementation-contributed/javascriptcore/stress/int52-argument.js delete mode 100644 implementation-contributed/javascriptcore/stress/int52-force-osr-exit-path.js delete mode 100644 implementation-contributed/javascriptcore/stress/int52-inlined-call-argument.js delete mode 100644 implementation-contributed/javascriptcore/stress/int52-to-string-in-loop-removed.js delete mode 100644 implementation-contributed/javascriptcore/stress/int52-variable.js delete mode 100644 implementation-contributed/javascriptcore/stress/int8-repeat-out-of-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/integer-range-optimization-constant-representation-1.js delete mode 100644 implementation-contributed/javascriptcore/stress/integer-range-optimization-constant-representation-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/internal-function-call.js delete mode 100644 implementation-contributed/javascriptcore/stress/internal-function-construct.js delete mode 100644 implementation-contributed/javascriptcore/stress/intl-constructors-with-proxy.js delete mode 100644 implementation-contributed/javascriptcore/stress/intrinsic-getter-with-poly-proto-getter-change.js delete mode 100644 implementation-contributed/javascriptcore/stress/intrinsic-getter-with-poly-proto-proto-change.js delete mode 100644 implementation-contributed/javascriptcore/stress/intrinsic-getter-with-poly-proto.js delete mode 100644 implementation-contributed/javascriptcore/stress/invalidation-point.js delete mode 100644 implementation-contributed/javascriptcore/stress/inverted-additive-subsumption.js delete mode 100644 implementation-contributed/javascriptcore/stress/is-undefined-exit-on-masquerader.js delete mode 100644 implementation-contributed/javascriptcore/stress/is-undefined-jettison-on-masquerader.js delete mode 100644 implementation-contributed/javascriptcore/stress/is-undefined-masquerader.js delete mode 100644 implementation-contributed/javascriptcore/stress/isInteger-doesnt-overwrite-argument.js delete mode 100644 implementation-contributed/javascriptcore/stress/isLockFree.js delete mode 100644 implementation-contributed/javascriptcore/stress/iterator-field-order.js delete mode 100644 implementation-contributed/javascriptcore/stress/iterator-functions.js delete mode 100644 implementation-contributed/javascriptcore/stress/iterator-names.js delete mode 100644 implementation-contributed/javascriptcore/stress/iterator-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/iterator-return-beyond-multiple-iteration-scopes.js delete mode 100644 implementation-contributed/javascriptcore/stress/iterators-shape.js delete mode 100644 implementation-contributed/javascriptcore/stress/jit-cache-poly-replace-then-cache-get-and-fold-then-invalidate.js delete mode 100644 implementation-contributed/javascriptcore/stress/jit-cache-replace-then-cache-get-and-fold-then-invalidate.js delete mode 100644 implementation-contributed/javascriptcore/stress/jit-gracefully-handle-double-constants-in-math-operators.js delete mode 100644 implementation-contributed/javascriptcore/stress/jit-put-to-scope-global-cache-watchpoint-invalidate.js delete mode 100644 implementation-contributed/javascriptcore/stress/joined-strings-should-not-exceed-max-string-length.js delete mode 100644 implementation-contributed/javascriptcore/stress/js-fixed-array-out-of-memory.js delete mode 100644 implementation-contributed/javascriptcore/stress/jsc-read.js delete mode 100644 implementation-contributed/javascriptcore/stress/json-parse-on-frozen-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/large-unshift-splice.js delete mode 100644 implementation-contributed/javascriptcore/stress/lars-sab-workers.js delete mode 100644 implementation-contributed/javascriptcore/stress/length-of-new-array-with-spread.js delete mode 100644 implementation-contributed/javascriptcore/stress/lexical-let-and-with-statement.js delete mode 100644 implementation-contributed/javascriptcore/stress/lexical-let-exception-handling.js delete mode 100644 implementation-contributed/javascriptcore/stress/lexical-let-global-not-captured-variables.js delete mode 100644 implementation-contributed/javascriptcore/stress/lexical-let-loop-semantics.js delete mode 100644 implementation-contributed/javascriptcore/stress/lexical-let-not-strict-mode.js delete mode 100644 implementation-contributed/javascriptcore/stress/lexical-let-semantics.js delete mode 100644 implementation-contributed/javascriptcore/stress/lexical-let-tdz.js delete mode 100644 implementation-contributed/javascriptcore/stress/lexical-scoping-break-continue.js delete mode 100644 implementation-contributed/javascriptcore/stress/lexical-scoping-for-loop.js delete mode 100644 implementation-contributed/javascriptcore/stress/licm-no-pre-header-nested.js delete mode 100644 implementation-contributed/javascriptcore/stress/licm-no-pre-header.js delete mode 100644 implementation-contributed/javascriptcore/stress/lift-tdz-bypass-catch.js delete mode 100644 implementation-contributed/javascriptcore/stress/lift-template-literal.js delete mode 100644 implementation-contributed/javascriptcore/stress/liveness-pruning-needed-for-osr-availability-eager.js delete mode 100644 implementation-contributed/javascriptcore/stress/liveness-pruning-needed-for-osr-availability.js delete mode 100644 implementation-contributed/javascriptcore/stress/llint-cache-replace-then-cache-get-and-fold-then-invalidate.js delete mode 100644 implementation-contributed/javascriptcore/stress/llint-get-by-id-cache-prototype-load-from-dictionary.js delete mode 100644 implementation-contributed/javascriptcore/stress/llint-proto-get-by-id-cache-change-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/llint-proto-get-by-id-cache-intercept-value.js delete mode 100644 implementation-contributed/javascriptcore/stress/llint-put-to-scope-global-cache-watchpoint-invalidate.js delete mode 100644 implementation-contributed/javascriptcore/stress/llint-stack-overflow-debugging-opcodes.js delete mode 100644 implementation-contributed/javascriptcore/stress/llint-stack-overflow-location.js delete mode 100644 implementation-contributed/javascriptcore/stress/load-hole-from-scope-into-live-var.js delete mode 100644 implementation-contributed/javascriptcore/stress/load-varargs-elimination-bounds-check-barely.js delete mode 100644 implementation-contributed/javascriptcore/stress/load-varargs-elimination-bounds-check.js delete mode 100644 implementation-contributed/javascriptcore/stress/load-varargs-on-new-array-with-spread-convert-to-static-loads.js delete mode 100644 implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call-and-exit-strict.js delete mode 100644 implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call-and-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call-exit-in-foo.js delete mode 100644 implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call-inlined.js delete mode 100644 implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call.js delete mode 100644 implementation-contributed/javascriptcore/stress/logical-not-masquerades-as-undefined.js delete mode 100644 implementation-contributed/javascriptcore/stress/logical-not-masquerades.js delete mode 100644 implementation-contributed/javascriptcore/stress/logical-not.js delete mode 100644 implementation-contributed/javascriptcore/stress/make-dictionary-repatch.js delete mode 100644 implementation-contributed/javascriptcore/stress/make-large-string-jit-strcat.js delete mode 100644 implementation-contributed/javascriptcore/stress/make-large-string-jit.js delete mode 100644 implementation-contributed/javascriptcore/stress/make-large-string-strcat.js delete mode 100644 implementation-contributed/javascriptcore/stress/make-large-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/make-rope-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/make-rope-3.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-clone-instance-iterator-change.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-clone-iterator-change.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-clone-next-change.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-clone.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-constructor-adder.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-cse-correctness.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-delete.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-inherit-set.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-iteration.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-iterator-result-should-have-expected-shape.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-iterators-next.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-rehash-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-rehash.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-set-change-get.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-set-check-failure.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-set-clobber-map-get.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-set-create-bucket.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-set-does-not-clobber-set-has.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-set-does-not-clobber-weak-map-get.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-untyped-normalize-cse.js delete mode 100644 implementation-contributed/javascriptcore/stress/map-untyped-normalize.js delete mode 100644 implementation-contributed/javascriptcore/stress/marked-argument-buffer.js delete mode 100644 implementation-contributed/javascriptcore/stress/materialize-activation-referenced-from-phantom-function.js delete mode 100644 implementation-contributed/javascriptcore/stress/materialize-object-referenced-from-phantom-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/materialize-past-butterfly-allocation.js delete mode 100644 implementation-contributed/javascriptcore/stress/materialize-past-put-structure.js delete mode 100644 implementation-contributed/javascriptcore/stress/materialize-regexp-at-osr-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/materialize-regexp-cyclic-regexp-at-osr-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/materialize-regexp-cyclic-regexp.js delete mode 100644 implementation-contributed/javascriptcore/stress/materialize-regexp-cyclic.js delete mode 100644 implementation-contributed/javascriptcore/stress/materialize-regexp-referenced-from-phantom-regexp-cyclic.js delete mode 100644 implementation-contributed/javascriptcore/stress/materialize-regexp-referenced-from-phantom-regexp.js delete mode 100644 implementation-contributed/javascriptcore/stress/materialize-regexp.js delete mode 100644 implementation-contributed/javascriptcore/stress/materialized-regexp-has-correct-last-index-set-by-match-at-osr-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/materialized-regexp-has-correct-last-index-set-by-match.js delete mode 100644 implementation-contributed/javascriptcore/stress/multiply-typed-double-and-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/mutual-tail-call-no-stack-overflow.js delete mode 100644 implementation-contributed/javascriptcore/stress/nan-equal-untyped.js delete mode 100644 implementation-contributed/javascriptcore/stress/nan-equal.js delete mode 100644 implementation-contributed/javascriptcore/stress/native-constructors-length.js delete mode 100644 implementation-contributed/javascriptcore/stress/native-error-properties.js delete mode 100644 implementation-contributed/javascriptcore/stress/need-bytecode-liveness-for-unreachable-blocks-at-dfg-time.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-array-buffer-sinking-osrexit.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-array-dead.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-array-having-a-bad-time-double.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-array-storage-array-with-size.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-array-then-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-array-with-size-div.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-array-with-size-throw-exception-and-tear-off-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-array-with-size-with-bad-time.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-array-with-spread-double-new-array-buffer.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-array-with-spread-with-normal-spread-and-phantom-spread.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-array-with-spread-with-phantom-new-array-buffer.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-contiguous-array-with-size.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-double-array-with-size.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-function-expression-has-structures.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-int32-array-with-size.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-largeish-contiguous-array-with-size.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-promise-capabilities-requires-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-regex-inline.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-string-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-target-syntax-errors.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-target.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-typed-array-cse-effects.js delete mode 100644 implementation-contributed/javascriptcore/stress/new-undecided-array-with-size.js delete mode 100644 implementation-contributed/javascriptcore/stress/no-abc-skippy-loop.js delete mode 100644 implementation-contributed/javascriptcore/stress/no-abc-skippy-paired-loop.js delete mode 100644 implementation-contributed/javascriptcore/stress/non-constructors.js delete mode 100644 implementation-contributed/javascriptcore/stress/normalize-map-key-constant-folding.js delete mode 100644 implementation-contributed/javascriptcore/stress/not-cell-use.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-is-finite.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-is-integer-intrinsic.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-is-nan.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-prototype-to-string-cast-overflow.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-prototype-to-string-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-prototype-to-string-wrong-values.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-to-locale-string-should-accept-strange-number-objects.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-to-string-abstract-operation.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-to-string-radix.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-to-string-strength-reduction.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-to-string-with-add.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-to-string-with-radix-10.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-to-string-with-radix-cse.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-to-string-with-radix-invalid.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-to-string-with-radix-watchpoint.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-to-string-with-radix.js delete mode 100644 implementation-contributed/javascriptcore/stress/number-to-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/numeric-setter-on-prototype-non-blank-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/numeric-setter-on-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/numeric-setter-on-self.js delete mode 100644 implementation-contributed/javascriptcore/stress/obj-rest-destructuring-order.js delete mode 100644 implementation-contributed/javascriptcore/stress/obj-spread-order.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-add.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-allocation-sinking-with-uninitialized-property-on-one-path.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-assign-changing-properties.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-assign-correctness.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-assign-enumerable.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-assign-order.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-assign-proxy.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-assign-string-first.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-assign-symbols.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-assign.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-bit-and.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-bit-or.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-bit-xor.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-constructor-boolean-edge.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-constructor-global.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-constructor-null-edge.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-constructor-number-edge.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-constructor-object-edge.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-constructor-should-be-new-target-aware.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-constructor-string-edge.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-constructor-symbol-edge.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-constructor-undefined-edge.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-create-define.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-create-null-external.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-create-null.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-create-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-create-undefined.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-div.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-entries.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-escapes-in-loop.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-freeze-accept-non-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-freeze-with-proxy-preventExtensions.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-get-own-property-descriptor-perform-to-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-get-own-property-names-perform-to-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-get-own-property-symbols-perform-to-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-get-own-property-symbols.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-get-prototype-of-filtered.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-get-prototype-of-mono-proto.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-get-prototype-of-perform-to-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-get-prototype-of-poly-mono-proto.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-get-prototype-of-poly-proto.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-is-extensible-accept-non-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-is-frozen-accept-non-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-is-sealed-accept-non-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-is.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-iterate-symbols.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-iterate.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-keys-perform-to-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-literal-methods.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-lshift.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-mul.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-number-properties.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-own-property-keys.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-prevent-extensions-accept-non-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-proto-getter-filtered.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-proto-getter-poly-mono-proto.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-proto-getter-poly-proto.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-prototype-proto-accessors-should-throw-on-undefined-this.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-rest-deconstruct.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-rshift.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-seal-accept-non-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-seal-with-proxy-preventExtensions.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-spread.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-sub.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-urshift.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-values-changing-properties.js delete mode 100644 implementation-contributed/javascriptcore/stress/object-values.js delete mode 100644 implementation-contributed/javascriptcore/stress/obscure-error-message-dont-crash.js delete mode 100644 implementation-contributed/javascriptcore/stress/obviously-elidable-new-object-then-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/op-add-exceptions.js delete mode 100644 implementation-contributed/javascriptcore/stress/op-negate-inline-cache.js delete mode 100644 implementation-contributed/javascriptcore/stress/op-push-name-scope-crashes-profiler.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_add.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_bitand.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_bitor.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_bitxor.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_div-ConstVar.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_div-VarConst.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_div-VarVar.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_lshift-ConstVar.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_lshift-VarConst.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_lshift-VarVar.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_mod-ConstVar.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_mod-VarConst.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_mod-VarVar.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_mul-ConstVar.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_mul-VarConst.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_mul-VarVar.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_negate.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_postdec.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_postinc.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_predec.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_preinc.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_rshift-ConstVar.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_rshift-VarConst.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_rshift-VarVar.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_sub-ConstVar.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_sub-VarConst.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_sub-VarVar.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_urshift-ConstVar.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_urshift-VarConst.js delete mode 100644 implementation-contributed/javascriptcore/stress/op_urshift-VarVar.js delete mode 100644 implementation-contributed/javascriptcore/stress/operation-get-by-val-default-should-not-called-for-already-optimized-site.js delete mode 100644 implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-array-storage.js delete mode 100644 implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-contiguous-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-double-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-generic-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-int32-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32.js delete mode 100644 implementation-contributed/javascriptcore/stress/operation-in-negative-int32-cast.js delete mode 100644 implementation-contributed/javascriptcore/stress/operation-in-throw-error.js delete mode 100644 implementation-contributed/javascriptcore/stress/optional-catch-binding-syntax.js delete mode 100644 implementation-contributed/javascriptcore/stress/optional-catch-binding.js delete mode 100644 implementation-contributed/javascriptcore/stress/ordinary-set-exceptions.js delete mode 100644 implementation-contributed/javascriptcore/stress/osr-enter-to-catch-with-set-local-type-check-failure.js delete mode 100644 implementation-contributed/javascriptcore/stress/osr-exit-on-op-negate-should-no-fail-assertions.js delete mode 100644 implementation-contributed/javascriptcore/stress/other-is-object-or-null.js delete mode 100644 implementation-contributed/javascriptcore/stress/override-map-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/pad-start-calls-repeat-character-with-double.js delete mode 100644 implementation-contributed/javascriptcore/stress/parameter-scoping.js delete mode 100644 implementation-contributed/javascriptcore/stress/parse-int-intrinsic-dfg-backend-flush.js delete mode 100644 implementation-contributed/javascriptcore/stress/parse-int-intrinsic.js delete mode 100644 implementation-contributed/javascriptcore/stress/parse-regexp-as-token.js delete mode 100644 implementation-contributed/javascriptcore/stress/path-sensitive-known-cell-crash.js delete mode 100644 implementation-contributed/javascriptcore/stress/pathname-resolve.js delete mode 100644 implementation-contributed/javascriptcore/stress/phantom-arguments-set-local-then-exit-in-same-block.js delete mode 100644 implementation-contributed/javascriptcore/stress/phantom-direct-arguments-clobber-argument-count.js delete mode 100644 implementation-contributed/javascriptcore/stress/phantom-direct-arguments-clobber-callee.js delete mode 100644 implementation-contributed/javascriptcore/stress/phantom-inadequacy.js delete mode 100644 implementation-contributed/javascriptcore/stress/phantom-local-captured-but-not-flushed-to-ssa.js delete mode 100644 implementation-contributed/javascriptcore/stress/phantom-new-array-buffer-forward-varargs.js delete mode 100644 implementation-contributed/javascriptcore/stress/phantom-new-array-buffer-forward-varargs2.js delete mode 100644 implementation-contributed/javascriptcore/stress/phantom-new-array-buffer-osr-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/phantom-new-array-with-spread-osr-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/phantom-regexp-regexp-exec.js delete mode 100644 implementation-contributed/javascriptcore/stress/phantom-regexp-string-match.js delete mode 100644 implementation-contributed/javascriptcore/stress/phantom-spread-forward-varargs.js delete mode 100644 implementation-contributed/javascriptcore/stress/phantom-spread-osr-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/plus-boolean-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/plus-boolean-or-double.js delete mode 100644 implementation-contributed/javascriptcore/stress/plus-boolean-or-int.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-call-exit-this.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-call-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-call-stub-in-getter-stub.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-chain-getter.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-chain-setter.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-chain-then-getter.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-chain-then-setter.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-getter-combo.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-getter-then-chain.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-getter-then-self.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-proto-clear-stub.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-proto-intrinsic-getter-correctness.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-proto-miss.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-proto-op-in-caching.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-proto-prototype-map-having-a-bad-time.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-proto-put-transition.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-proto-set-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-proto-setter.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-proto-using-inheritance.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-self-getter.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-self-then-getter.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-setter-combo.js delete mode 100644 implementation-contributed/javascriptcore/stress/poly-setter-then-self.js delete mode 100644 implementation-contributed/javascriptcore/stress/polymorphic-prototype-accesses.js delete mode 100644 implementation-contributed/javascriptcore/stress/promise-cannot-be-called.js delete mode 100644 implementation-contributed/javascriptcore/stress/promise-finally.js delete mode 100644 implementation-contributed/javascriptcore/stress/promise-infinite-recursion-should-not-crash.js delete mode 100644 implementation-contributed/javascriptcore/stress/promise-species-functions.js delete mode 100644 implementation-contributed/javascriptcore/stress/prop-type-boolean-then-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/prop-type-int32-then-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/prop-type-number-then-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/prop-type-object-or-other-then-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/prop-type-object-then-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/prop-type-other-then-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/prop-type-string-then-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/prop-type-struct-or-other-then-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/prop-type-struct-then-object-opt-fold.js delete mode 100644 implementation-contributed/javascriptcore/stress/prop-type-struct-then-object-opt-multi.js delete mode 100644 implementation-contributed/javascriptcore/stress/prop-type-struct-then-object-opt.js delete mode 100644 implementation-contributed/javascriptcore/stress/prop-type-struct-then-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/prop-type-symbol-then-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/prop-type-symbol-then-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/proper-flushing-when-we-insert-unreachable-after-force-exit-in-bytecode-parser.js delete mode 100644 implementation-contributed/javascriptcore/stress/proper-property-store-with-prototype-property-that-is-not-writable.js delete mode 100644 implementation-contributed/javascriptcore/stress/property-name-enumerator-should-not-look-into-indexed-values-when-it-is-a-dictionary.js delete mode 100644 implementation-contributed/javascriptcore/stress/property-setters-should-not-be-called-for-bound-arguments-list-entries.js delete mode 100644 implementation-contributed/javascriptcore/stress/proto-setter.js delete mode 100644 implementation-contributed/javascriptcore/stress/prototype-chain-has-dictionary-structure-for-in-caching.js delete mode 100644 implementation-contributed/javascriptcore/stress/prototype-for-async-generator.js delete mode 100644 implementation-contributed/javascriptcore/stress/prototype-getter.js delete mode 100644 implementation-contributed/javascriptcore/stress/prototype-is-not-js-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/prune-multi-put-by-offset-replace-or-transition-variant.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-id-build-list-order-recurse.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-id-direct-should-be-done-for-non-index-property.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-id-direct-strict-transition.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-id-direct-transition.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-id-on-new-object-after-prototype-transition-non-strict.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-id-on-new-object-after-prototype-transition-strict.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-id-strict-build-list-order.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-id-throw-through-optimized-code.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-id-transition-null-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-val-array-storage.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-val-out-of-bounds-basics.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-val-slow-put-array-storage.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-val-with-string-break.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-val-with-string-generated.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-val-with-string-generic.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-val-with-symbol-break.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-by-val-with-symbol-generic.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-direct-index-broken-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-direct-index-broken.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-getter-setter-by-id-strict-transition.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-getter-setter-by-id-transition.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-indexed-getter-setter.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-inline-cache-side-effects.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-local-conservative.js delete mode 100644 implementation-contributed/javascriptcore/stress/put-on-cow-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/raise-error-in-iterator-close.js delete mode 100644 implementation-contributed/javascriptcore/stress/random-53bit.js delete mode 100644 implementation-contributed/javascriptcore/stress/random-in-range.js delete mode 100644 implementation-contributed/javascriptcore/stress/real-forward-varargs-for-inlined-escaped-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/recurse-infinitely-on-getter.js delete mode 100644 implementation-contributed/javascriptcore/stress/recursive-tail-call-with-different-argument-count.js delete mode 100644 implementation-contributed/javascriptcore/stress/recursive-try-catch.js delete mode 100644 implementation-contributed/javascriptcore/stress/recursive_property_redefine_during_inline_caching.js delete mode 100644 implementation-contributed/javascriptcore/stress/redundant-add-overflow-checks.js delete mode 100644 implementation-contributed/javascriptcore/stress/redundant-array-bounds-checks-addition-skip-first.js delete mode 100644 implementation-contributed/javascriptcore/stress/redundant-array-bounds-checks-addition.js delete mode 100644 implementation-contributed/javascriptcore/stress/redundant-array-bounds-checks-unchecked-addition.js delete mode 100644 implementation-contributed/javascriptcore/stress/redundant-array-bounds-checks.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect-apply.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect-construct.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect-define-property.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect-delete-property.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect-get-own-property.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect-get-prototype-of.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect-get.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect-has.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect-is-extensible.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect-own-keys.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect-prevent-extensions.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect-set-prototype-of.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect-set-proxy-set.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect-set-receiver-proxy-set.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect-set-with-global-proxy.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect-set.js delete mode 100644 implementation-contributed/javascriptcore/stress/reflect.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-exec-effect-after-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-exec-test-effectful-last-index.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-large-quantifier.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-last-index-sinking.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-last-index-writable.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-match-in-other-realm-should-work.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-match-proxy.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-match-should-work-with-objects-not-inheriting-object-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-match.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-matches-array-bad-time.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-matches-array-slow-put.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-matches-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-prototype-exec-on-too-long-rope.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-prototype-match-on-too-long-rope.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-prototype-replace-builtin-should-not-use-for-of.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-prototype-test-on-too-long-rope.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-prototype-tostring.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-replace-in-other-realm-should-work.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-replace-proxy.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-replace-should-work-with-objects-not-inheriting-object-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-search.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-syntax-error-invalid-flags.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-with-nonBMP-any.js delete mode 100644 implementation-contributed/javascriptcore/stress/regexp-with-runtime-syntax-errors.js delete mode 100644 implementation-contributed/javascriptcore/stress/relaxed-line-terminators-in-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/remove-phantom-after-setlocal.js delete mode 100644 implementation-contributed/javascriptcore/stress/repeat-put-to-scope-global-with-same-value-watchpoint-invalidate.js delete mode 100644 implementation-contributed/javascriptcore/stress/repeated-arity-check-fail.js delete mode 100644 implementation-contributed/javascriptcore/stress/repeated-put-by-id-reallocating-transition.js delete mode 100644 implementation-contributed/javascriptcore/stress/replacement-watchpoint-dictionary.js delete mode 100644 implementation-contributed/javascriptcore/stress/replacement-watchpoint.js delete mode 100644 implementation-contributed/javascriptcore/stress/rest-elements.js delete mode 100644 implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints-3.js delete mode 100644 implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints-4.js delete mode 100644 implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints-5.js delete mode 100644 implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints.js delete mode 100644 implementation-contributed/javascriptcore/stress/rest-parameter-and-default-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/rest-parameter-basics.js delete mode 100644 implementation-contributed/javascriptcore/stress/rest-parameter-having-a-bad-time.js delete mode 100644 implementation-contributed/javascriptcore/stress/rest-parameter-inlined.js delete mode 100644 implementation-contributed/javascriptcore/stress/rest-parameter-is-destructuring.js delete mode 100644 implementation-contributed/javascriptcore/stress/rest-parameter-many-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/rest-parameter-negative.js delete mode 100644 implementation-contributed/javascriptcore/stress/rest-parameter-various-types.js delete mode 100644 implementation-contributed/javascriptcore/stress/retry-cache-later.js delete mode 100644 implementation-contributed/javascriptcore/stress/right-left-context-invalidated-by-input.js delete mode 100644 implementation-contributed/javascriptcore/stress/ropes-symbol-toprimitive.js delete mode 100644 implementation-contributed/javascriptcore/stress/runtime-throw-through-optimized-code.js delete mode 100644 implementation-contributed/javascriptcore/stress/sampling-profiler-anonymous-function.js delete mode 100644 implementation-contributed/javascriptcore/stress/sampling-profiler-basic.js delete mode 100644 implementation-contributed/javascriptcore/stress/sampling-profiler-bound-function-name.js delete mode 100644 implementation-contributed/javascriptcore/stress/sampling-profiler-deep-stack.js delete mode 100644 implementation-contributed/javascriptcore/stress/sampling-profiler-display-name.js delete mode 100644 implementation-contributed/javascriptcore/stress/sampling-profiler-internal-function-name.js delete mode 100644 implementation-contributed/javascriptcore/stress/scoped-arguments-array-length.js delete mode 100644 implementation-contributed/javascriptcore/stress/scoped-arguments-check-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/scoped-arguments-out-of-bounds-change-structure.js delete mode 100644 implementation-contributed/javascriptcore/stress/scoped-arguments-test.js delete mode 100644 implementation-contributed/javascriptcore/stress/scoped-arguments-write-barrier-should-be-on-scope-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/scoped-then-direct-arguments-get-by-val-in-baseline.js delete mode 100644 implementation-contributed/javascriptcore/stress/set-add-check-failure.js delete mode 100644 implementation-contributed/javascriptcore/stress/set-add-clobber-set-has.js delete mode 100644 implementation-contributed/javascriptcore/stress/set-add-create-bucket.js delete mode 100644 implementation-contributed/javascriptcore/stress/set-add-does-not-clobber-map-get.js delete mode 100644 implementation-contributed/javascriptcore/stress/set-clone-instance-iterator-change.js delete mode 100644 implementation-contributed/javascriptcore/stress/set-clone-iterator-change.js delete mode 100644 implementation-contributed/javascriptcore/stress/set-clone-next-change.js delete mode 100644 implementation-contributed/javascriptcore/stress/set-clone.js delete mode 100644 implementation-contributed/javascriptcore/stress/set-constructor-adder.js delete mode 100644 implementation-contributed/javascriptcore/stress/set-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/set-inherit-add.js delete mode 100644 implementation-contributed/javascriptcore/stress/set-iterator-result-should-have-expected-shape.js delete mode 100644 implementation-contributed/javascriptcore/stress/set-iterators-next.js delete mode 100644 implementation-contributed/javascriptcore/stress/set-same-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/set-untyped-normalize-cse.js delete mode 100644 implementation-contributed/javascriptcore/stress/set-untyped-normalize.js delete mode 100644 implementation-contributed/javascriptcore/stress/simple-ai-effect.js delete mode 100644 implementation-contributed/javascriptcore/stress/simple-polyvariant-call-inlining-example.js delete mode 100644 implementation-contributed/javascriptcore/stress/simple-polyvariant-get-by-id-inlining-example.js delete mode 100644 implementation-contributed/javascriptcore/stress/simple-polyvariant-put-by-id-inlining-example.js delete mode 100644 implementation-contributed/javascriptcore/stress/simple-prototype-accesses.js delete mode 100644 implementation-contributed/javascriptcore/stress/simple-regexp-exec-folding-fail.js delete mode 100644 implementation-contributed/javascriptcore/stress/simple-regexp-exec-folding.js delete mode 100644 implementation-contributed/javascriptcore/stress/simple-regexp-test-folding-fail.js delete mode 100644 implementation-contributed/javascriptcore/stress/simple-regexp-test-folding.js delete mode 100644 implementation-contributed/javascriptcore/stress/simplify-varargs-mandatory-minimum-smaller-than-limit.js delete mode 100644 implementation-contributed/javascriptcore/stress/singleton-scope-then-overwrite.js delete mode 100644 implementation-contributed/javascriptcore/stress/singleton-scope-then-realloc-and-overwrite.js delete mode 100644 implementation-contributed/javascriptcore/stress/singleton-scope-then-realloc.js delete mode 100644 implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check-dfg.js delete mode 100644 implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check-int32-dfg.js delete mode 100644 implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check-int32.js delete mode 100644 implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check-sneakier.js delete mode 100644 implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check.js delete mode 100644 implementation-contributed/javascriptcore/stress/sink-function-past-invalid-check-sneakier.js delete mode 100644 implementation-contributed/javascriptcore/stress/sink-function-past-invalid-check-sneaky.js delete mode 100644 implementation-contributed/javascriptcore/stress/sink-multigetbyoffset.js delete mode 100644 implementation-contributed/javascriptcore/stress/sink-object-past-invalid-check-int32.js delete mode 100644 implementation-contributed/javascriptcore/stress/sink-object-past-invalid-check-sneakier.js delete mode 100644 implementation-contributed/javascriptcore/stress/sink-object-past-invalid-check-sneaky.js delete mode 100644 implementation-contributed/javascriptcore/stress/sink-object-past-invalid-check.js delete mode 100644 implementation-contributed/javascriptcore/stress/sink-phantom-new-array-buffer-exit-ok.js delete mode 100644 implementation-contributed/javascriptcore/stress/sink-put-stack-over-kill-stack.js delete mode 100644 implementation-contributed/javascriptcore/stress/sink-to-impossible-multi-get-by-offset-on-prototypes.js delete mode 100644 implementation-contributed/javascriptcore/stress/sink_checkstructure.js delete mode 100644 implementation-contributed/javascriptcore/stress/slightly-more-difficult-to-fold-reflective-arguments-access.js delete mode 100644 implementation-contributed/javascriptcore/stress/sloppy-mode-function-hoisting.js delete mode 100644 implementation-contributed/javascriptcore/stress/sloppy-mode-hoist-arguments-function-non-simple-parameter-list.js delete mode 100644 implementation-contributed/javascriptcore/stress/slow-path-generator-updating-current-node-dfg.js delete mode 100644 implementation-contributed/javascriptcore/stress/sort-array-with-undecided.js delete mode 100644 implementation-contributed/javascriptcore/stress/sorting-boolean-result-comparator.js delete mode 100644 implementation-contributed/javascriptcore/stress/source-origin.js delete mode 100644 implementation-contributed/javascriptcore/stress/sparse-define-empty-descriptor.js delete mode 100644 implementation-contributed/javascriptcore/stress/sparse-map-non-overlapping.js delete mode 100644 implementation-contributed/javascriptcore/stress/sparse-map-non-skip-getter-overriding.js delete mode 100644 implementation-contributed/javascriptcore/stress/sparse-map-non-skip.js delete mode 100644 implementation-contributed/javascriptcore/stress/sparse_splice.js delete mode 100644 implementation-contributed/javascriptcore/stress/spec-empty-flows-through-cell-checks.js delete mode 100644 implementation-contributed/javascriptcore/stress/splay-flash-access-1ms.js delete mode 100644 implementation-contributed/javascriptcore/stress/splay-flash-access.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-array-iterator-watchpoint-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-array-iterator-watchpoint.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-call-convert-to-static-call.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-calling.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-capture-rest.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-consults-correct-global-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-escapes-but-create-rest-does-not.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-escapes-but-new-array-buffer-does-not-double.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-escapes-but-new-array-buffer-does-not.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-forward-call-varargs-stack-overflow.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-forward-varargs-rest-parameter-change-iterator-protocol-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-forward-varargs-rest-parameter-change-iterator-protocol.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-forward-varargs-stack-overflow.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-in-tail.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-multi-layers.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-non-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-non-varargs.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-optimized-properly.js delete mode 100644 implementation-contributed/javascriptcore/stress/spread-outer-create-rest.js delete mode 100644 implementation-contributed/javascriptcore/stress/static-function-delete.js delete mode 100644 implementation-contributed/javascriptcore/stress/static-function-put.js delete mode 100644 implementation-contributed/javascriptcore/stress/static-getter-delete.js delete mode 100644 implementation-contributed/javascriptcore/stress/static-getter-descriptors.js delete mode 100644 implementation-contributed/javascriptcore/stress/static-getter-enumeration.js delete mode 100644 implementation-contributed/javascriptcore/stress/static-getter-get.js delete mode 100644 implementation-contributed/javascriptcore/stress/static-getter-in-names.js delete mode 100644 implementation-contributed/javascriptcore/stress/static-getter-names.js delete mode 100644 implementation-contributed/javascriptcore/stress/static-getter-put.js delete mode 100644 implementation-contributed/javascriptcore/stress/strcat-emtpy.js delete mode 100644 implementation-contributed/javascriptcore/stress/strict-function-structure.js delete mode 100644 implementation-contributed/javascriptcore/stress/strict-mode-arguments-caller.js delete mode 100644 implementation-contributed/javascriptcore/stress/strict-nested-function-structure.js delete mode 100644 implementation-contributed/javascriptcore/stress/strict-to-this-int.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-compare.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-from-char-code-change-structure-not-dead.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-from-char-code-change-structure.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-from-char-code-slow.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-from-code-point.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-ident-to-not-string-var-equality.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-instanceof.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-iterators.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-joining-long-strings-should-not-crash.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-normalize.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-object-define-own-property.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-object-put-by-index.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-out-of-bounds-negative-proto-value.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-proto.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-prototype-charCodeAt-on-too-long-rope.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-prototype-methods-endsWith-startsWith-includes-correctness.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-prototype-scopes-global-lexical-environment-strict.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-prototype-scopes-global-lexical-environment.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-prototype-scopes-strict.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-prototype-scopes.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-raw.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-repeat-copy-chars-crash.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-repeat-edge-cases.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-replace-constant-folding-replacer-not-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-replace-proxy.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-rope-with-custom-valueof.js delete mode 100644 implementation-contributed/javascriptcore/stress/string-symbol-customization.js delete mode 100644 implementation-contributed/javascriptcore/stress/sub-order-evaluation.js delete mode 100644 implementation-contributed/javascriptcore/stress/sub-overflows-after-not-equal.js delete mode 100644 implementation-contributed/javascriptcore/stress/super-call-does-not-look-up-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/super-call-function-subclass.js delete mode 100644 implementation-contributed/javascriptcore/stress/super-dot-call-and-apply.js delete mode 100644 implementation-contributed/javascriptcore/stress/super-force-ic-fail.js delete mode 100644 implementation-contributed/javascriptcore/stress/super-getter-reset-ic.js delete mode 100644 implementation-contributed/javascriptcore/stress/super-in-lexical-scope.js delete mode 100644 implementation-contributed/javascriptcore/stress/super-method-calls-check-tdz.js delete mode 100644 implementation-contributed/javascriptcore/stress/super-property-access-exceptions.js delete mode 100644 implementation-contributed/javascriptcore/stress/super-property-access-object-literal-to-this-2.js delete mode 100644 implementation-contributed/javascriptcore/stress/super-property-access-object-literal-to-this.js delete mode 100644 implementation-contributed/javascriptcore/stress/super-property-access-tdz.js delete mode 100644 implementation-contributed/javascriptcore/stress/super-property-access-to-this.js delete mode 100644 implementation-contributed/javascriptcore/stress/super-property-access.js delete mode 100644 implementation-contributed/javascriptcore/stress/switch-typeof-indirect.js delete mode 100644 implementation-contributed/javascriptcore/stress/switch-typeof-slightly-indirect.js delete mode 100644 implementation-contributed/javascriptcore/stress/switch-typeof.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-and-string-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-array-from.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-define-property.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-description.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-equality-over-gc.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-equality.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-error-messages.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-get-own-property.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-hasInstance.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-instanceof.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-registry.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-seal-and-freeze.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-should-not-break-for-in.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-species.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-toprimitive-errors.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-toprimitive.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-tostringtag-watchpoints.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-tostringtag.js delete mode 100644 implementation-contributed/javascriptcore/stress/symbol-with-json.js delete mode 100644 implementation-contributed/javascriptcore/stress/tagged-template-object-collect.js delete mode 100644 implementation-contributed/javascriptcore/stress/tagged-template-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/tagged-template-tdz.js delete mode 100644 implementation-contributed/javascriptcore/stress/tagged-templates-identity.js delete mode 100644 implementation-contributed/javascriptcore/stress/tagged-templates-raw-strings.js delete mode 100644 implementation-contributed/javascriptcore/stress/tagged-templates-syntax.js delete mode 100644 implementation-contributed/javascriptcore/stress/tagged-templates-template-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/tagged-templates-this.js delete mode 100644 implementation-contributed/javascriptcore/stress/tagged-templates.js delete mode 100644 implementation-contributed/javascriptcore/stress/tail-call-host-call-throw.js delete mode 100644 implementation-contributed/javascriptcore/stress/tail-call-in-inline-cache.js delete mode 100644 implementation-contributed/javascriptcore/stress/tail-call-no-stack-overflow.js delete mode 100644 implementation-contributed/javascriptcore/stress/tail-call-profiler.js delete mode 100644 implementation-contributed/javascriptcore/stress/tail-call-recognize.js delete mode 100644 implementation-contributed/javascriptcore/stress/tail-call-varargs-no-stack-overflow.js delete mode 100644 implementation-contributed/javascriptcore/stress/tail-calls-dont-overwrite-live-stack.js delete mode 100644 implementation-contributed/javascriptcore/stress/tdz-this-in-try-catch.js delete mode 100644 implementation-contributed/javascriptcore/stress/template-literal-line-terminators.js delete mode 100644 implementation-contributed/javascriptcore/stress/template-literal-syntax.js delete mode 100644 implementation-contributed/javascriptcore/stress/template-literal.js delete mode 100644 implementation-contributed/javascriptcore/stress/template-string-tags-eval.js delete mode 100644 implementation-contributed/javascriptcore/stress/test-finally.js delete mode 100644 implementation-contributed/javascriptcore/stress/throw-from-ftl-call-ic-slow-path-cells.js delete mode 100644 implementation-contributed/javascriptcore/stress/throw-from-ftl-call-ic-slow-path-undefined.js delete mode 100644 implementation-contributed/javascriptcore/stress/throw-from-ftl-call-ic-slow-path.js delete mode 100644 implementation-contributed/javascriptcore/stress/throw-from-ftl-in-loop.js delete mode 100644 implementation-contributed/javascriptcore/stress/throw-from-ftl.js delete mode 100644 implementation-contributed/javascriptcore/stress/throw-through-optimized-code.js delete mode 100644 implementation-contributed/javascriptcore/stress/tier-up-in-loop-with-cfg-simplification.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-int32-sensible.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-int32-sensible2.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-lower-case-intrinsic-on-empty-rope.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-lower-case.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-number-basics.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-number-convert-identity-without-execution.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-number-int52.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-number-intrinsic-convert-to-identity-without-execution.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-number-intrinsic-int52.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-number-intrinsic-object-without-execution.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-number-intrinsic-value-profiling.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-number-object-without-execution.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-number-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-number-throws-correct-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-number-value-profiling.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-property-key-correctness.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-string-int32.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-string-int52.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-string-non-cell-use.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-string-on-object-or-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-string-on-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-string-on-string-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-string-on-string-or-string-object-then-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-string-on-string-or-string-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-string-on-value-or-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-string-on-value.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-string-with-int52.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-this-before-arrow-function-closes-over-this-that-starts-as-lexical-environment.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-this-boolean.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-this-double.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-this-global-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-this-int32.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-this-int52.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-this-number.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-this-numbers.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-this-on-constant-lexical-environment.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-this-polymorphic.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-this-string.js delete mode 100644 implementation-contributed/javascriptcore/stress/to-this-symbol.js delete mode 100644 implementation-contributed/javascriptcore/stress/toprimitive-speculated-types.js delete mode 100644 implementation-contributed/javascriptcore/stress/trailing-comma-in-function-parameters.js delete mode 100644 implementation-contributed/javascriptcore/stress/trailing-comma-in-patterns.js delete mode 100644 implementation-contributed/javascriptcore/stress/tricky-indirectly-inferred-infinite-loop-that-uses-captured-variables-and-creates-the-activation-outside-the-loop.js delete mode 100644 implementation-contributed/javascriptcore/stress/tricky-inferred-infinite-loop-that-uses-captured-variables-and-creates-the-activation-outside-the-loop.js delete mode 100644 implementation-contributed/javascriptcore/stress/tricky-infinite-loop-that-uses-captured-variables-and-creates-the-activation-outside-the-loop.js delete mode 100644 implementation-contributed/javascriptcore/stress/tricky-infinite-loop-that-uses-captured-variables.js delete mode 100644 implementation-contributed/javascriptcore/stress/trim.js delete mode 100644 implementation-contributed/javascriptcore/stress/trivially-foldable-reflective-arguments-access.js delete mode 100644 implementation-contributed/javascriptcore/stress/try-catch-getter-as-get-by-id-register-restoration.js delete mode 100644 implementation-contributed/javascriptcore/stress/try-catch-getter-as-get-by-id.js delete mode 100644 implementation-contributed/javascriptcore/stress/try-catch-setter-as-put-by-id.js delete mode 100644 implementation-contributed/javascriptcore/stress/try-catch-stub-routine-replaced.js delete mode 100644 implementation-contributed/javascriptcore/stress/type-check-hoisting-phase-hoist-check-structure-on-tdz-this-value.js delete mode 100644 implementation-contributed/javascriptcore/stress/type-of-functions-and-objects.js delete mode 100644 implementation-contributed/javascriptcore/stress/typed-array-byte-offset.js delete mode 100644 implementation-contributed/javascriptcore/stress/typed-array-get-by-val-profiling.js delete mode 100644 implementation-contributed/javascriptcore/stress/typed-array-put-by-val-profiling.js delete mode 100644 implementation-contributed/javascriptcore/stress/typed-array-view-set-should-not-crash-on-exception.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-access-monomorphic-neutered.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-access-neutered.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-add-property-to-base-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-bad-getter.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-configure-index.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-construct-iterator.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-copyWithin.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-every.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-fill.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-filter.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-find.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-findIndex.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-forEach.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-from.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-functions-with-neutered.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-getownproperty-not-configurable.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-getter-on-self.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-hasOwnProperty-out-of-bounds.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-includes.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-indexOf.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-intrinsic-getters-change-prototype.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-lastIndexOf.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-length-dictionary.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-map.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-of.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-reduce.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-reduceRight.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-set.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-slice.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-some.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-sort.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-subarray.js delete mode 100644 implementation-contributed/javascriptcore/stress/typedarray-view-string-properties-neutered.js delete mode 100644 implementation-contributed/javascriptcore/stress/typeof-dfg-function-or-object.js delete mode 100644 implementation-contributed/javascriptcore/stress/typeof-symbol.js delete mode 100644 implementation-contributed/javascriptcore/stress/uint32-comparison-jump.js delete mode 100644 implementation-contributed/javascriptcore/stress/uint32-comparison.js delete mode 100644 implementation-contributed/javascriptcore/stress/uint32-to-number-constant-folding.js delete mode 100644 implementation-contributed/javascriptcore/stress/uint32-to-number-fold-constant-with-do-overflow.js delete mode 100644 implementation-contributed/javascriptcore/stress/uint32-to-number-overflows-to-uint52.js delete mode 100644 implementation-contributed/javascriptcore/stress/uint32array-unsigned-load.js delete mode 100644 implementation-contributed/javascriptcore/stress/undecided-concat.js delete mode 100644 implementation-contributed/javascriptcore/stress/undecided-length.js delete mode 100644 implementation-contributed/javascriptcore/stress/undefined-access-dictionary-then-proto-change.js delete mode 100644 implementation-contributed/javascriptcore/stress/undefined-access-then-proto-change.js delete mode 100644 implementation-contributed/javascriptcore/stress/undefined-access-then-self-change.js delete mode 100644 implementation-contributed/javascriptcore/stress/unescape.js delete mode 100644 implementation-contributed/javascriptcore/stress/unscopables.js delete mode 100644 implementation-contributed/javascriptcore/stress/unshift-array-storage.js delete mode 100644 implementation-contributed/javascriptcore/stress/unshiftCountSlowCase-correct-postCapacity.js delete mode 100644 implementation-contributed/javascriptcore/stress/untyped-add.js delete mode 100644 implementation-contributed/javascriptcore/stress/untyped-bit-and.js delete mode 100644 implementation-contributed/javascriptcore/stress/untyped-bit-or.js delete mode 100644 implementation-contributed/javascriptcore/stress/untyped-bit-xor.js delete mode 100644 implementation-contributed/javascriptcore/stress/untyped-div.js delete mode 100644 implementation-contributed/javascriptcore/stress/untyped-equality.js delete mode 100644 implementation-contributed/javascriptcore/stress/untyped-less-than.js delete mode 100644 implementation-contributed/javascriptcore/stress/untyped-lshift.js delete mode 100644 implementation-contributed/javascriptcore/stress/untyped-mul.js delete mode 100644 implementation-contributed/javascriptcore/stress/untyped-rshift.js delete mode 100644 implementation-contributed/javascriptcore/stress/untyped-sub.js delete mode 100644 implementation-contributed/javascriptcore/stress/untyped-urshift.js delete mode 100644 implementation-contributed/javascriptcore/stress/use-arguments-as-object-pointer.js delete mode 100644 implementation-contributed/javascriptcore/stress/v8-crypto-strict.js delete mode 100644 implementation-contributed/javascriptcore/stress/v8-deltablue-strict.js delete mode 100644 implementation-contributed/javascriptcore/stress/v8-earley-boyer-strict.js delete mode 100644 implementation-contributed/javascriptcore/stress/v8-parameter-scoping.js delete mode 100644 implementation-contributed/javascriptcore/stress/v8-raytrace-strict.js delete mode 100644 implementation-contributed/javascriptcore/stress/v8-regexp-strict.js delete mode 100644 implementation-contributed/javascriptcore/stress/v8-richards-strict.js delete mode 100644 implementation-contributed/javascriptcore/stress/v8-splay-strict.js delete mode 100644 implementation-contributed/javascriptcore/stress/value-add-on-double-array-with-holes.js delete mode 100644 implementation-contributed/javascriptcore/stress/value-to-boolean.js delete mode 100644 implementation-contributed/javascriptcore/stress/value-to-int32-undefined-constant.js delete mode 100644 implementation-contributed/javascriptcore/stress/value-to-int32-undefined.js delete mode 100644 implementation-contributed/javascriptcore/stress/values-unscopables.js delete mode 100644 implementation-contributed/javascriptcore/stress/var-injection-cache-invalidation.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-closure-inlined-exit-strict-mode.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-closure-inlined-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-inlined-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-inlined-simple-exit-aliasing-weird-reversed-args.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-inlined-simple-exit-aliasing-weird.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-inlined-simple-exit-aliasing.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-inlined-simple-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-inlining-underflow.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-no-forward.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-simple.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-then-slow-call.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-too-few-arguments.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-two-level.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-varargs-closure-inlined-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-varargs-inlined-exit-strict-mode.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-varargs-inlined-exit.js delete mode 100644 implementation-contributed/javascriptcore/stress/varargs-with-unused-count.js delete mode 100644 implementation-contributed/javascriptcore/stress/variable-named-eval-under-tdz.js delete mode 100644 implementation-contributed/javascriptcore/stress/variable-under-tdz-eval-tricky.js delete mode 100644 implementation-contributed/javascriptcore/stress/vector-length-hint-array-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/vector-length-hint-new-array.js delete mode 100644 implementation-contributed/javascriptcore/stress/watchdog-dont-malloc-when-in-c-code.js delete mode 100644 implementation-contributed/javascriptcore/stress/weak-map-constructor-adder.js delete mode 100644 implementation-contributed/javascriptcore/stress/weak-map-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/weak-set-constructor-adder.js delete mode 100644 implementation-contributed/javascriptcore/stress/weak-set-constructor.js delete mode 100644 implementation-contributed/javascriptcore/stress/weakmap-cse-set-break.js delete mode 100644 implementation-contributed/javascriptcore/stress/weakmap-cse.js delete mode 100644 implementation-contributed/javascriptcore/stress/weakmap-gc.js delete mode 100644 implementation-contributed/javascriptcore/stress/weakmap-set-cse.js delete mode 100644 implementation-contributed/javascriptcore/stress/weakset-add-cse.js delete mode 100644 implementation-contributed/javascriptcore/stress/weakset-cse-add-break.js delete mode 100644 implementation-contributed/javascriptcore/stress/weakset-cse.js delete mode 100644 implementation-contributed/javascriptcore/stress/weakset-gc.js delete mode 100644 implementation-contributed/javascriptcore/stress/weird-equality-folding-cases.js delete mode 100644 implementation-contributed/javascriptcore/stress/weird-getter-counter.js delete mode 100644 implementation-contributed/javascriptcore/stress/weird-put-stack-varargs.js delete mode 100644 implementation-contributed/javascriptcore/stress/weird-setter-counter-syntactic.js delete mode 100644 implementation-contributed/javascriptcore/stress/weird-setter-counter.js delete mode 100644 implementation-contributed/javascriptcore/stress/with.js delete mode 100644 implementation-contributed/javascriptcore/stress/with_and_arith.js delete mode 100644 implementation-contributed/javascriptcore/stress/yield-and-line-terminator.js delete mode 100644 implementation-contributed/javascriptcore/stress/yield-label-generator.js delete mode 100644 implementation-contributed/javascriptcore/stress/yield-label.js delete mode 100644 implementation-contributed/javascriptcore/stress/yield-named-accessors-generator.js delete mode 100644 implementation-contributed/javascriptcore/stress/yield-named-accessors.js delete mode 100644 implementation-contributed/javascriptcore/stress/yield-named-variable-generator.js delete mode 100644 implementation-contributed/javascriptcore/stress/yield-named-variable.js delete mode 100644 implementation-contributed/javascriptcore/stress/yield-out-of-generator.js delete mode 100644 implementation-contributed/javascriptcore/stress/yield-reserved-word.js delete mode 100644 implementation-contributed/javascriptcore/stress/yield-star-throw-continue.js diff --git a/implementation-contributed/javascriptcore/stress/Number-isNaN-basics.js b/implementation-contributed/javascriptcore/stress/Number-isNaN-basics.js deleted file mode 100644 index 77abe201fc..0000000000 --- a/implementation-contributed/javascriptcore/stress/Number-isNaN-basics.js +++ /dev/null @@ -1,221 +0,0 @@ -function numberIsNaNOnInteger(value) -{ - return Number.isNaN(value); -} -noInline(numberIsNaNOnInteger); - -// *** Test simple cases on integers. *** -function testNumberIsNaNOnIntegers() -{ - // Bounds. - var value = numberIsNaNOnInteger(0); - if (value) - throw "numberIsNaNOnInteger(0) = " + value; - - var value = numberIsNaNOnInteger(-2147483648); - if (value) - throw "numberIsNaNOnInteger(-2147483648) = " + value; - - var value = numberIsNaNOnInteger(2147483647); - if (value) - throw "numberIsNaNOnInteger(2147483647) = " + value; - - // Simple values. - var value = numberIsNaNOnInteger(-1); - if (value) - throw "numberIsNaNOnInteger(-1) = " + value; - - var value = numberIsNaNOnInteger(42); - if (value) - throw "numberIsNaNOnInteger(42) = " + value; - - var value = numberIsNaNOnInteger(-42); - if (value) - throw "numberIsNaNOnInteger(-42) = " + value; -} -noInline(testNumberIsNaNOnIntegers); - -for (var i = 0; i < 1e4; ++i) { - testNumberIsNaNOnIntegers(); -} - -// Make sure we don't do anything stupid when the type is unexpected. -function verifyNumberIsNaNOnIntegerWithOtherTypes() -{ - var value = numberIsNaNOnInteger(Math.PI); - if (value) - throw "numberIsNaNOnInteger(Math.PI) = " + value; - - var value = numberIsNaNOnInteger("42"); - if (value) - throw "numberIsNaNOnInteger(\"42\") = " + value; - - var value = numberIsNaNOnInteger("WebKit"); - if (value) - throw "numberIsNaNOnInteger(\"WebKit\") = " + value; - - var value = numberIsNaNOnInteger(-0); - if (value) - throw "numberIsNaNOnInteger(-0) = " + value; -} -noInline(verifyNumberIsNaNOnIntegerWithOtherTypes); - -for (var i = 0; i < 1e4; ++i) { - verifyNumberIsNaNOnIntegerWithOtherTypes(); -} - - -// *** Test simple cases on doubles. *** -function numberIsNaNOnDouble(value) -{ - return Number.isNaN(value); -} -noInline(numberIsNaNOnDouble); - -// Test simple cases on doubles. -function testNumberIsNaNOnDoubles() -{ - var value = numberIsNaNOnDouble(Math.PI); - if (value) - throw "numberIsNaNOnDouble(Math.PI) = " + value; - - var value = numberIsNaNOnDouble(Math.E); - if (value) - throw "numberIsNaNOnDouble(Math.E) = " + value; - - var value = numberIsNaNOnDouble(Math.LN2); - if (value) - throw "numberIsNaNOnDouble(Math.LN2) = " + value; - - var value = numberIsNaNOnDouble(-0); - if (value) - throw "numberIsNaNOnDouble(-0) = " + value; - - var value = numberIsNaNOnDouble(NaN); - if (!value) - throw "numberIsNaNOnDouble(NaN) = " + value; - - var value = numberIsNaNOnDouble(Number.POSITIVE_INFINITY); - if (value) - throw "numberIsNaNOnDouble(Number.POSITIVE_INFINITY) = " + value; - - var value = numberIsNaNOnDouble(Number.NEGATIVE_INFINITY); - if (value) - throw "numberIsNaNOnDouble(Number.NEGATIVE_INFINITY) = " + value; -} -noInline(testNumberIsNaNOnDoubles); - -for (var i = 0; i < 1e4; ++i) { - testNumberIsNaNOnDoubles(); -} - -// Make sure we don't do anything stupid when the type is unexpected. -function verifyNumberIsNaNOnDoublesWithOtherTypes() -{ - var value = numberIsNaNOnDouble(1); - if (value) - throw "numberIsNaNOnDouble(1) = " + value; - - var value = numberIsNaNOnDouble("42"); - if (value) - throw "numberIsNaNOnDouble(\"42\") = " + value; - - var value = numberIsNaNOnDouble("WebKit"); - if (value) - throw "numberIsNaNOnDouble(\"WebKit\") = " + value; - - var value = numberIsNaNOnDouble({}); - if (value) - throw "numberIsNaNOnDouble({}) = " + value; -} -noInline(verifyNumberIsNaNOnDoublesWithOtherTypes); - -for (var i = 0; i < 1e4; ++i) { - verifyNumberIsNaNOnDoublesWithOtherTypes(); -} - - -// *** Unusual arguments. *** -function numberIsNaNNoArguments() -{ - return Number.isNaN(); -} -noInline(numberIsNaNNoArguments); - -function numberIsNaNTooManyArguments(a, b, c) -{ - return Number.isNaN(a, b, c); -} -noInline(numberIsNaNTooManyArguments); - - -for (var i = 0; i < 1e4; ++i) { - var value = numberIsNaNNoArguments(); - if (value) - throw "numberIsNaNNoArguments() = " + value; - - value = numberIsNaNTooManyArguments(2, 3, 5); - if (value) - throw "numberIsNaNTooManyArguments() = " + value; -} - - -// *** Constant as arguments. *** -function testNumberIsNaNOnConstants() -{ - var value = Number.isNaN(0); - if (value) - throw "Number.isNaN(0) = " + value; - var value = Number.isNaN(-0); - if (value) - throw "Number.isNaN(-0) = " + value; - var value = Number.isNaN(1); - if (value) - throw "Number.isNaN(1) = " + value; - var value = Number.isNaN(-1); - if (value) - throw "Number.isNaN(-1) = " + value; - var value = Number.isNaN(42); - if (value) - throw "Number.isNaN(42) = " + value; - var value = Number.isNaN(-42); - if (value) - throw "Number.isNaN(-42) = " + value; - var value = Number.isNaN(Number.POSITIVE_INFINITY); - if (value) - throw "Number.isNaN(Number.POSITIVE_INFINITY) = " + value; - var value = Number.isNaN(Number.NEGATIVE_INFINITY); - if (value) - throw "Number.isNaN(Number.NEGATIVE_INFINITY) = " + value; - var value = Number.isNaN(Math.E); - if (value) - throw "Number.isNaN(Math.E) = " + value; - var value = Number.isNaN(NaN); - if (!value) - throw "Number.isNaN(NaN) = " + value; -} -noInline(testNumberIsNaNOnConstants); - -for (var i = 0; i < 1e4; ++i) { - testNumberIsNaNOnConstants(); -} - - -// *** Struct transition. *** -function numberIsNaNStructTransition(value) -{ - return Number.isNaN(value); -} -noInline(numberIsNaNStructTransition); - -for (var i = 0; i < 1e4; ++i) { - var value = numberIsNaNStructTransition(42); - if (value) - throw "numberIsNaNStructTransition(42) = " + value; -} - -Number.isNaN = function() { return 123; } - -var value = numberIsNaNStructTransition(42); -if (value !== 123) - throw "numberIsNaNStructTransition(42) after transition = " + value; diff --git a/implementation-contributed/javascriptcore/stress/Object_static_methods_Object.getOwnPropertyDescriptors-proxy.js b/implementation-contributed/javascriptcore/stress/Object_static_methods_Object.getOwnPropertyDescriptors-proxy.js deleted file mode 100644 index 1d09086dab..0000000000 --- a/implementation-contributed/javascriptcore/stress/Object_static_methods_Object.getOwnPropertyDescriptors-proxy.js +++ /dev/null @@ -1,113 +0,0 @@ -function shouldBe(expected, actual, msg) { - if (msg === void 0) - msg = ''; - else - msg = ' for ' + msg; - if (actual !== expected) - throw new Error('bad value' + msg + ': ' + actual + '. Expected ' + expected); -} - -function shouldBeDataProperty(expected, value, name) { - if (name === void 0) - name = '<property descriptor>'; - shouldBe(value, expected.value, name + '.value'); - shouldBe(true, expected.enumerable, name + '.enumerable'); - shouldBe(true, expected.configurable, name + '.configurable'); - shouldBe(true, expected.writable, name + '.writable'); - shouldBe(undefined, expected.get, name + '.get'); - shouldBe(undefined, expected.set, name + '.set'); -} - -(function testPropertyFilteringAndOrder() { - var log = []; - var sym = Symbol('test'); - var O = { - 0: 0, - [sym]: 3, - 'a': 2, - 1: 1 - }; - - var P = new Proxy(O, { - ownKeys(target) { - log.push('ownKeys()'); - return Reflect.ownKeys(target); - }, - getOwnPropertyDescriptor(target, name) { - log.push(`getOwnPropertyDescriptor(${String(name)})`); - return Reflect.getOwnPropertyDescriptor(target, name); - }, - get() { throw new Error('[[Get]] trap should be unreachable'); }, - set() { throw new Error('[[Set]] trap should be unreachable'); }, - deleteProperty() { throw new Error('[[Delete]] trap should be unreachable'); }, - defineProperty() { throw new Error('[[DefineOwnProperty]] trap should be unreachable'); } - }); - - var result = Object.getOwnPropertyDescriptors(P); - shouldBe('ownKeys()|getOwnPropertyDescriptor(0)|getOwnPropertyDescriptor(1)|getOwnPropertyDescriptor(a)|getOwnPropertyDescriptor(Symbol(test))', log.join('|')); - shouldBeDataProperty(result[0], 0, 'result[0]'); - shouldBeDataProperty(result[1], 1, 'result[1]'); - shouldBeDataProperty(result.a, 2, 'result["a"]'); - shouldBeDataProperty(result[sym], 3, 'result[Symbol(test)]'); - - var result2 = Object.getOwnPropertyDescriptors(O); - shouldBeDataProperty(result2[0], 0, 'result2[0]'); - shouldBeDataProperty(result2[1], 1, 'result2[1]'); - shouldBeDataProperty(result2.a, 2, 'result2["a"]'); - shouldBeDataProperty(result2[sym], 3, 'result2[Symbol(test)]'); -})(); - -(function testDuplicatePropertyNames() { - var i = 0; - var log = []; - var P = new Proxy({}, { - ownKeys() { - log.push(`ownKeys()`); - return [ 'A', 'A' ]; - }, - getOwnPropertyDescriptor(t, name) { - log.push(`getOwnPropertyDescriptor(${name})`); - if (i++) return; - return { - configurable: true, - writable: false, - value: 'VALUE' - }; - }, - get() { throw new Error('[[Get]] trap should be unreachable'); }, - set() { throw new Error('[[Set]] trap should be unreachable'); }, - deleteProperty() { throw new Error('[[Delete]] trap should be unreachable'); }, - defineProperty() { throw new Error('[[DefineOwnProperty]] trap should be unreachable'); } - }); - - var result = Object.getOwnPropertyDescriptors(P); - shouldBe(true, result.A.configurable, 'for result.A.configurable'); - shouldBe(false, result.A.writable, 'for result.A.writable'); - shouldBe('VALUE', result.A.value, 'for result.A.value'); - shouldBe(false, result.A.enumerable, 'for result.A.enumerable'); - shouldBe(true, Object.hasOwnProperty.call(result, 'A')); - shouldBe('ownKeys()|getOwnPropertyDescriptor(A)|getOwnPropertyDescriptor(A)', log.join('|')); -})(); - -(function testUndefinedPropertyDescriptor() { - var log = []; - var P = new Proxy({}, { - ownKeys() { - log.push(`ownKeys()`); - return ['fakeProperty']; - }, - getOwnPropertyDescriptor(t, name) { - log.push(`getOwnPropertyDescriptor(${name})`); - return undefined; - }, - get() { throw new Error('[[Get]] trap should be unreachable'); }, - set() { throw new Error('[[Set]] trap should be unreachable'); }, - deleteProperty() { throw new Error('[[Delete]] trap should be unreachable'); }, - defineProperty() { throw new Error('[[DefineOwnProperty]] trap should be unreachable'); } - }); - - var result = Object.getOwnPropertyDescriptors(P); - shouldBe(false, result.hasOwnProperty('fakeProperty')); - shouldBe(false, 'fakeProperty' in result); - shouldBe('ownKeys()|getOwnPropertyDescriptor(fakeProperty)', log.join('|')); -})(); diff --git a/implementation-contributed/javascriptcore/stress/Object_static_methods_Object.getOwnPropertyDescriptors.js b/implementation-contributed/javascriptcore/stress/Object_static_methods_Object.getOwnPropertyDescriptors.js deleted file mode 100644 index ff30e7e0e7..0000000000 --- a/implementation-contributed/javascriptcore/stress/Object_static_methods_Object.getOwnPropertyDescriptors.js +++ /dev/null @@ -1,153 +0,0 @@ -function shouldBe(expected, actual, msg) { - if (msg === void 0) - msg = ''; - else - msg = ' for ' + msg; - if (actual !== expected) - throw new Error('bad value' + msg + ': ' + actual + '. Expected ' + expected); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -function shouldBeDataProperty(expected, value, name) { - if (name === void 0) - name = '<property descriptor>'; - shouldBe(value, expected.value, name + '.value'); - shouldBe(true, expected.enumerable, name + '.enumerable'); - shouldBe(true, expected.configurable, name + '.configurable'); - shouldBe(true, expected.writable, name + '.writable'); - shouldBe(undefined, expected.get, name + '.get'); - shouldBe(undefined, expected.set, name + '.set'); -} - -(function testMeta() { - shouldBe(1, Object.getOwnPropertyDescriptors.length); - - shouldBe('getOwnPropertyDescriptors', Object.getOwnPropertyDescriptors.name); - - var propertyDescriptor = Reflect.getOwnPropertyDescriptor(Object, 'getOwnPropertyDescriptors'); - shouldBe(false, propertyDescriptor.enumerable); - shouldBe(true, propertyDescriptor.writable); - shouldBe(true, propertyDescriptor.configurable); - - shouldThrow(() => new Object.getOwnPropertyDescriptors({}), "TypeError: function is not a constructor (evaluating 'new Object.getOwnPropertyDescriptors({})')"); -})(); - -(function testToObject() { - shouldThrow(() => Object.getOwnPropertyDescriptors(null), "TypeError: null is not an object (evaluating 'Object.getOwnPropertyDescriptors(null)')"); - shouldThrow(() => Object.getOwnPropertyDescriptors(undefined), "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptors(undefined)')"); - shouldThrow(() => Object.getOwnPropertyDescriptors(), "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptors()')"); -})(); - -(function testPrototypeProperties() { - function F() {}; - F.prototype.a = 'A'; - F.prototype.b = 'B'; - F.prototype[9999] = '0'; - F.prototype[0] = '0'; - - var F2 = new F(); - Object.defineProperties(F2, { - 'b': { - enumerable: false, - configurable: true, - writable: false, - value: 'Shadowed "B"' - }, - 'c': { - enumerable: false, - configurable: true, - writable: false, - value: 'C' - }, - 9998: { - enumerable: true, - configurable: true, - writable: true, - value: 'X' - } - }); - - var result = Object.getOwnPropertyDescriptors(F2); - - shouldBe(undefined, result[0]); - - shouldBe(result[9998].enumerable, true); - shouldBe(result[9998].configurable, true); - shouldBe(result[9998].writable, true); - shouldBe(result[9998].value, 'X') - - shouldBe(undefined, result[9999]); - - shouldBe(undefined, result.a); - - shouldBe(result.b.enumerable, false); - shouldBe(result.b.configurable, true); - shouldBe(result.b.writable, false); - shouldBe(result.b.value, 'Shadowed "B"'); - - shouldBe(result.c.enumerable, false); - shouldBe(result.c.configurable, true); - shouldBe(result.c.writable, false); - shouldBe(result.c.value, 'C'); -})(); - -(function testGlobalProxy(global) { - var symbol = Symbol('test'); - global[symbol] = 'Symbol(test)'; - - var result = Object.getOwnPropertyDescriptors(global); - - shouldBeDataProperty(result[symbol], 'Symbol(test)', 'global[Symbol(test)]'); - delete global[symbol]; -})(this); - -(function testIndexedProperties() { - var object = { 0: 'test' }; - var result = Object.getOwnPropertyDescriptors(object); - shouldBeDataProperty(result[0], 'test', 'result[0]'); - shouldBeDataProperty(result['0'], 'test', 'result["0"]'); - shouldBe(result[0], result['0']); -})(); - - -(function testPropertiesIndexedSetterOnPrototypeThrows() { - var symbol = Symbol('test'); - Object.defineProperties(Object.prototype, { - 0: { - configurable: true, - get() { return; }, - set(v) { throw new Error("Setter on prototype should be unreachable!"); } - }, - a: { - configurable: true, - get() { return; }, - set(v) { throw new Error("Setter on prototype should be unreachable!"); } - }, - [symbol]: { - configurable: true, - get() { return; }, - set(v) { throw new Error("Setter on prototype should be unreachable!"); } - } - }); - var result = Object.getOwnPropertyDescriptors({ 0: 1, a: 2, [symbol]: 3 }) - delete Object.prototype[0]; - delete Object.prototype.a; - delete Object.prototype[symbol]; - shouldBeDataProperty(result[0], 1, 'result[0]'); - shouldBeDataProperty(result.a, 2, 'result["a"]'); - shouldBeDataProperty(result[symbol], 3, 'result[symbol]'); -})(); diff --git a/implementation-contributed/javascriptcore/stress/OverrideHasInstance-should-not-branch-across-register-allocations.js b/implementation-contributed/javascriptcore/stress/OverrideHasInstance-should-not-branch-across-register-allocations.js deleted file mode 100644 index aecdd2bc50..0000000000 --- a/implementation-contributed/javascriptcore/stress/OverrideHasInstance-should-not-branch-across-register-allocations.js +++ /dev/null @@ -1,16 +0,0 @@ -//@ runDefault - -// This test should not crash. - -delete this.Function; - -var test = function() { - Math.cos("0" instanceof arguments) -} - -for (var k = 0; k < 10000; ++k) { - try { - test(); - } catch (e) { - } -} diff --git a/implementation-contributed/javascriptcore/stress/SharedArrayBuffer-opt.js b/implementation-contributed/javascriptcore/stress/SharedArrayBuffer-opt.js deleted file mode 100644 index 7b2c27ff9e..0000000000 --- a/implementation-contributed/javascriptcore/stress/SharedArrayBuffer-opt.js +++ /dev/null @@ -1,134 +0,0 @@ -//@ skip -var dv = new DataView(new SharedArrayBuffer(128)); -var i8a = new Int8Array(new SharedArrayBuffer(128)); -var i16a = new Int16Array(new SharedArrayBuffer(128)); -var i32a = new Int32Array(new SharedArrayBuffer(128)); -var u8a = new Uint8Array(new SharedArrayBuffer(128)); -var u8ca = new Uint8ClampedArray(new SharedArrayBuffer(128)); -var u16a = new Uint16Array(new SharedArrayBuffer(128)); -var u32a = new Uint32Array(new SharedArrayBuffer(128)); -var f32a = new Float32Array(new SharedArrayBuffer(128)); -var f64a = new Float64Array(new SharedArrayBuffer(128)); - -var arrays = [i8a, i16a, i32a, u8a, u16a, u32a]; - -var atomics = new Map(); -var genericAtomics = new Map(); -for (var a of arrays) { - var map = new Map(); - atomics.set(a, map); -} -var count = 0; -for (var op of ["add", "and", "compareExchange", "exchange", "load", "or", "store", "sub", "xor"]) { - var numExtraArgs; - switch (op) { - case "compareExchange": - numExtraArgs = 2; - break; - case "load": - numExtraArgs = 0; - break; - default: - numExtraArgs = 1; - break; - } - - function str() { - var str = "(function (array" + count + ", index"; - for (var i = 0; i < numExtraArgs; ++i) - str += ", a" + i; - str += ") { return Atomics." + op + "(array" + count + ", index"; - for (var i = 0; i < numExtraArgs; ++i) - str += ", a" + i; - str += "); })"; - count++; - return str; - } - - var f = eval(str()); - noInline(f); - // Warm it up on crazy. - for (var i = 0; i < 10000; ++i) - f(arrays[i % arrays.length], 0, 0, 0); - genericAtomics.set(op, f); - - for (var a of arrays) { - var map = atomics.get(a); - - var f = eval(str()); - noInline(f); - - // Warm it up on something easy. - for (var i = 0; i < 10000; ++i) - f(a, 0, 0, 0); - - map.set(op, f); - } -} - -function runAtomic(array, index, init, name, args, expectedResult, expectedOutcome) -{ - for (var f of [{name: "specialized", func: atomics.get(array).get(name)}, - {name: "generic", func: genericAtomics.get(name)}]) { - array[index] = init; - var result = f.func(array, index, ...args); - if (result != expectedResult) - throw new Error("Expected Atomics." + name + "(array, " + index + ", " + args.join(", ") + ") to return " + expectedResult + " but returned " + result + " for " + Object.prototype.toString.apply(array) + " and " + f.name); - if (array[index] !== expectedOutcome) - throw new Error("Expected Atomics." + name + "(array, " + index + ", " + args.join(", ") + ") to result in array[" + index + "] = " + expectedOutcome + " but got " + array[index] + " for " + Object.prototype.toString.apply(array) + " and " + f.name); - } -} - -for (var a of arrays) { - runAtomic(a, 0, 13, "add", [42], 13, 55); - runAtomic(a, 0, 13, "and", [42], 13, 8); - runAtomic(a, 0, 13, "compareExchange", [25, 42], 13, 13); - runAtomic(a, 0, 13, "compareExchange", [13, 42], 13, 42); - runAtomic(a, 0, 13, "exchange", [42], 13, 42); - runAtomic(a, 0, 13, "load", [], 13, 13); - runAtomic(a, 0, 13, "or", [42], 13, 47); - runAtomic(a, 0, 13, "store", [42], 42, 42); - runAtomic(a, 0, 42, "sub", [13], 42, 29); - runAtomic(a, 0, 13, "xor", [42], 13, 39); -} - -function shouldFail(f, name) -{ - try { - f(); - } catch (e) { - if (e.name == name.name) - return; - throw new Error(f + " threw the wrong error: " + e); - } - throw new Error(f + " succeeded!"); -} - -for (var bad of [void 0, null, false, true, 1, 0.5, Symbol(), {}, "hello", dv, u8ca, f32a, f64a]) { - shouldFail(() => genericAtomics.get("add")(bad, 0, 0), TypeError); - shouldFail(() => genericAtomics.get("and")(bad, 0, 0), TypeError); - shouldFail(() => genericAtomics.get("compareExchange")(bad, 0, 0, 0), TypeError); - shouldFail(() => genericAtomics.get("exchange")(bad, 0, 0), TypeError); - shouldFail(() => genericAtomics.get("load")(bad, 0), TypeError); - shouldFail(() => genericAtomics.get("or")(bad, 0, 0), TypeError); - shouldFail(() => genericAtomics.get("store")(bad, 0, 0), TypeError); - shouldFail(() => genericAtomics.get("sub")(bad, 0, 0), TypeError); - shouldFail(() => genericAtomics.get("xor")(bad, 0, 0), TypeError); -} - -for (var idx of [-1, -1000000000000, 10000, 10000000000000, "hello"]) { - for (var a of arrays) { - for (var m of [atomics.get(a), genericAtomics]) { - shouldFail(() => m.get("add")(a, idx, 0), RangeError); - shouldFail(() => m.get("and")(a, idx, 0), RangeError); - shouldFail(() => m.get("compareExchange")(a, idx, 0, 0), RangeError); - shouldFail(() => m.get("exchange")(a, idx, 0), RangeError); - shouldFail(() => m.get("load")(a, idx), RangeError); - shouldFail(() => m.get("or")(a, idx, 0), RangeError); - shouldFail(() => m.get("store")(a, idx, 0), RangeError); - shouldFail(() => m.get("sub")(a, idx, 0), RangeError); - shouldFail(() => m.get("xor")(a, idx, 0), RangeError); - } - } -} - diff --git a/implementation-contributed/javascriptcore/stress/SharedArrayBuffer.js b/implementation-contributed/javascriptcore/stress/SharedArrayBuffer.js deleted file mode 100644 index 3b269a7650..0000000000 --- a/implementation-contributed/javascriptcore/stress/SharedArrayBuffer.js +++ /dev/null @@ -1,134 +0,0 @@ -//@ skip -// This is a basic test of SharedArrayBuffer API as we understand it. - -if (SharedArrayBuffer == ArrayBuffer) - throw new Error("SharedArrayBuffer and ArrayBuffer should be distinct"); - -if (SharedArrayBuffer.prototype == ArrayBuffer.prototype) - throw new Error("SharedArrayBuffer.prototype and ArrayBuffer.prototype should be distinct"); - -if (SharedArrayBuffer.prototype.__proto__ != Object.prototype) - throw new Error("SharedArrayBuffer.prototype.__proto__ should be Object.prototype"); - -if (!(new SharedArrayBuffer(100) instanceof SharedArrayBuffer)) - throw new Error("SharedArrayBuffer should be an instance of SharedArrayBuffer"); - -if (!(new ArrayBuffer(100) instanceof ArrayBuffer)) - throw new Error("ArrayBuffer should be an instance of ArrayBuffer"); - -if (new SharedArrayBuffer(100) instanceof ArrayBuffer) - throw new Error("SharedArrayBuffer should not be an instance of ArrayBuffer"); - -if (new ArrayBuffer(100) instanceof SharedArrayBuffer) - throw new Error("ArrayBuffer should not be an instance of SharedArrayBuffer"); - -function checkAtomics(name, count) -{ - if (!Atomics[name]) - throw new Error("Missing Atomics." + name); - if (Atomics[name].length != count) - throw new Error("Atomics." + name + " should have length " + count + " but has length " + Atomics[name].length); -} -checkAtomics("add", 3); -checkAtomics("and", 3); -checkAtomics("compareExchange", 4); -checkAtomics("exchange", 3); -checkAtomics("isLockFree", 1); -checkAtomics("load", 2); -checkAtomics("or", 3); -checkAtomics("store", 3); -checkAtomics("sub", 3); -checkAtomics("wait", 4); -checkAtomics("wake", 3); -checkAtomics("xor", 3); - -// These should all succeed. -var dv = new DataView(new SharedArrayBuffer(128)); -var i8a = new Int8Array(new SharedArrayBuffer(128)); -var i16a = new Int16Array(new SharedArrayBuffer(128)); -var i32a = new Int32Array(new SharedArrayBuffer(128)); -var u8a = new Uint8Array(new SharedArrayBuffer(128)); -var u8ca = new Uint8ClampedArray(new SharedArrayBuffer(128)); -var u16a = new Uint16Array(new SharedArrayBuffer(128)); -var u32a = new Uint32Array(new SharedArrayBuffer(128)); -var f32a = new Float32Array(new SharedArrayBuffer(128)); -var f64a = new Float64Array(new SharedArrayBuffer(128)); - -function shouldFail(f, name) -{ - try { - f(); - } catch (e) { - if (e.name == name.name) - return; - throw new Error(f + " threw the wrong error: " + e); - } - throw new Error(f + " succeeded!"); -} - -for (bad of [void 0, null, false, true, 1, 0.5, Symbol(), {}, "hello", dv, u8ca, f32a, f64a]) { - shouldFail(() => Atomics.add(bad, 0, 0), TypeError); - shouldFail(() => Atomics.and(bad, 0, 0), TypeError); - shouldFail(() => Atomics.compareExchange(bad, 0, 0, 0), TypeError); - shouldFail(() => Atomics.exchange(bad, 0, 0), TypeError); - shouldFail(() => Atomics.load(bad, 0), TypeError); - shouldFail(() => Atomics.or(bad, 0, 0), TypeError); - shouldFail(() => Atomics.store(bad, 0, 0), TypeError); - shouldFail(() => Atomics.sub(bad, 0, 0), TypeError); - shouldFail(() => Atomics.xor(bad, 0, 0), TypeError); -} - -for (bad of [void 0, null, false, true, 1, 0.5, Symbol(), {}, "hello", dv, i8a, i16a, u8a, u8ca, u16a, u32a, f32a, f64a]) { - shouldFail(() => Atomics.wait(bad, 0, 0), TypeError); - shouldFail(() => Atomics.wake(bad, 0, 0), TypeError); -} - -for (idx of [-1, -1000000000000, 10000, 10000000000000, "hello"]) { - for (a of [i8a, i16a, i32a, u8a, u16a, u32a]) { - shouldFail(() => Atomics.add(a, idx, 0), RangeError); - shouldFail(() => Atomics.and(a, idx, 0), RangeError); - shouldFail(() => Atomics.compareExchange(a, idx, 0, 0), RangeError); - shouldFail(() => Atomics.exchange(a, idx, 0), RangeError); - shouldFail(() => Atomics.load(a, idx), RangeError); - shouldFail(() => Atomics.or(a, idx, 0), RangeError); - shouldFail(() => Atomics.store(a, idx, 0), RangeError); - shouldFail(() => Atomics.sub(a, idx, 0), RangeError); - shouldFail(() => Atomics.xor(a, idx, 0), RangeError); - } - shouldFail(() => Atomics.wait(i32a, idx, 0), RangeError); - shouldFail(() => Atomics.wake(i32a, idx, 0), RangeError); -} - -function runAtomic(array, index, init, name, args, expectedResult, expectedOutcome) -{ - array[index] = init; - var result = Atomics[name](array, index, ...args); - if (result != expectedResult) - throw new Error("Expected Atomics." + name + "(array, " + index + ", " + args.join(", ") + ") to return " + expectedResult + " but returned " + result + " for " + Object.prototype.toString.apply(array)); - if (array[index] !== expectedOutcome) - throw new Error("Expected Atomics." + name + "(array, " + index + ", " + args.join(", ") + ") to result in array[" + index + "] = " + expectedOutcome + " but got " + array[index] + " for " + Object.prototype.toString.apply(array)); -} - -for (a of [i8a, i16a, i32a, u8a, u16a, u32a]) { - runAtomic(a, 0, 13, "add", [42], 13, 55); - runAtomic(a, 0, 13, "and", [42], 13, 8); - runAtomic(a, 0, 13, "compareExchange", [25, 42], 13, 13); - runAtomic(a, 0, 13, "compareExchange", [13, 42], 13, 42); - runAtomic(a, 0, 13, "exchange", [42], 13, 42); - runAtomic(a, 0, 13, "load", [], 13, 13); - runAtomic(a, 0, 13, "or", [42], 13, 47); - runAtomic(a, 0, 13, "store", [42], 42, 42); - runAtomic(a, 0, 42, "sub", [13], 42, 29); - runAtomic(a, 0, 13, "xor", [42], 13, 39); -} - -i32a[0] = 0; -var result = Atomics.wait(i32a, 0, 1); -if (result != "not-equal") - throw "Error: bad result from Atomics.wait: " + result; -for (timeout of [0, 1, 10]) { - var result = Atomics.wait(i32a, 0, 0, timeout); - if (result != "timed-out") - throw "Error: bad result from Atomics.wait: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/activation-sink-default-value-tdz-error.js b/implementation-contributed/javascriptcore/stress/activation-sink-default-value-tdz-error.js deleted file mode 100644 index cc8b280671..0000000000 --- a/implementation-contributed/javascriptcore/stress/activation-sink-default-value-tdz-error.js +++ /dev/null @@ -1,45 +0,0 @@ -//@ skip if $buildType == "debug" -"use strict"; - -var n = 10000000; - -function shouldThrowTDZ(func) { - var hasThrown = false; - try { - func(); - } catch(e) { - if (e.name.indexOf("ReferenceError") !== -1) - hasThrown = true; - } - if (!hasThrown) - throw new Error("Did not throw TDZ error"); -} -noInline(shouldThrowTDZ); - -function bar(f) { f(10); } - -function foo(b) { - let result = 0; - var set = function (x) { result = x; } - var cap = function() { return tdzPerpetrator; } - if (b) { - bar(set); - return tdzPerpetrator; - } - let tdzPerpetrator; - return result; -} - -noInline(bar); -noInline(foo); - -for (var i = 0; i < n; i++) { - var bool = !(i % 100); - if (bool) - shouldThrowTDZ(function() { foo(bool); }); - else { - var result = foo(bool); - if (result != 0) - throw "Error: bad result: " + result; - } -} diff --git a/implementation-contributed/javascriptcore/stress/activation-sink-default-value.js b/implementation-contributed/javascriptcore/stress/activation-sink-default-value.js deleted file mode 100644 index 0e660d5bcd..0000000000 --- a/implementation-contributed/javascriptcore/stress/activation-sink-default-value.js +++ /dev/null @@ -1,31 +0,0 @@ -var n = 10000000; - -function bar(f) { f(10); } - -function foo(b) { - var result = 0; - var imUndefined; - var baz; - var set = function (x) { result = x; return (imUndefined, baz); } - baz = 40; - if (b) { - bar(set); - if (result != 10) - throw "Error: bad: " + result; - if (baz !== 40) - throw "Error: bad: " + baz; - if (imUndefined !== void 0) - throw "Error: bad value: " + imUndefined; - return 0; - } - return result; -} - -noInline(bar); -noInline(foo); - -for (var i = 0; i < n; i++) { - var result = foo(!(i % 100)); - if (result != 0) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/activation-sink-osrexit-default-value-tdz-error.js b/implementation-contributed/javascriptcore/stress/activation-sink-osrexit-default-value-tdz-error.js deleted file mode 100644 index 9df1bd109e..0000000000 --- a/implementation-contributed/javascriptcore/stress/activation-sink-osrexit-default-value-tdz-error.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; - -var n = 10000000; - -function shouldThrowTDZ(func) { - var hasThrown = false; - try { - func(); - } catch(e) { - if (e.name.indexOf("ReferenceError") !== -1) - hasThrown = true; - } - if (!hasThrown) - throw new Error("Did not throw TDZ error"); -} - -function bar(f) { } - -function foo(b) { - let result = 0; - var set = function (x) { result = x; return tdzPerpetrator; } - if (b) { - OSRExit(); - if (b) { - bar(set); - return tdzPerpetrator; - } - } - let tdzPerpetrator; - return result; -} - -noInline(bar); -noInline(foo); -noInline(shouldThrowTDZ); - -for (var i = 0; i < n; i++) { - var bool = !(i % 100); - if (bool) - shouldThrowTDZ(function() { foo(bool); }); - else { - var result = foo(bool); - if (result != 0) - throw "Error: bad result: " + result; - } -} diff --git a/implementation-contributed/javascriptcore/stress/activation-sink-osrexit-default-value.js b/implementation-contributed/javascriptcore/stress/activation-sink-osrexit-default-value.js deleted file mode 100644 index 85e9dbc32e..0000000000 --- a/implementation-contributed/javascriptcore/stress/activation-sink-osrexit-default-value.js +++ /dev/null @@ -1,37 +0,0 @@ -var n = 10000000; - -function bar(set) { - var result = set(0); - if (result !== void 0) - throw "Error: bad value: " + result; -} - -function foo(b) { - var result = 0; - var imUndefined; - var baz; - var set = function (x) { - result = x; - if (baz !== 50) - throw "Error: bad value: " + baz; - return imUndefined; - } - baz = 50; - if (b) { - OSRExit(); - if (b) { - bar(set); - } - return 0; - } - return result; -} - -noInline(bar); -noInline(foo); - -for (var i = 0; i < n; i++) { - var result = foo(!(i % 100)); - if (result != 0) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/activation-sink-osrexit.js b/implementation-contributed/javascriptcore/stress/activation-sink-osrexit.js deleted file mode 100644 index 9d3c4d36bc..0000000000 --- a/implementation-contributed/javascriptcore/stress/activation-sink-osrexit.js +++ /dev/null @@ -1,25 +0,0 @@ -var n = 10000000; - -function bar() { } - -function foo(b) { - var result = 0; - var set = function (x) { result = x; } - if (b) { - OSRExit(); - if (b) { - bar(set); - } - return 0; - } - return result; -} - -noInline(bar); -noInline(foo); - -for (var i = 0; i < n; i++) { - var result = foo(!(i % 100)); - if (result != 0) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/activation-sink.js b/implementation-contributed/javascriptcore/stress/activation-sink.js deleted file mode 100644 index bf00022cdb..0000000000 --- a/implementation-contributed/javascriptcore/stress/activation-sink.js +++ /dev/null @@ -1,24 +0,0 @@ -var n = 10000000; - -function bar(f) { f(10); } - -function foo(b) { - var result = 0; - var set = function (x) { result = x; } - if (b) { - bar(set); - if (result != 10) - throw "Error: bad: " + result; - return 0; - } - return result; -} - -noInline(bar); -noInline(foo); - -for (var i = 0; i < n; i++) { - var result = foo(!(i % 100)); - if (result != 0) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/activation-test-loop.js b/implementation-contributed/javascriptcore/stress/activation-test-loop.js deleted file mode 100644 index a640834c64..0000000000 --- a/implementation-contributed/javascriptcore/stress/activation-test-loop.js +++ /dev/null @@ -1,24 +0,0 @@ -function Inner() { - this.i = 0; - this.doStuff = function() { - this.i++; - if (this.i > 10000) - this.isDone(); - } -} - -var foo = function() { - var inner = new Inner(); - var done = false; - inner.isDone = function() { - done = true; - } - - while (true) { - var val = inner.doStuff(); - if (done) - break; - } -} - -foo(); diff --git a/implementation-contributed/javascriptcore/stress/add-constant-overflow-recovery.js b/implementation-contributed/javascriptcore/stress/add-constant-overflow-recovery.js deleted file mode 100644 index 24bb2cbe3c..0000000000 --- a/implementation-contributed/javascriptcore/stress/add-constant-overflow-recovery.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo(a) { - return a.f + 2000000000; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo({f:1}); - if (result != 2000000001) - throw "Error: bad result: " + result; -} - -var result = foo({f:2000000000}); -if (result != 4000000000) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/add-inferred-type-table-to-existing-structure.js b/implementation-contributed/javascriptcore/stress/add-inferred-type-table-to-existing-structure.js deleted file mode 100644 index 9ad5a2d599..0000000000 --- a/implementation-contributed/javascriptcore/stress/add-inferred-type-table-to-existing-structure.js +++ /dev/null @@ -1,31 +0,0 @@ -function foo(o) { - return o.f + 1; -} - -function bar(o, i, v) { - o[i] = v; -} - -function baz() { - return {}; -} - -noInline(foo); -noInline(bar); -noInline(baz); - -var o0 = baz(); -bar(o0, "f", "hello"); - -for (var i = 0; i < 10000; ++i) { - var o = baz(); - o.f = 42; - var result = foo(o); - if (result != 43) - throw "Error: bad result in loop: " + result; -} - -var result = foo(o0); -if (result != "hello1") - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/add-int52-constant-overflow-recovery.js b/implementation-contributed/javascriptcore/stress/add-int52-constant-overflow-recovery.js deleted file mode 100644 index 7548d34fc1..0000000000 --- a/implementation-contributed/javascriptcore/stress/add-int52-constant-overflow-recovery.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo(a) { - return a * 2097144 + 1073745920; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(1073736383); - if (result != 2251780886936072) - throw "Error: bad result: " + result; -} - -var result = foo(1073745919); -if (result != 2251800885301256) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/add-int52-large-constant-overflow-recovery.js b/implementation-contributed/javascriptcore/stress/add-int52-large-constant-overflow-recovery.js deleted file mode 100644 index c64bc3fe52..0000000000 --- a/implementation-contributed/javascriptcore/stress/add-int52-large-constant-overflow-recovery.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo(a) { - return a * 2097144 + 10000000000; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(1073741151); - if (result != 2251799812372744) - throw "Error: bad result: " + result; -} - -var result = foo(1073741152); -if (result != 2251799814469888) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/add-overflow-recovery.js b/implementation-contributed/javascriptcore/stress/add-overflow-recovery.js deleted file mode 100644 index 8e1718c5c2..0000000000 --- a/implementation-contributed/javascriptcore/stress/add-overflow-recovery.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo(a, b) { - return a.f + b.f; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo({f:1}, {f:2}); - if (result != 3) - throw "Error: bad result: " + result; -} - -var result = foo({f:2000000000}, {f:2000000000}); -if (result != 4000000000) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/add-overflows-after-not-equal.js b/implementation-contributed/javascriptcore/stress/add-overflows-after-not-equal.js deleted file mode 100644 index 181566fcf4..0000000000 --- a/implementation-contributed/javascriptcore/stress/add-overflows-after-not-equal.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a) { - if (a != 0) - return a + 1; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(42); - if (result != 43) - throw "Error: bad result in loop: " + result; -} - -var result = foo(2147483647); -if (result != 2147483648) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/add-small-constant-overflow-recovery.js b/implementation-contributed/javascriptcore/stress/add-small-constant-overflow-recovery.js deleted file mode 100644 index 64d9f04f68..0000000000 --- a/implementation-contributed/javascriptcore/stress/add-small-constant-overflow-recovery.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo(a) { - return a.f + 1000; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo({f:1}); - if (result != 1001) - throw "Error: bad result: " + result; -} - -var result = foo({f:2147483148}); -if (result != 2147484148) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/ai-consistency-filter-cells.js b/implementation-contributed/javascriptcore/stress/ai-consistency-filter-cells.js deleted file mode 100644 index ce2fab6f61..0000000000 --- a/implementation-contributed/javascriptcore/stress/ai-consistency-filter-cells.js +++ /dev/null @@ -1,30 +0,0 @@ -function get(value, prop) { return value[prop]; } -noInline(get); - -function foo(record, key, attribute) { - var attrs = get(this, 'attrs'); - var value = get(record, key), type = attribute.type; - - if (type) { - var transform = this.transformFor(type); - value = transform.serialize(value); - } - - key = attrs && attrs[key] || (this.keyForAttribute ? this.keyForAttribute(key) : key); - - return {key:key, value:value}; -} -noInline(foo); - -let i = 0; -let thisValue = {transformFor: function() { return {serialize: function() { return {} }}}}; -let record = {key: "hello"}; -let record2 = {key: true}; -let key = "key"; -let attribute = {type: "type"}; -for (; i < 100000; i++) { - if (i % 2 === 0) - foo.call(thisValue, record, key, attribute); - else - foo.call(thisValue, record2, key, attribute); -} diff --git a/implementation-contributed/javascriptcore/stress/ai-create-this-to-new-object-fire.js b/implementation-contributed/javascriptcore/stress/ai-create-this-to-new-object-fire.js deleted file mode 100644 index 5adf00862b..0000000000 --- a/implementation-contributed/javascriptcore/stress/ai-create-this-to-new-object-fire.js +++ /dev/null @@ -1,61 +0,0 @@ -function assert(b, m = "Bad!") { - if (!b) { - throw new Error(m); - } -} - -function test(f, iters = 1000) { - for (let i = 0; i < iters; i++) - f(i); -} - -function func(x) { - return x; -} -noInline(func); - -var n = 2; -var prototype = {}; -function prep(index, i, A, B) -{ - if (index === (n - 1) && i === 5000) { - // Fire watchpoint! - A.prototype = prototype; - } -} - -function check(index, arr, A, B, originalPrototype) -{ - if (index === (n - 1)) { - assert(originalPrototype !== prototype); - for (let i = 0; i < 5000; i++) - assert(arr[i].__proto__ === originalPrototype); - for (let i = 5000; i < 10000; i++) - assert(arr[i].__proto__ === prototype); - } else { - for (let i = 0; i < 10000; i++) - assert(arr[i].__proto__ === originalPrototype); - } -} -noInline(check); - -test(function body(index) { - function A(x, f = func) { - this._value = x; - this._func = f; - } - - function B(n) - { - return new A(n); - } - - var originalPrototype = A.prototype; - let arr = []; - for (let i = 0; i < 10000; i++) { - prep(index, i, A, B); - arr.push(B(20)); - } - - check(index, arr, A, B, originalPrototype); -}, n); diff --git a/implementation-contributed/javascriptcore/stress/ai-create-this-to-new-object.js b/implementation-contributed/javascriptcore/stress/ai-create-this-to-new-object.js deleted file mode 100644 index c89fb1884e..0000000000 --- a/implementation-contributed/javascriptcore/stress/ai-create-this-to-new-object.js +++ /dev/null @@ -1,41 +0,0 @@ -function assert(b, m = "Bad!") { - if (!b) { - throw new Error(m); - } -} - -function test(f, iters = 1000) { - for (let i = 0; i < iters; i++) - f(i); -} - -function func(x) { - return x; -} -noInline(func); - -function check(index, arr, B) -{ - for (let i = 0; i < 1000; i++) - assert(arr[i] instanceof B); -} -noInline(check); - -test(function body(index) { - class A { - constructor(x, f = func) - { - this._value = x; - this._func = f; - } - } - - class B extends A { - } - - let arr = []; - for (let i = 0; i < 1000; i++) - arr.push(new B(20)); - - check(index, arr, B); -}, 8); diff --git a/implementation-contributed/javascriptcore/stress/ai-needs-to-model-spreads-effects.js b/implementation-contributed/javascriptcore/stress/ai-needs-to-model-spreads-effects.js deleted file mode 100644 index 71e3c7008f..0000000000 --- a/implementation-contributed/javascriptcore/stress/ai-needs-to-model-spreads-effects.js +++ /dev/null @@ -1,33 +0,0 @@ -try { - var ary_1 = [1.1,2.2,3.3] - var ary_2 = [1.1,2.2,3.3] - var ary_3 = [1.1,2.2,3.3] - ary_3['www'] = 1 - var f64_1 = new Float64Array(0x10) - f64_1['0x7a'] = 0xffffffff - - var flag = 0; - var p = {"a":{}}; - p[Symbol.iterator] = function* () { - if (flag == 1) { - ary_2[0] = {} - } - yield 1; - yield 2; - }; - var go = function(a,b,c){ - a[0] = 1.1; - a[1] = 2.2; - [...c]; - b[0] = a[0]; - a[2] = 2.3023e-320 - } - - for (var i = 0; i < 0x100000; i++) { - go(ary_1, f64_1, p) - } - - flag = 1; - - go(ary_2, f64_1, p); -} catch(e) { } diff --git a/implementation-contributed/javascriptcore/stress/allocation-sinking-defs-may-have-replacements.js b/implementation-contributed/javascriptcore/stress/allocation-sinking-defs-may-have-replacements.js deleted file mode 100644 index 1437107ebf..0000000000 --- a/implementation-contributed/javascriptcore/stress/allocation-sinking-defs-may-have-replacements.js +++ /dev/null @@ -1,31 +0,0 @@ -function dontCSE() { } -noInline(dontCSE); - -function assert(b) { - if (!b) - throw new Error("Bad assertion"); -} -noInline(assert); - -function foo(a1) { - let o1 = {x: 20, y: 50}; - let o2 = {y: 40, o1: o1}; - let o3 = {}; - - o3.field = o1.y; - - dontCSE(); - - if (a1) { - a1 = true; - } else { - a1 = false; - } - - let value = o3.field; - assert(value === 50); -} -noInline(foo); - -for (let i = 0; i < 100000; i++) - foo(i); diff --git a/implementation-contributed/javascriptcore/stress/allocation-sinking-new-object-with-poly-proto.js b/implementation-contributed/javascriptcore/stress/allocation-sinking-new-object-with-poly-proto.js deleted file mode 100644 index eea3040fa8..0000000000 --- a/implementation-contributed/javascriptcore/stress/allocation-sinking-new-object-with-poly-proto.js +++ /dev/null @@ -1,53 +0,0 @@ -function foo() { - class A { - constructor() { - } - }; - return A; -} -let A = foo(); -let B = foo(); - -function makePolyProto(o) { - return o.x; -} -noInline(makePolyProto); - -for (let i = 0; i < 1000; ++i) { - makePolyProto(i % 2 ? new A : new B); -} - -function bar(b) { - let o = new A; - if (b) { - if (isFinalTier()) - OSRExit(); - return o; - } -} -noInline(bar); - -function baz(b) { - let o = new A; - if (b) - return o; -} -noInline(baz); - -for (let i = 0; i < 100000; ++i) { - let b = i % 10 === 0; - let r = bar(b); - if (b) { - if (r.__proto__ !== A.prototype) - throw new Error("Bad!"); - } -} - -for (let i = 0; i < 100000; ++i) { - let b = i % 10 === 0; - let r = baz(b); - if (b) { - if (r.__proto__ !== A.prototype) - throw new Error("Bad!"); - } -} diff --git a/implementation-contributed/javascriptcore/stress/allocation-sinking-puthint-control-flow.js b/implementation-contributed/javascriptcore/stress/allocation-sinking-puthint-control-flow.js deleted file mode 100644 index 7d01461c88..0000000000 --- a/implementation-contributed/javascriptcore/stress/allocation-sinking-puthint-control-flow.js +++ /dev/null @@ -1,41 +0,0 @@ -function e() { } -noInline(e); - -function foo(b, c, d) { - let x; - function bar() { return x; } - if (b) { - let y = function() { return x; } - } else { - let y = function() { return x; } - } - - if (c) { - function baz() { } - if (b) { - let y = function() { return x; } - e(y); - } else { - let y = function() { return x; } - e(y); - } - if (d) - d(); - e(baz); - } - -} -noInline(foo); - -for (let i = 0; i < 100000; i++) { - foo(!!(i % 2), true, false); -} - -let threw = false; -try { - foo(true, true, true); -} catch(e) { - threw = true; -} -if (!threw) - throw new Error("Bad test") diff --git a/implementation-contributed/javascriptcore/stress/always-enter-dictionary-indexing-mode-with-getter.js b/implementation-contributed/javascriptcore/stress/always-enter-dictionary-indexing-mode-with-getter.js deleted file mode 100644 index 3cc7c366ea..0000000000 --- a/implementation-contributed/javascriptcore/stress/always-enter-dictionary-indexing-mode-with-getter.js +++ /dev/null @@ -1,29 +0,0 @@ -function test1(item) { - var o = { - 10000: item, - get 10005() { }, - }; - let arr = new Array(10008); - for (let key of arr.keys()) { - let o2 = {}; - o[key] = o2; - } -} -test1({}); -test1(10); -test1(10.5); - -function test2(item) { - var o = { - 0: item, - get 1000() { }, - }; - let arr = new Array(1000); - for (let key of arr.keys()) { - let o2 = {}; - o[key] = o2; - } -} -test2({}); -test2(10); -test2(10.5); diff --git a/implementation-contributed/javascriptcore/stress/any-int-as-double-add.js b/implementation-contributed/javascriptcore/stress/any-int-as-double-add.js deleted file mode 100644 index 98e9da7079..0000000000 --- a/implementation-contributed/javascriptcore/stress/any-int-as-double-add.js +++ /dev/null @@ -1,43 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var array = []; - -for (var i = 0; i < 100; ++i) - array.push(1024 * 1024 * 1024 * 1024 + i); -for (var i = 0; i < 100; ++i) - array.push(-(1024 * 1024 * 1024 * 1024 + i)); - -array.push(2251799813685248); -array.push(0.5); - -function test(array, index, value) -{ - return array[index] + fiatInt52(value); -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) { - for (var index = 0; index < 100; ++index) - shouldBe(test(array, index, 20), 1024 * 1024 * 1024 * 1024 + index + 20); - for (var index = 0; index < 100; ++index) - shouldBe(test(array, index + 100, 20), -(1024 * 1024 * 1024 * 1024 + index) + 20); -} - -// Int52Overflow. -shouldBe(test(array, 200, 200), 2251799813685448); - -// Not AnyIntAsDouble, Int52Overflow. -shouldBe(test(array, 201, 200), 200.5); - -// Recompile the code as ArithAdd(Double, Double). -for (var i = 0; i < 1e4; ++i) - shouldBe(test(array, 201, 200), 200.5); - -shouldBe(test(array, 200, 200), 2251799813685448); -shouldBe(test(array, 201, 200), 200.5); - - diff --git a/implementation-contributed/javascriptcore/stress/arguments-callee-uninitialized.js b/implementation-contributed/javascriptcore/stress/arguments-callee-uninitialized.js deleted file mode 100644 index 68650423ed..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-callee-uninitialized.js +++ /dev/null @@ -1,11 +0,0 @@ -function foo(e) { - if (e) { - arguments[0]--; - return arguments.callee.apply(this, arguments); - } -} -noInline(foo); - -for (var i = 0; i < 10000; i++) - foo(1); - diff --git a/implementation-contributed/javascriptcore/stress/arguments-captured.js b/implementation-contributed/javascriptcore/stress/arguments-captured.js deleted file mode 100644 index 0b1e1ab062..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-captured.js +++ /dev/null @@ -1,23 +0,0 @@ -function foo(o) { - o[0] = 42; -} - -function bar(a) { - var o = {}; - o.f = a; - foo(arguments); - o.g = a; - return o; -} - -noInline(foo); -noInline(bar); - -for (var i = 0; i < 1000; ++i) { - var result = bar(i); - if (result.f != i) - throw "Error: bad value of f: " + result.f; - if (result.g != 42) - throw "Error: bad value of g: " + result.g; -} - diff --git a/implementation-contributed/javascriptcore/stress/arguments-copy-register-array-backing-store.js b/implementation-contributed/javascriptcore/stress/arguments-copy-register-array-backing-store.js deleted file mode 100644 index 1e64f7b460..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-copy-register-array-backing-store.js +++ /dev/null @@ -1,32 +0,0 @@ -var foo = function(o) { - return arguments; -}; - -var bar = function() { - var a = Array.prototype.slice.call(arguments); - var sum = 0; - for (var i = 0; i < a.length; ++i) - sum += a[i]; - return sum; -}; - -var args = foo({}, 1, 2, 3); -var expectedArgs = Array.prototype.slice.call(args); - -edenGC(); - -var expectedResult = 0; -var result = 0; -for (var i = 0; i < 10000; ++i) { - expectedResult += i + i + 1 + i + 2; - result += bar(i, i + 1, i + 2); -} - -if (result != expectedResult) - throw new Error("Incorrect result: " + result + " != " + expectedResult); - -for (var i = 0; i < expectedArgs.length; ++i) { - if (args[i] !== expectedArgs[i]) - throw new Error("Incorrect arg result"); -} - diff --git a/implementation-contributed/javascriptcore/stress/arguments-custom-properties-gc.js b/implementation-contributed/javascriptcore/stress/arguments-custom-properties-gc.js deleted file mode 100644 index 86e44d5fa7..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-custom-properties-gc.js +++ /dev/null @@ -1,36 +0,0 @@ -function makeBaseArguments() { - return arguments; -} - -noInline(makeBaseArguments); - -function makeArray(length) { - var array = new Array(length); - for (var i = 0; i < length; ++i) - array[i] = 99999; - return array; -} - -noInline(makeArray); - -function cons(f) { - var result = makeBaseArguments(); - result.f = f; - return result; -} - -var array = []; -for (var i = 0; i < 100000; ++i) - array.push(cons(i)); - -for (var i = 0; i < 1000000; ++i) { - var j = (i * 3) % array.length; - array[j] = cons(j); - - makeArray(i % 7); -} - -for (var i = 0; i < array.length; ++i) { - if (array[i].f != i) - throw "Error: bad value of f at " + i + ": " + array[i].f; -} diff --git a/implementation-contributed/javascriptcore/stress/arguments-define-property.js b/implementation-contributed/javascriptcore/stress/arguments-define-property.js deleted file mode 100644 index b8d9ba8489..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-define-property.js +++ /dev/null @@ -1,34 +0,0 @@ -function assert(a) { - if (!a) - throw Error("Bad assertion!"); -} - -function testProperties(o, initProperty, testProperty, shouldThrow) { - Object.defineProperty(arguments, 0, initProperty); - - if (shouldThrow) { - try { - Object.defineProperty(arguments, 0, testProperty); - assert(false); - } catch(e) { - assert(e instanceof TypeError); - } - } else { - assert(Object.defineProperty(arguments, 0, testProperty)); - } -} - -testProperties("foo", {configurable: false}, {writable: true}, false); -testProperties("foo", {configurable: false}, {configurable: true}, true); -testProperties("foo", {configurable: false, enumareble: true}, {enumerable: false}, true); -testProperties("foo", {configurable: false, writable: false}, {writable: false}, false); -testProperties("foo", {configurable: false, writable: false}, {writable: true}, true); -testProperties("foo", {configurable: false, writable: false, value: 50}, {value: 30}, true); -testProperties("foo", {configurable: false, writable: false, value: 30}, {value: 30}, false); -testProperties("foo", {configurable: false, get: () => {return 0}}, {get: () => {return 10}}, true); -let getterFoo = () => {return 0}; -testProperties("foo", {configurable: false, get: getterFoo}, {get: getterFoo}, false); -testProperties("foo", {configurable: false, set: (x) => {return 0}}, {get: (x) => {return 10}}, true); -let setterFoo = (x) => {return 0}; -testProperties("foo", {configurable: false, set: setterFoo}, {set: setterFoo}, false); - diff --git a/implementation-contributed/javascriptcore/stress/arguments-elimination-candidate-listings-should-respect-pseudo-terminals.js b/implementation-contributed/javascriptcore/stress/arguments-elimination-candidate-listings-should-respect-pseudo-terminals.js deleted file mode 100644 index b3e675f469..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-elimination-candidate-listings-should-respect-pseudo-terminals.js +++ /dev/null @@ -1,28 +0,0 @@ -var index = 0; -function sideEffect() -{ - return index++ === 0; -} -noInline(sideEffect); - -function args(flag) -{ - var a = arguments; - if (flag) { - return a[4] + a[5]; - } - return a.length; -} - -function test(flag) -{ - args(flag, 0, 1, 2); - if (sideEffect()) { - OSRExit(); - args(sideEffect(), 0, 1, 2); - } -} -noInline(test); - -for (var i = 0; i < 1e3; ++i) - test(false); diff --git a/implementation-contributed/javascriptcore/stress/arguments-elimination-force-exit.js b/implementation-contributed/javascriptcore/stress/arguments-elimination-force-exit.js deleted file mode 100644 index a50b46a9f6..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-elimination-force-exit.js +++ /dev/null @@ -1,29 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function strict(flag) -{ - "use strict"; - if (flag) - return arguments.length + 42; - return arguments.length; -} -noInline(strict); - -function sloppy(flag) -{ - if (flag) - return arguments.length + 42; - return arguments.length; -} -noInline(sloppy); - -for (var i = 0; i < 1e6; ++i) { - shouldBe(strict(false), 1); - shouldBe(sloppy(false), 1); -} -shouldBe(strict(true), 43); -shouldBe(sloppy(true), 43); diff --git a/implementation-contributed/javascriptcore/stress/arguments-elimination-throw.js b/implementation-contributed/javascriptcore/stress/arguments-elimination-throw.js deleted file mode 100644 index 3b5119a9de..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-elimination-throw.js +++ /dev/null @@ -1,51 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorCondition) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (!errorCondition(error)) - throw new Error(`bad error: ${String(error)}`); -} - -function strict(flag) -{ - "use strict"; - if (flag) - throw arguments; - return arguments.length; -} -noInline(strict); - -function sloppy(flag) -{ - if (flag) - throw arguments; - return arguments.length; -} -noInline(sloppy); - -for (var i = 0; i < 1e6; ++i) { - shouldBe(strict(false), 1); - shouldBe(sloppy(false), 1); -} -function isArguments(arg) -{ - shouldBe(String(arg), `[object Arguments]`); - shouldBe(arg.length, 1); - shouldBe(arg[0], true); - return true; -} -shouldThrow(() => strict(true), isArguments); -shouldThrow(() => sloppy(true), isArguments); diff --git a/implementation-contributed/javascriptcore/stress/arguments-elimination-varargs-too-many-args-arg-count.js b/implementation-contributed/javascriptcore/stress/arguments-elimination-varargs-too-many-args-arg-count.js deleted file mode 100644 index c2b6859551..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-elimination-varargs-too-many-args-arg-count.js +++ /dev/null @@ -1,30 +0,0 @@ -function foo() -{ - return arguments.length; -} - -function bar(...args) -{ - var a = [42]; - if (isFinalTier()) - a = args; - return {ftl: isFinalTier(), result: foo(...a)}; -} - -function baz() -{ - return bar(1, 2, 3, 4); -} - -noInline(baz); - -for (var i = 0; i < 100000; ++i) { - var result = baz(); - if (result.ftl) { - if (result.result != 4) - throw "Error: bad result in loop in DFG: " + result.result; - } else { - if (result.result != 1) - throw "Error: bad result in loop before DFG: " + result.result; - } -} diff --git a/implementation-contributed/javascriptcore/stress/arguments-exit-fixed.js b/implementation-contributed/javascriptcore/stress/arguments-exit-fixed.js deleted file mode 100644 index 4d107a8d21..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-exit-fixed.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(x) { - var tmp = x.f + 1; - return tmp + arguments[0].f; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo({f:i}); - if (result != i + i + 1) - throw "Error: bad result: " + result; -} - -var result = foo({f:4.5}); -if (result != 4.5 + 4.5 + 1) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/arguments-exit-strict-mode-fixed.js b/implementation-contributed/javascriptcore/stress/arguments-exit-strict-mode-fixed.js deleted file mode 100644 index fa816f2eb3..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-exit-strict-mode-fixed.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; - -function foo(x) { - var tmp = x.f + 1; - return tmp + arguments[0].f; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo({f:i}); - if (result != i + i + 1) - throw "Error: bad result: " + result; -} - -var result = foo({f:4.5}); -if (result != 4.5 + 4.5 + 1) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/arguments-exit-strict-mode.js b/implementation-contributed/javascriptcore/stress/arguments-exit-strict-mode.js deleted file mode 100644 index 04c714ee00..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-exit-strict-mode.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; - -function foo(x) { - var tmp = x + 1; - return tmp + arguments[0]; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(i); - if (result != i + i + 1) - throw "Error: bad result: " + result; -} - -var result = foo(4.5); -if (result != 4.5 + 4.5 + 1) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/arguments-exit.js b/implementation-contributed/javascriptcore/stress/arguments-exit.js deleted file mode 100644 index 8580820c74..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-exit.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(x) { - var tmp = x + 1; - return tmp + arguments[0]; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(i); - if (result != i + i + 1) - throw "Error: bad result: " + result; -} - -var result = foo(4.5); -if (result != 4.5 + 4.5 + 1) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/arguments-inlined-exit-strict-mode-fixed.js b/implementation-contributed/javascriptcore/stress/arguments-inlined-exit-strict-mode-fixed.js deleted file mode 100644 index d08251f18b..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-inlined-exit-strict-mode-fixed.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; - -function foo(x) { - var tmp = x.f + 1; - return tmp + arguments[0].f; -} - -function bar(x) { - return foo(x); -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var result = bar({f:i}); - if (result != i + i + 1) - throw "Error: bad result: " + result; -} - -var result = bar({f:4.5}); -if (result != 4.5 + 4.5 + 1) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/arguments-inlined-exit-strict-mode.js b/implementation-contributed/javascriptcore/stress/arguments-inlined-exit-strict-mode.js deleted file mode 100644 index 748251d1f5..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-inlined-exit-strict-mode.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; - -function foo(x) { - var tmp = x + 1; - return tmp + arguments[0]; -} - -function bar(x) { - return foo(x); -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var result = bar(i); - if (result != i + i + 1) - throw "Error: bad result: " + result; -} - -var result = bar(4.5); -if (result != 4.5 + 4.5 + 1) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/arguments-inlined-exit.js b/implementation-contributed/javascriptcore/stress/arguments-inlined-exit.js deleted file mode 100644 index 43470d9336..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-inlined-exit.js +++ /dev/null @@ -1,20 +0,0 @@ -function foo(x) { - var tmp = x + 1; - return tmp + arguments[0]; -} - -function bar(x) { - return foo(x); -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var result = bar(i); - if (result != i + i + 1) - throw "Error: bad result: " + result; -} - -var result = bar(4.5); -if (result != 4.5 + 4.5 + 1) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/arguments-interference-cfg.js b/implementation-contributed/javascriptcore/stress/arguments-interference-cfg.js deleted file mode 100644 index 6904160d0f..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-interference-cfg.js +++ /dev/null @@ -1,24 +0,0 @@ -function bar() { - return arguments; -} - -function foo(p) { - var a = bar(1, 2, 3); - var b; - if (p) - b = bar(4, 5, 6); - else - b = [7, 8, 9]; - return (a[0] << 0) + (a[1] << 1) + (a[2] << 2) + (b[0] << 3) + (b[1] << 4) + (b[2] << 5); -} - -noInline(foo); - -for (var i = 0; i < 20000; ++i) { - var p = i & 1; - var q = (!p) * 3; - var result = foo(p); - if (result != (1 << 0) + (2 << 1) + (3 << 2) + ((4 + q) << 3) + ((5 + q) << 4) + ((6 + q) << 5)) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/arguments-interference.js b/implementation-contributed/javascriptcore/stress/arguments-interference.js deleted file mode 100644 index d66f365b1b..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-interference.js +++ /dev/null @@ -1,18 +0,0 @@ -function bar() { - return arguments; -} - -function foo() { - var a = bar(1, 2, 3); - var b = bar(4, 5, 6); - return (a[0] << 0) + (a[1] << 1) + (a[2] << 2) + (b[0] << 3) + (b[1] << 4) + (b[2] << 5); -} - -noInline(foo); - -for (var i = 0; i < 20000; ++i) { - var result = foo(); - if (result != (1 << 0) + (2 << 1) + (3 << 2) + (4 << 3) + (5 << 4) + (6 << 5)) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/arguments-iterator.js b/implementation-contributed/javascriptcore/stress/arguments-iterator.js deleted file mode 100644 index 1980532107..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-iterator.js +++ /dev/null @@ -1,70 +0,0 @@ -function test(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testArguments(check) { - (function () { - check(arguments, []); - }()); - - (function (a, b, c) { - check(arguments, [a, b, c]); - }()); - - (function () { - 'use strict'; - check(arguments, []); - }()); - - (function (a, b, c) { - 'use strict'; - check(arguments, [a, b, c]); - }()); -} - -testArguments(function (args) { - var iteratorMethod = args[Symbol.iterator]; - test(iteratorMethod, Array.prototype.values); - var descriptor = Object.getOwnPropertyDescriptor(args, Symbol.iterator); - test(descriptor.writable, true); - test(descriptor.configurable, true); - test(descriptor.enumerable, false); - test(descriptor.value, iteratorMethod); -}); - -testArguments(function (args, expected) { - var iterator = args[Symbol.iterator](); - test(iterator.toString(), '[object Array Iterator]'); - var index = 0; - for (var value of iterator) { - test(value, expected[index++]); - } - test(args.length, index); - - var index = 0; - for (var value of args) { - test(value, expected[index++]); - } - test(args.length, index); -}); - -testArguments(function (args) { - var symbols = Object.getOwnPropertySymbols(args); - test(symbols.length, 1); - test(symbols[0], Symbol.iterator); -}); - -testArguments(function (args) { - 'use strict'; - args[Symbol.iterator] = 'not throw error'; -}); - -testArguments(function (args) { - 'use strict'; - delete args[Symbol.iterator]; - test(args[Symbol.iterator], undefined); - - var symbols = Object.getOwnPropertySymbols(args); - test(symbols.length, 0); -}); diff --git a/implementation-contributed/javascriptcore/stress/arguments-length-always-dont-enum.js b/implementation-contributed/javascriptcore/stress/arguments-length-always-dont-enum.js deleted file mode 100644 index c63c16686e..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-length-always-dont-enum.js +++ /dev/null @@ -1,15 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - - -var argsSloppy = (function () { return arguments; }(1,2,3)); -var argsStrict = (function () { 'use strict'; return arguments; }(1,2,3)); - -shouldBe(Object.prototype.propertyIsEnumerable(argsSloppy, 'length'), false); -shouldBe(Object.prototype.propertyIsEnumerable(argsStrict, 'length'), false); - -shouldBe(Object.keys(argsSloppy).length === Object.keys(argsStrict).length, true); -shouldBe(Object.keys(argsSloppy).indexOf('length'), -1) -shouldBe(Object.keys(argsStrict).indexOf('length'), -1); diff --git a/implementation-contributed/javascriptcore/stress/arguments-non-configurable.js b/implementation-contributed/javascriptcore/stress/arguments-non-configurable.js deleted file mode 100644 index c5a055fcc8..0000000000 --- a/implementation-contributed/javascriptcore/stress/arguments-non-configurable.js +++ /dev/null @@ -1,27 +0,0 @@ -function assert(a) { - if (!a) - throw Error("Bad assertion!"); -} - -function tryChangeNonConfigurableDescriptor(x) { - Object.defineProperty(arguments, 0, {configurable: false}); - try { - Object.defineProperty(arguments, 0, x); - assert(false); - } catch(e) { - assert(e instanceof TypeError); - } -} - -tryChangeNonConfigurableDescriptor({get: () => {return 50;} }); -tryChangeNonConfigurableDescriptor({set: (x) => {}}); -tryChangeNonConfigurableDescriptor({writable: true, enumerable: false}); - -function tryChangeWritableOfNonConfigurableDescriptor(x) { - Object.defineProperty(arguments, 0, {configurable: false}); - Object.defineProperty(arguments, 0, {writable: true}); - assert(Object.defineProperty(arguments, 0, {writable: false})); -} - -tryChangeWritableOfNonConfigurableDescriptor("foo"); - diff --git a/implementation-contributed/javascriptcore/stress/arith-abs-overflow.js b/implementation-contributed/javascriptcore/stress/arith-abs-overflow.js deleted file mode 100644 index ba2ad28f60..0000000000 --- a/implementation-contributed/javascriptcore/stress/arith-abs-overflow.js +++ /dev/null @@ -1,22 +0,0 @@ -function opaqueAbs(value) -{ - return Math.abs(value); -} -noInline(opaqueAbs); - -// Warmup. -for (let i = 0; i < 1e4; ++i) { - var positiveResult = opaqueAbs(i); - if (positiveResult !== i) - throw "Incorrect positive result at i = " + i + " result = " + positiveResult; - var negativeResult = opaqueAbs(-i); - if (negativeResult !== i) - throw "Incorrect negative result at -i = " + -i + " result = " + negativeResult; -} - -// Overflow. -for (let i = 0; i < 1e4; ++i) { - var overflowResult = opaqueAbs(-2147483648); - if (overflowResult !== 2147483648) - throw "Incorrect overflow result at i = " + i + " result = " + overflowResult; -} diff --git a/implementation-contributed/javascriptcore/stress/arith-abs-to-arith-negate-range-optimizaton.js b/implementation-contributed/javascriptcore/stress/arith-abs-to-arith-negate-range-optimizaton.js deleted file mode 100644 index be22972180..0000000000 --- a/implementation-contributed/javascriptcore/stress/arith-abs-to-arith-negate-range-optimizaton.js +++ /dev/null @@ -1,427 +0,0 @@ -//@ skip if not $jitTests -//@ defaultNoEagerRun -"use strict"; - -// Checked int_min < value < 0 -function opaqueCheckedBetweenIntMinAndZeroExclusive(arg) { - if (arg < 0) { - if (arg > (0x80000000|0)) { - return Math.abs(arg); - } - } - throw "We should not be here"; -} -noInline(opaqueCheckedBetweenIntMinAndZeroExclusive); - -function testCheckedBetweenIntMinAndZeroExclusive() -{ - for (let i = 1; i < 1e5; ++i) { - if (opaqueCheckedBetweenIntMinAndZeroExclusive(-i) !== i) { - throw "Failed testCheckedBetweenIntMinAndZeroExclusive()"; - } - if (opaqueCheckedBetweenIntMinAndZeroExclusive(-2147483647) !== 2147483647) { - throw "Failed testCheckedBetweenIntMinAndZeroExclusive() on -2147483647"; - } - } - if (numberOfDFGCompiles(opaqueCheckedBetweenIntMinAndZeroExclusive) > 1) { - throw "Failed optimizing testCheckedBetweenIntMinAndZeroExclusive(). None of the tested case need to OSR Exit."; - } -} -testCheckedBetweenIntMinAndZeroExclusive(); - - -// Checked int_min < value <= 0 -function opaqueCheckedBetweenIntMinExclusiveAndZeroInclusive(arg) { - if (arg <= 0) { - if (arg > (0x80000000|0)) { - return Math.abs(arg); - } - } - throw "We should not be here"; -} -noInline(opaqueCheckedBetweenIntMinExclusiveAndZeroInclusive); - -function testCheckedBetweenIntMinExclusiveAndZeroInclusive() -{ - for (let i = 1; i < 1e5; ++i) { - if (opaqueCheckedBetweenIntMinExclusiveAndZeroInclusive(-i) !== i) { - throw "Failed testCheckedBetweenIntMinExclusiveAndZeroInclusive()"; - } - if (opaqueCheckedBetweenIntMinExclusiveAndZeroInclusive(0) !== 0) { - throw "Failed testCheckedBetweenIntMinExclusiveAndZeroInclusive() on 0"; - } - if (opaqueCheckedBetweenIntMinExclusiveAndZeroInclusive(-2147483647) !== 2147483647) { - throw "Failed testCheckedBetweenIntMinExclusiveAndZeroInclusive() on -2147483647"; - } - } - if (numberOfDFGCompiles(opaqueCheckedBetweenIntMinExclusiveAndZeroInclusive) > 1) { - throw "Failed optimizing testCheckedBetweenIntMinExclusiveAndZeroInclusive(). None of the tested case need to OSR Exit."; - } -} -testCheckedBetweenIntMinExclusiveAndZeroInclusive(); - - -// Checked int_min <= value < 0 -function opaqueCheckedBetweenIntMinInclusiveAndZeroExclusive(arg) { - if (arg < 0) { - if (arg >= (0x80000000|0)) { - return Math.abs(arg); - } - } - throw "We should not be here"; -} -noInline(opaqueCheckedBetweenIntMinInclusiveAndZeroExclusive); - -function testCheckedBetweenIntMinInclusiveAndZeroExclusive() -{ - for (let i = 1; i < 1e5; ++i) { - if (opaqueCheckedBetweenIntMinInclusiveAndZeroExclusive(-i) !== i) { - throw "Failed testCheckedBetweenIntMinInclusiveAndZeroExclusive()"; - } - if (opaqueCheckedBetweenIntMinInclusiveAndZeroExclusive(-2147483647) !== 2147483647) { - throw "Failed testCheckedBetweenIntMinInclusiveAndZeroExclusive() on -2147483647"; - } - } - if (numberOfDFGCompiles(opaqueCheckedBetweenIntMinInclusiveAndZeroExclusive) > 1) { - throw "Failed optimizing testCheckedBetweenIntMinInclusiveAndZeroExclusive(). None of the tested case need to OSR Exit."; - } - - for (let i = 1; i < 1e5; ++i) { - if (opaqueCheckedBetweenIntMinInclusiveAndZeroExclusive(-i) !== i) { - throw "Failed testCheckedBetweenIntMinInclusiveAndZeroExclusive()"; - } - let result = opaqueCheckedBetweenIntMinInclusiveAndZeroExclusive(-2147483648); - if (result !== 2147483648) { - throw "Failed testCheckedBetweenIntMinInclusiveAndZeroExclusive() on -2147483648, got " + result; - } - } - - if (numberOfDFGCompiles(opaqueCheckedBetweenIntMinInclusiveAndZeroExclusive) > 2) { - throw "Math.abs() on IntMin can OSR Exit but we should quickly settle on double."; - } -} -testCheckedBetweenIntMinInclusiveAndZeroExclusive(); - - -// Checked int_min <= value <= 0 -function opaqueCheckedBetweenIntMinAndZeroInclusive(arg) { - if (arg <= 0) { - if (arg >= (0x80000000|0)) { - return Math.abs(arg); - } - } - throw "We should not be here"; -} -noInline(opaqueCheckedBetweenIntMinAndZeroInclusive); - -function testCheckedBetweenIntMinAndZeroInclusive() -{ - for (let i = 1; i < 1e5; ++i) { - if (opaqueCheckedBetweenIntMinAndZeroInclusive(-i) !== i) { - throw "Failed testCheckedBetweenIntMinAndZeroInclusive()"; - } - if (opaqueCheckedBetweenIntMinAndZeroInclusive(0) !== 0) { - throw "Failed testCheckedBetweenIntMinAndZeroInclusive()"; - } - if (opaqueCheckedBetweenIntMinAndZeroInclusive(-2147483647) !== 2147483647) { - throw "Failed testCheckedBetweenIntMinAndZeroInclusive() on -2147483647"; - } - } - if (numberOfDFGCompiles(opaqueCheckedBetweenIntMinAndZeroInclusive) > 1) { - throw "Failed optimizing testCheckedBetweenIntMinAndZeroInclusive(). None of the tested case need to OSR Exit."; - } - - for (let i = 1; i < 1e5; ++i) { - if (opaqueCheckedBetweenIntMinAndZeroInclusive(-i) !== i) { - throw "Failed testCheckedBetweenIntMinAndZeroInclusive()"; - } - if (opaqueCheckedBetweenIntMinAndZeroInclusive(0) !== 0) { - throw "Failed testCheckedBetweenIntMinAndZeroInclusive()"; - } - if (opaqueCheckedBetweenIntMinAndZeroInclusive(-2147483648) !== 2147483648) { - throw "Failed testCheckedBetweenIntMinAndZeroInclusive() on -2147483648"; - } - } - - if (numberOfDFGCompiles(opaqueCheckedBetweenIntMinAndZeroInclusive) > 2) { - throw "Math.abs() on IntMin can OSR Exit but we should quickly settle on double."; - } -} -testCheckedBetweenIntMinAndZeroInclusive(); - - -// Unchecked int_min < value < 0 -function opaqueUncheckedBetweenIntMinAndZeroExclusive(arg) { - if (arg < 0) { - if (arg > (0x80000000|0)) { - return Math.abs(arg)|0; - } - } - throw "We should not be here"; -} -noInline(opaqueUncheckedBetweenIntMinAndZeroExclusive); - -function testUncheckedBetweenIntMinAndZeroExclusive() -{ - for (let i = 1; i < 1e5; ++i) { - if (opaqueUncheckedBetweenIntMinAndZeroExclusive(-i) !== i) { - throw "Failed testUncheckedBetweenIntMinAndZeroExclusive()"; - } - if (opaqueUncheckedBetweenIntMinAndZeroExclusive(-2147483647) !== 2147483647) { - throw "Failed testUncheckedBetweenIntMinAndZeroExclusive() on -2147483647"; - } - } - if (numberOfDFGCompiles(opaqueUncheckedBetweenIntMinAndZeroExclusive) > 1) { - throw "Failed optimizing testUncheckedBetweenIntMinAndZeroExclusive(). None of the tested case need to OSR Exit."; - } -} -testUncheckedBetweenIntMinAndZeroExclusive(); - - -// Unchecked int_min < value <= 0 -function opaqueUncheckedBetweenIntMinExclusiveAndZeroInclusive(arg) { - if (arg <= 0) { - if (arg > (0x80000000|0)) { - return Math.abs(arg)|0; - } - } - throw "We should not be here"; -} -noInline(opaqueUncheckedBetweenIntMinExclusiveAndZeroInclusive); - -function testUncheckedBetweenIntMinExclusiveAndZeroInclusive() -{ - for (let i = 1; i < 1e5; ++i) { - if (opaqueUncheckedBetweenIntMinExclusiveAndZeroInclusive(-i) !== i) { - throw "Failed testUncheckedBetweenIntMinExclusiveAndZeroInclusive()"; - } - if (opaqueUncheckedBetweenIntMinExclusiveAndZeroInclusive(0) !== 0) { - throw "Failed testUncheckedBetweenIntMinExclusiveAndZeroInclusive() on 0"; - } - if (opaqueUncheckedBetweenIntMinExclusiveAndZeroInclusive(-2147483647) !== 2147483647) { - throw "Failed testUncheckedBetweenIntMinExclusiveAndZeroInclusive() on -2147483647"; - } - } - if (numberOfDFGCompiles(opaqueUncheckedBetweenIntMinExclusiveAndZeroInclusive) > 1) { - throw "Failed optimizing testUncheckedBetweenIntMinExclusiveAndZeroInclusive(). None of the tested case need to OSR Exit."; - } -} -testUncheckedBetweenIntMinExclusiveAndZeroInclusive(); - - -// Unchecked int_min <= value < 0 -function opaqueUncheckedBetweenIntMinInclusiveAndZeroExclusive(arg) { - if (arg < 0) { - if (arg >= (0x80000000|0)) { - return Math.abs(arg)|0; - } - } - throw "We should not be here"; -} -noInline(opaqueUncheckedBetweenIntMinInclusiveAndZeroExclusive); - -function testUncheckedBetweenIntMinInclusiveAndZeroExclusive() -{ - for (let i = 1; i < 1e5; ++i) { - if (opaqueUncheckedBetweenIntMinInclusiveAndZeroExclusive(-i) !== i) { - throw "Failed testUncheckedBetweenIntMinInclusiveAndZeroExclusive()"; - } - if (opaqueUncheckedBetweenIntMinInclusiveAndZeroExclusive(-2147483647) !== 2147483647) { - throw "Failed testUncheckedBetweenIntMinInclusiveAndZeroExclusive() on -2147483647"; - } - if (opaqueUncheckedBetweenIntMinInclusiveAndZeroExclusive(-2147483648) !== -2147483648) { - throw "Failed testUncheckedBetweenIntMinInclusiveAndZeroExclusive() on -2147483648"; - } - } - if (numberOfDFGCompiles(opaqueUncheckedBetweenIntMinInclusiveAndZeroExclusive) > 1) { - throw "Failed optimizing testUncheckedBetweenIntMinInclusiveAndZeroExclusive(). None of the tested case need to OSR Exit."; - } -} -testUncheckedBetweenIntMinInclusiveAndZeroExclusive(); - - -// Unchecked int_min <= value <= 0 -function opaqueUncheckedBetweenIntMinAndZeroInclusive(arg) { - if (arg <= 0) { - if (arg >= (0x80000000|0)) { - return Math.abs(arg)|0; - } - } - throw "We should not be here"; -} -noInline(opaqueUncheckedBetweenIntMinAndZeroInclusive); - -function testUncheckedBetweenIntMinAndZeroInclusive() -{ - for (let i = 1; i < 1e5; ++i) { - if (opaqueUncheckedBetweenIntMinAndZeroInclusive(-i) !== i) { - throw "Failed testUncheckedBetweenIntMinAndZeroInclusive()"; - } - if (opaqueUncheckedBetweenIntMinAndZeroInclusive(0) !== 0) { - throw "Failed testUncheckedBetweenIntMinAndZeroInclusive()"; - } - if (opaqueUncheckedBetweenIntMinAndZeroInclusive(-2147483647) !== 2147483647) { - throw "Failed testUncheckedBetweenIntMinAndZeroInclusive() on -2147483647"; - } - if (opaqueUncheckedBetweenIntMinInclusiveAndZeroExclusive(-2147483648) !== -2147483648) { - throw "Failed testUncheckedBetweenIntMinInclusiveAndZeroExclusive() on -2147483648"; - } - } - if (numberOfDFGCompiles(opaqueUncheckedBetweenIntMinAndZeroInclusive) > 1) { - throw "Failed optimizing testUncheckedBetweenIntMinAndZeroInclusive(). None of the tested case need to OSR Exit."; - } -} -testUncheckedBetweenIntMinAndZeroInclusive(); - - -// Checked value < 0 -function opaqueCheckedLessThanZero(arg) { - if (arg < 0) { - return Math.abs(arg); - } - throw "We should not be here"; -} -noInline(opaqueCheckedLessThanZero); - -function testCheckedLessThanZero() -{ - for (let i = 1; i < 1e5; ++i) { - if (opaqueCheckedLessThanZero(-i) !== i) { - throw "Failed testCheckedLessThanZero()"; - } - if (opaqueCheckedLessThanZero(-2147483647) !== 2147483647) { - throw "Failed testCheckedLessThanZero() on -2147483647"; - } - } - if (numberOfDFGCompiles(opaqueCheckedLessThanZero) > 1) { - throw "Failed optimizing testCheckedLessThanZero(). None of the tested case need to OSR Exit."; - } - - for (let i = 1; i < 1e5; ++i) { - if (opaqueCheckedLessThanZero(-i) !== i) { - throw "Failed testCheckedLessThanZero()"; - } - let result = opaqueCheckedLessThanZero(-2147483648); - if (result !== 2147483648) { - throw "Failed testCheckedLessThanZero() on -2147483648, got " + result; - } - } - if (numberOfDFGCompiles(opaqueCheckedLessThanZero) > 2) { - throw "Math.abs() on IntMin can OSR Exit but we should quickly settle on double."; - } -} -testCheckedLessThanZero(); - - -// Checked value <= 0 -function opaqueCheckedLessThanOrEqualZero(arg) { - if (arg <= 0) { - return Math.abs(arg); - } - throw "We should not be here"; -} -noInline(opaqueCheckedLessThanOrEqualZero); - -function testCheckedLessThanOrEqualZero() -{ - for (let i = 1; i < 1e5; ++i) { - if (opaqueCheckedLessThanOrEqualZero(-i) !== i) { - throw "Failed testCheckedLessThanOrEqualZero()"; - } - if (opaqueCheckedLessThanOrEqualZero(0) !== 0) { - throw "Failed testCheckedLessThanOrEqualZero() on 0"; - } - if (opaqueCheckedLessThanOrEqualZero(-2147483647) !== 2147483647) { - throw "Failed testCheckedLessThanOrEqualZero() on -2147483647"; - } - } - if (numberOfDFGCompiles(opaqueCheckedLessThanOrEqualZero) > 1) { - throw "Failed optimizing testCheckedLessThanOrEqualZero(). None of the tested case need to OSR Exit."; - } - - for (let i = 1; i < 1e5; ++i) { - if (opaqueCheckedLessThanOrEqualZero(-i) !== i) { - throw "Failed testCheckedLessThanOrEqualZero()"; - } - if (opaqueCheckedLessThanOrEqualZero(-2147483648) !== 2147483648) { - throw "Failed testCheckedLessThanOrEqualZero() on -2147483648"; - } - } - if (numberOfDFGCompiles(opaqueCheckedLessThanOrEqualZero) > 2) { - throw "Math.abs() on IntMin can OSR Exit but we should quickly settle on double."; - } -} -testCheckedLessThanOrEqualZero(); - - -// Unchecked value < 0 -function opaqueUncheckedLessThanZero(arg) { - if (arg < 0) { - return Math.abs(arg)|0; - } - throw "We should not be here"; -} -noInline(opaqueUncheckedLessThanZero); - -function testUncheckedLessThanZero() -{ - for (let i = 1; i < 1e5; ++i) { - if (opaqueUncheckedLessThanZero(-i) !== i) { - throw "Failed testUncheckedLessThanZero()"; - } - if (opaqueUncheckedLessThanZero(-2147483647) !== 2147483647) { - throw "Failed testUncheckedLessThanZero() on -2147483647"; - } - if (opaqueUncheckedLessThanZero(-2147483648) !== -2147483648) { - throw "Failed testUncheckedLessThanOrEqualZero() on -2147483648"; - } - } - if (numberOfDFGCompiles(opaqueUncheckedLessThanZero) > 1) { - throw "Failed optimizing testUncheckedLessThanZero(). None of the tested case need to OSR Exit."; - } - - for (let i = 1; i < 1e5; ++i) { - if (opaqueUncheckedLessThanZero(-i) !== i) { - throw "Failed testUncheckedLessThanZero()"; - } - if (opaqueUncheckedLessThanZero(-2147483648) !== -2147483648) { - throw "Failed testUncheckedLessThanZero() on -2147483648"; - } - } - if (numberOfDFGCompiles(opaqueUncheckedLessThanZero) > 2) { - throw "Math.abs() on IntMin can OSR Exit but we should quickly settle on double."; - } -} -testUncheckedLessThanZero(); - - -// Unchecked value <= 0 -function opaqueUncheckedLessThanOrEqualZero(arg) { - if (arg <= 0) { - return Math.abs(arg)|0; - } - throw "We should not be here"; -} -noInline(opaqueUncheckedLessThanOrEqualZero); - -function testUncheckedLessThanOrEqualZero() -{ - for (let i = 1; i < 1e5; ++i) { - if (opaqueUncheckedLessThanOrEqualZero(-i) !== i) { - throw "Failed testUncheckedLessThanOrEqualZero()"; - } - if (opaqueUncheckedLessThanOrEqualZero(0) !== 0) { - throw "Failed testUncheckedLessThanOrEqualZero() on 0"; - } - if (opaqueUncheckedLessThanOrEqualZero(-2147483647) !== 2147483647) { - throw "Failed testUncheckedLessThanOrEqualZero() on -2147483647"; - } - if (opaqueUncheckedLessThanOrEqualZero(-2147483648) !== -2147483648) { - throw "Failed testUncheckedLessThanOrEqualZero() on -2147483648"; - } - } - if (numberOfDFGCompiles(opaqueUncheckedLessThanOrEqualZero) > 1) { - throw "Failed optimizing testUncheckedLessThanOrEqualZero(). None of the tested case need to OSR Exit."; - } -} -testUncheckedLessThanOrEqualZero(); diff --git a/implementation-contributed/javascriptcore/stress/arith-abs-with-bitwise-or-zero.js b/implementation-contributed/javascriptcore/stress/arith-abs-with-bitwise-or-zero.js deleted file mode 100644 index 0f2450f4eb..0000000000 --- a/implementation-contributed/javascriptcore/stress/arith-abs-with-bitwise-or-zero.js +++ /dev/null @@ -1,54 +0,0 @@ -function opaqueAbs(value) -{ - return Math.abs(value)|0; -} -noInline(opaqueAbs); - -for (let i = 0; i < 1e4; ++i) { - var positiveResult = opaqueAbs(i); - if (positiveResult !== i) - throw "Incorrect result at i = " + i + " result = " + positiveResult; - var negativeResult = opaqueAbs(-i); - if (negativeResult !== i) - throw "Incorrect result at -i = " + -i + " result = " + negativeResult; -} - - -var intMax = 2147483647; -var intMin = 2147483647; - -var intMaxResult = opaqueAbs(intMax); -if (intMaxResult !== intMax) - throw "Incorrect result at intMax result = " + intMaxResult; -var intMaxResult = opaqueAbs(intMin); -if (intMaxResult !== intMin) - throw "Incorrect result at intMax result = " + intMaxResult; - -// Numbers around IntMax/IntMin. Numbers outside the bounds are doubles and opaqueAbs() -// has to OSR Exit to handle them correctly. -for (let i = intMax - 1e4; i < intMax + 1e4; ++i) { - var positiveResult = opaqueAbs(i); - if (positiveResult !== (i|0)) - throw "Incorrect result at i = " + i + " result = " + positiveResult; - var negativeResult = opaqueAbs(-i); - if (negativeResult !== (i|0)) - throw "Incorrect result at -i = " + -i + " result = " + negativeResult; -} - -// Edge cases and exits. -if (opaqueAbs(NaN) !== 0) - throw "opaqueAbs(NaN) failed."; -if (opaqueAbs(Infinity) !== 0) - throw "opaqueAbs(Infinity) failed."; -if (opaqueAbs(-Infinity) !== 0) - throw "opaqueAbs(-Infinity) failed."; -if (opaqueAbs(null) !== 0) - throw "opaqueAbs(null) failed."; -if (opaqueAbs(undefined) !== 0) - throw "opaqueAbs(undefined) failed."; -if (opaqueAbs(true) !== 1) - throw "opaqueAbs(true) failed."; -if (opaqueAbs(false) !== 0) - throw "opaqueAbs(false) failed."; -if (opaqueAbs({foo:"bar"}) !== 0) - throw "opaqueAbs({foo:'bar'}) failed."; diff --git a/implementation-contributed/javascriptcore/stress/arith-add-on-double-array-with-holes.js b/implementation-contributed/javascriptcore/stress/arith-add-on-double-array-with-holes.js deleted file mode 100644 index f589ffe254..0000000000 --- a/implementation-contributed/javascriptcore/stress/arith-add-on-double-array-with-holes.js +++ /dev/null @@ -1,100 +0,0 @@ -let testCases = [ - // Numbers - ['1', NaN, NaN, 2, 2], - ['1.5', NaN, NaN, 1 + 1.5, 1 + 1.5], - [NaN, NaN, NaN, NaN, NaN], - - // Strings. - ['""', NaN, NaN, 1, 1], - ['new String()', NaN, NaN, 1, 1], - ['"WebKit!"', NaN, NaN, NaN, NaN], - - // Objects. - ['{ }', NaN, NaN, NaN, NaN], - ['{ foo: 1 }', NaN, NaN, NaN, NaN], - ['{ toString: function() { return ""; } }', NaN, NaN, 1, 1], - ['{ toString: function() { return "WebKit"; } }', NaN, NaN, NaN, NaN], - - // Others. - ['null', NaN, NaN, 1, 1], - ['undefined', NaN, NaN, NaN, NaN] -]; - -for (let testCase of testCases) { - let otherOperand = testCase[0]; - let expectedLeftValueWithHole = testCase[1]; - let expectedRightValueWithHole = testCase[2]; - let expectedLeftValue = testCase[3]; - let expectedRightValue = testCase[4]; - eval( - `// Those holes are not observable by arithmetic operation. - // The return value is always going to be NaN. - function nonObservableHoleOnLhs(array, otherValue) { - return Math.min(array[0]) + Math.min(otherValue); - } - noInline(nonObservableHoleOnLhs); - - function observableHoleOnLhs(array, otherValue) { - let value = array[0]; - return [Math.min(value) + Math.min(otherValue), value]; - } - noInline(observableHoleOnLhs); - - function nonObservableHoleOnRhs(array, otherValue) { - return Math.min(otherValue) + Math.min(array[0]); - } - noInline(nonObservableHoleOnRhs); - - function observableHoleOnRhs(array, otherValue) { - let value = array[0]; - return [Math.min(otherValue) + Math.min(value), value]; - } - noInline(observableHoleOnRhs); - - let testArray = new Array; - for (let i = 1; i < 3; ++i) { - testArray[i] = i + 0.5 - } - - let isEqual = function(a, b) { - if (a === a) { - return a === b; - } - return b !== b; - } - - for (let i = 0; i < 1e4; ++i) { - let lhsResult1 = nonObservableHoleOnLhs(testArray, ${otherOperand}); - if (!isEqual(lhsResult1, ${expectedLeftValueWithHole})) - throw "Error on nonObservableHoleOnLhs at i = " + i + " with operand " + ${otherOperand} + " expected " + ${expectedLeftValueWithHole} + " got " + lhsResult1; - let lhsResult2 = observableHoleOnLhs(testArray, ${otherOperand}); - if (!isEqual(lhsResult2[0], ${expectedLeftValueWithHole}) || lhsResult2[1] !== undefined) - throw "Error on observableHoleOnLhs at i = " + i; - - let rhsResult1 = nonObservableHoleOnRhs(testArray, ${otherOperand}); - if (!isEqual(rhsResult1, ${expectedRightValueWithHole})) - throw "Error on nonObservableHoleOnRhs at i = " + i + " with operand " + ${otherOperand} + " expected " + ${expectedRightValueWithHole} + " got " + rhsResult1; - let rhsResult2 = observableHoleOnRhs(testArray, ${otherOperand}); - if (!isEqual(rhsResult2[0], ${expectedRightValueWithHole}) || rhsResult2[1] !== undefined) - throw "Error on observableHoleOnRhs at i = " + i; - } - - // Fill the hole, make sure everything still work correctly. - testArray[0] = 1.; - for (let i = 0; i < 1e4; ++i) { - let lhsResult1 = nonObservableHoleOnLhs(testArray, ${otherOperand}); - if (!isEqual(lhsResult1, ${expectedLeftValue})) - throw "Error on non hole nonObservableHoleOnLhs at i = " + i + " expected " + ${expectedLeftValue} + " got " + lhsResult1; - let lhsResult2 = observableHoleOnLhs(testArray, ${otherOperand}); - if (!isEqual(lhsResult2[0], ${expectedLeftValue}) || lhsResult2[1] !== 1) - throw "Error on non hole observableHoleOnLhs at i = " + i + " expected " + ${expectedLeftValue} + " got " + lhsResult2[0]; - - let rhsResult1 = nonObservableHoleOnRhs(testArray, ${otherOperand}); - if (!isEqual(rhsResult1, ${expectedRightValue})) - throw "Error on non hole nonObservableHoleOnRhs at i = " + i + " with operand " + ${otherOperand} + " expected " + ${expectedRightValue} + " got " + rhsResult1; - let rhsResult2 = observableHoleOnRhs(testArray, ${otherOperand}); - if (!isEqual(rhsResult2[0], ${expectedRightValue}) || rhsResult2[1] !== 1) - throw "Error on non hole observableHoleOnRhs at i = " + i; - }` - ); -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/arith-add-with-constant-overflow.js b/implementation-contributed/javascriptcore/stress/arith-add-with-constant-overflow.js deleted file mode 100644 index ce5c381237..0000000000 --- a/implementation-contributed/javascriptcore/stress/arith-add-with-constant-overflow.js +++ /dev/null @@ -1,21 +0,0 @@ -function opaqueAdd(a) -{ - return a + 42; -} -noInline(opaqueAdd); - -// Warm up. -for (let i = 0; i < 1e4; ++i) { - let result = opaqueAdd(5); - if (result !== 47) - throw "Invalid opaqueAdd(5) at i = " + i; -} - -// Overflow. -for (let i = 0; i < 1e3; ++i) { - for (let j = -50; j < 50; ++j) { - let result = opaqueAdd(2147483647 + j); - if (result !== 2147483689 + j) - throw "Invalid opaqueAdd(" + 2147483647 + j + ") at i = " + i + " j = " + j; - } -} diff --git a/implementation-contributed/javascriptcore/stress/arith-add-with-constants.js b/implementation-contributed/javascriptcore/stress/arith-add-with-constants.js deleted file mode 100644 index ffb90dcb76..0000000000 --- a/implementation-contributed/javascriptcore/stress/arith-add-with-constants.js +++ /dev/null @@ -1,271 +0,0 @@ -// Test value + 0. -function arithAddIdentityWrittenAsInteger(x) { - var a = x + 0; - var b = 0 + x; - if (!(isNaN(x) && isNaN(a) && isNaN(b)) && a !== b) - throw "Internal error on arithAddIdentityWrittenAsInteger, a = " + a + " b = " + b; - return a; -} -noInline(arithAddIdentityWrittenAsInteger); - -function testArithAddIdentityWrittenAsInteger() { - for (var i = 0; i < 1e4; ++i) { - var result = arithAddIdentityWrittenAsInteger(i); - if (result !== i) { - throw "arithAddIdentityWrittenAsInteger(i) = " + result + ", expected " + i; - } - } - - for (var i = 0; i < 1e4; ++i) { - var result = arithAddIdentityWrittenAsInteger(-0); - if (result !== -0) { - throw "arithAddIdentityWrittenAsInteger(-0) = " + result + ", expected -0"; - } - } - - for (var i = 0; i < 1e4; ++i) { - var testValue = i + .5; - var result = arithAddIdentityWrittenAsInteger(testValue); - if (result !== testValue) { - throw "arithAddIdentityWrittenAsInteger(i) = " + result + ", expected " + testValue; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithAddIdentityWrittenAsInteger(NaN); - if (!isNaN(result)) { - throw "arithAddIdentityWrittenAsInteger(NaN) = " + result + ", expected NaN"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithAddIdentityWrittenAsInteger(Infinity); - if (isFinite(result)) { - throw "arithAddIdentityWrittenAsInteger(Infinity) = " + result + ", expected Infinity"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithAddIdentityWrittenAsInteger(-Infinity); - if (isFinite(result) || result >= 0) { - throw "arithAddIdentityWrittenAsInteger(-Infinity) = " + result + ", expected -Infinity"; - } - } -} -testArithAddIdentityWrittenAsInteger(); - - -function arithAddIdentityWrittenAsDouble(x) { - var a = x + 0.0; - var b = 0. + x; - if (!(isNaN(x) && isNaN(a) && isNaN(b)) && a !== b) - throw "Internal error on arithAddIdentityWrittenAsDouble, a = " + a + " b = " + b; - return a; -} -noInline(arithAddIdentityWrittenAsDouble); - -function testArithAddIdentityWrittenAsDouble() { - for (var i = 0; i < 1e4; ++i) { - var result = arithAddIdentityWrittenAsDouble(i); - if (result !== i) { - throw "arithAddIdentityWrittenAsDouble(i) = " + result + ", expected " + i; - } - } - - for (var i = 0; i < 1e4; ++i) { - var result = arithAddIdentityWrittenAsDouble(-0); - if (result !== -0) { - throw "arithAddIdentityWrittenAsDouble(-0) = " + result + ", expected -0 "; - } - } - - for (var i = 0; i < 1e4; ++i) { - var testValue = i + .5; - var result = arithAddIdentityWrittenAsDouble(testValue); - if (result !== testValue) { - throw "arithAddIdentityWrittenAsDouble(i) = " + result + ", expected " + testValue; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithAddIdentityWrittenAsDouble(NaN); - if (!isNaN(result)) { - throw "arithAddIdentityWrittenAsDouble(NaN) = " + result + ", expected NaN"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithAddIdentityWrittenAsDouble(Infinity); - if (isFinite(result)) { - throw "arithAddIdentityWrittenAsDouble(Infinity) = " + result + ", expected Infinity"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithAddIdentityWrittenAsDouble(-Infinity); - if (isFinite(result) || result >= 0) { - throw "arithAddIdentityWrittenAsDouble(-Infinity) = " + result + ", expected -Infinity"; - } - } -} -testArithAddIdentityWrittenAsDouble(); - - -// Test "value + 42". -function arithAdd42WrittenAsInteger(x) { - var a = x + 42; - var b = 42 + x; - if (!(isNaN(x) && isNaN(a) && isNaN(b)) && a !== b) - throw "Internal error on arithAdd42WrittenAsInteger, a = " + a + " b = " + b; - return a; -} -noInline(arithAdd42WrittenAsInteger); - -function testArithAdd42WrittenAsInteger() { - for (var i = 0; i < 1e4; ++i) { - var result = arithAdd42WrittenAsInteger(13); - if (result !== 55) { - throw "arithAdd42WrittenAsInteger(13) = " + result + ", expected 55"; - } - } - - for (var i = 0; i < 1e4; ++i) { - var result = arithAdd42WrittenAsInteger(-0); - if (result !== 42) { - throw "arithAdd42WrittenAsInteger(-0) = " + result + ", expected 42"; - } - } - - for (var i = 0; i < 1e4; ++i) { - var result = arithAdd42WrittenAsInteger(13.3); - if (result !== 55.3) { - throw "arithAdd42WrittenAsInteger(13.3) = " + result + ", expected 55.3"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithAdd42WrittenAsInteger(NaN); - if (!isNaN(result)) { - throw "arithAdd42WrittenAsInteger(NaN) = " + result + ", expected NaN"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithAdd42WrittenAsInteger(Infinity); - if (isFinite(result)) { - throw "arithAdd42WrittenAsInteger(Infinity) = " + result + ", expected Infinity"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithAdd42WrittenAsInteger(-Infinity); - if (isFinite(result) || result >= 0) { - throw "arithAdd42WrittenAsInteger(-Infinity) = " + result + ", expected -Infinity"; - } - } -} -testArithAdd42WrittenAsInteger(); - - - - -// Test "value + 42". -function arithAdd42WrittenAsInteger(x) { - var a = x + 42; - var b = 42 + x; - if (!(isNaN(x) && isNaN(a) && isNaN(b)) && a !== b) - throw "Internal error on arithAdd42WrittenAsInteger, a = " + a + " b = " + b; - return a; -} -noInline(arithAdd42WrittenAsInteger); - -function testArithAdd42WrittenAsInteger() { - for (var i = 0; i < 1e4; ++i) { - var result = arithAdd42WrittenAsInteger(13); - if (result !== 55) { - throw "arithAdd42WrittenAsInteger(13) = " + result + ", expected 55"; - } - } - - for (var i = 0; i < 1e4; ++i) { - var result = arithAdd42WrittenAsInteger(-0); - if (result !== 42) { - throw "arithAdd42WrittenAsInteger(-0) = " + result + ", expected 42"; - } - } - - for (var i = 0; i < 1e4; ++i) { - var result = arithAdd42WrittenAsInteger(13.3); - if (result !== 55.3) { - throw "arithAdd42WrittenAsInteger(13.3) = " + result + ", expected 55.3"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithAdd42WrittenAsInteger(NaN); - if (!isNaN(result)) { - throw "arithAdd42WrittenAsInteger(NaN) = " + result + ", expected NaN"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithAdd42WrittenAsInteger(Infinity); - if (isFinite(result)) { - throw "arithAdd42WrittenAsInteger(Infinity) = " + result + ", expected Infinity"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithAdd42WrittenAsInteger(-Infinity); - if (isFinite(result) || result >= 0) { - throw "arithAdd42WrittenAsInteger(-Infinity) = " + result + ", expected -Infinity"; - } - } -} -testArithAdd42WrittenAsInteger(); - -function arithSub42WrittenAsDouble(x) { - var a = (x|0) - 42.0; - var b = -42. + (x|0); - if (!(isNaN(x) && isNaN(a) && isNaN(b)) && a !== b) - throw "Internal error on arithSub42WrittenAsDouble, a = " + a + " b = " + b; - return a; -} -noInline(arithSub42WrittenAsDouble); - -function testArithSub42WrittenAsDouble() { - for (var i = 0; i < 1e4; ++i) { - var result = arithSub42WrittenAsDouble(13); - if (result !== -29) { - throw "arithSub42WrittenAsDouble(13) = " + result + ", expected -29"; - } - } - - for (var i = 0; i < 1e4; ++i) { - var result = arithSub42WrittenAsDouble(-0); - if (result !== -42) { - throw "arithSub42WrittenAsDouble(-0) = " + result + ", expected -42"; - } - } - - for (var i = 0; i < 1e4; ++i) { - var result = arithSub42WrittenAsDouble(13.3); - if (result !== -29) { - throw "arithSub42WrittenAsDouble(13.3) = " + result + ", expected -29"; - } - } -} -testArithSub42WrittenAsDouble(); - - -function doubleConstant(){ - Math.min(0.0); - +0.0; -} noInline(doubleConstant); - -function testDoubleConstant(){ - for (var i = 0; i < 1e4; ++i) { - doubleConstant(); - } -} -testDoubleConstant(); diff --git a/implementation-contributed/javascriptcore/stress/arith-clz32-effects.js b/implementation-contributed/javascriptcore/stress/arith-clz32-effects.js deleted file mode 100644 index b58e428714..0000000000 --- a/implementation-contributed/javascriptcore/stress/arith-clz32-effects.js +++ /dev/null @@ -1,30 +0,0 @@ -function foo(o, v) -{ - var result = o.f; - Math.clz32(v); - return result + o.f; -} - -noInline(foo); - -var o = {f: 42}; -o.g = 43; // Bust the transition watchpoint of {f}. - -for (var i = 0; i < 10000; ++i) { - var result = foo({f: 42}, "42"); - if (result != 84) - throw "Error: bad result in loop: " + result; -} - -var o = {f: 43}; -var result = foo(o, { - valueOf: function() - { - delete o.f; - o.__defineGetter__("f", function() { return 44; }); - } -}); - -if (result != 87) - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/arith-modulo-node-behaviors.js b/implementation-contributed/javascriptcore/stress/arith-modulo-node-behaviors.js deleted file mode 100644 index 16b9863b36..0000000000 --- a/implementation-contributed/javascriptcore/stress/arith-modulo-node-behaviors.js +++ /dev/null @@ -1,106 +0,0 @@ -//@ skip if $hostOS == "windows" - -// Verify that the dividend propagate the NeedsNegZero if the dividend requires it. -function moduloWithNegativeZeroDividend(a, b, c) -{ - var temp = a * b; - return temp % c; -} -noInline(moduloWithNegativeZeroDividend); - -// Warm up with integers. The test for NegZero should not be eliminated here. -for (var i = 1; i < 1e4; ++i) { - var result = moduloWithNegativeZeroDividend(i, 5, 5); - if (result !== 0) - throw "moduloWithNegativeZeroDividend(i, 5, 5), returned: " + result; -} - -for (var i = 1; i < 1e4; ++i) { - // Produce negative zero in the multiplication. - var result = moduloWithNegativeZeroDividend(-i, 0, 2); - if (!(result === 0 && (1/result) === -Infinity)) - throw "moduloWithNegativeZeroDividend(-i, 0, 2) failed, returned: " + result; - - // A negative dividend can produce negative zero results. - var result = moduloWithNegativeZeroDividend(-i, 5, 5); - if (!(result === 0 && (1/result) === -Infinity)) - throw "moduloWithNegativeZeroDividend(-i, 5, 5) failed, returned: " + result; -} - -// Edge cases. -for (var i = 1; i < 1e4; ++i) { - var result = moduloWithNegativeZeroDividend(-i, 0, Infinity); - if (!(result === 0 && (1/result) === -Infinity)) - throw "moduloWithNegativeZeroDividend(-i, 0, Infinity) failed, returned: " + result; - - var result = moduloWithNegativeZeroDividend(-i, 0, -Infinity); - if (!(result === 0 && (1/result) === -Infinity)) - throw "moduloWithNegativeZeroDividend(-i, 0, -Infinity) failed, returned: " + result; - - var result = moduloWithNegativeZeroDividend(-i, 0, NaN); - if (result === result) - throw "moduloWithNegativeZeroDividend(-i, 0, NaN) failed, returned: " + result; -} - - -// In this case, the negative zero is irrelevant. The Neg Zero check can be eliminated. -function moduloWithUnusedNegativeZeroDividend(a, b, c) -{ - var temp = a * b; - return (temp % c) | 0; -} -noInline(moduloWithUnusedNegativeZeroDividend); - -for (var i = 1; i < 1e4; ++i) { - var result = moduloWithUnusedNegativeZeroDividend(i, 5, 5); - if (result !== 0) - throw "moduloWithUnusedNegativeZeroDividend(i, 5, 5), returned: " + result; -} - -// Produce negative zero in the multiplication. -for (var i = 1; i < 1e4; ++i) { - var result = moduloWithUnusedNegativeZeroDividend(-i, 0, 2); - if (!(result === 0 && (1/result) === Infinity)) - throw "moduloWithUnusedNegativeZeroDividend(-i, 0, 2) failed, returned: " + result; -} - -for (var i = 1; i < 1e4; ++i) { - var result = moduloWithUnusedNegativeZeroDividend(-i, 0, Infinity); - if (!(result === 0 && (1/result) === Infinity)) - throw "moduloWithUnusedNegativeZeroDividend(-i, 0, Infinity) failed, returned: " + result; - - var result = moduloWithUnusedNegativeZeroDividend(-i, 0, -Infinity); - if (!(result === 0 && (1/result) === Infinity)) - throw "moduloWithUnusedNegativeZeroDividend(-i, 0, -Infinity) failed, returned: " + result; - - var result = moduloWithUnusedNegativeZeroDividend(-i, 0, NaN); - if (result !== 0) - throw "moduloWithUnusedNegativeZeroDividend(-i, 0, NaN) failed, returned: " + result; -} - - -// The sign of the divisor is completely irrelevant. This should never fail on negative zero divisors. -function moduloWithNegativeZeroDivisor(a, b, c) -{ - var temp = a * b; - return c % temp; -} -noInline(moduloWithNegativeZeroDivisor); - -// Warm up with integers. -for (var i = 1; i < 1e4; ++i) { - var result = moduloWithNegativeZeroDivisor(i, 2, i); - if (result !== i) - throw "moduloWithNegativeZeroDividend(i, 2, i), returned: " + result; - - var result = moduloWithNegativeZeroDivisor(-i, 2, i); - if (result !== i) - throw "moduloWithNegativeZeroDividend(-i, 2, i), returned: " + result; -} - -// Produce negative zero in the multiplication. -for (var i = 1; i < 1e4; ++i) { - var result = moduloWithNegativeZeroDivisor(-i, 0, 2); - if (result === result) - throw "moduloWithNegativeZeroDivisor(-i, 0, 2) failed, returned: " + result; -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/arith-modulo-twice.js b/implementation-contributed/javascriptcore/stress/arith-modulo-twice.js deleted file mode 100644 index fdf069ae03..0000000000 --- a/implementation-contributed/javascriptcore/stress/arith-modulo-twice.js +++ /dev/null @@ -1,61 +0,0 @@ -function opaqueModuloSmaller(a) -{ - return (a % 5) % 13; -} -noInline(opaqueModuloSmaller); - -function opaqueModuloEqual(a) -{ - return (a % 5) % 5; -} -noInline(opaqueModuloEqual); - -function opaqueModuloLarger(a) -{ - return (a % 13) % 5; -} -noInline(opaqueModuloLarger); - -function opaqueModuloSmallerNeg(a) -{ - return (a % -5) % -13; -} -noInline(opaqueModuloSmallerNeg); - -function opaqueModuloEqualNeg(a) -{ - return (a % 5) % -5; -} -noInline(opaqueModuloEqualNeg); - -function opaqueModuloLargerNeg(a) -{ - return (a % -13) % 5; -} -noInline(opaqueModuloLargerNeg); - -let testReducibleCases = [opaqueModuloSmaller, opaqueModuloEqual, opaqueModuloSmallerNeg, opaqueModuloEqualNeg]; -let testOtherCases = [opaqueModuloLarger, opaqueModuloLargerNeg]; - -function opaqueExpectedOther(doubleInput) -{ - return (doubleInput - 2147483648) % 13.0 % 5.0; -} -noInline(opaqueExpectedOther); -noDFG(opaqueExpectedOther); - -// Warm up with integers. The test for NegZero should not be eliminated here. -for (let i = 1; i < 1e4; ++i) { - let excpectedReduced = i % 5; - for (let testFunction of testReducibleCases) { - let result = testFunction(i); - if (result !== excpectedReduced) - throw "" + testFunction.name + "(i), returned: " + result + " at i = " + i + " expected " + expectedOther; - } - let expectedOther = opaqueExpectedOther(i + 2147483648); - for (let testFunction of testOtherCases) { - let result = testFunction(i); - if (result !== expectedOther) - throw "" + testFunction.name + "(i), returned: " + result + " at i = " + i + " expected " + expectedOther; - } -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/arith-mul-with-constants.js b/implementation-contributed/javascriptcore/stress/arith-mul-with-constants.js deleted file mode 100644 index 156ab79e4e..0000000000 --- a/implementation-contributed/javascriptcore/stress/arith-mul-with-constants.js +++ /dev/null @@ -1,222 +0,0 @@ -// Test value * 1. -function arithMulIdentityWrittenAsInteger(x) { - var a = x * 1; - var b = 1 * x; - if (!(isNaN(x) && isNaN(a) && isNaN(b)) && a !== b) - throw "Internal error on arithMulIdentityWrittenAsInteger, a = " + a + " b = " + b; - return a; -} -noInline(arithMulIdentityWrittenAsInteger); - -function testArithMulIdentityWrittenAsInteger() { - for (var i = 0; i < 1e4; ++i) { - var result = arithMulIdentityWrittenAsInteger(i); - if (result !== i) { - throw "arithMulIdentityWrittenAsInteger(i) = " + result + ", expected " + i; - } - } - - for (var i = 0; i < 1e4; ++i) { - var result = arithMulIdentityWrittenAsInteger(-0); - if (result !== -0) { - throw "arithMulIdentityWrittenAsInteger(-0) = " + result + ", expected -0"; - } - } - - for (var i = 0; i < 1e4; ++i) { - var testValue = i + .5; - var result = arithMulIdentityWrittenAsInteger(testValue); - if (result !== testValue) { - throw "arithMulIdentityWrittenAsInteger(i) = " + result + ", expected " + testValue; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithMulIdentityWrittenAsInteger(NaN); - if (!isNaN(result)) { - throw "arithMulIdentityWrittenAsInteger(NaN) = " + result + ", expected NaN"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithMulIdentityWrittenAsInteger(Infinity); - if (isFinite(result)) { - throw "arithMulIdentityWrittenAsInteger(Infinity) = " + result + ", expected Infinity"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithMulIdentityWrittenAsInteger(-Infinity); - if (isFinite(result) || result >= 0) { - throw "arithMulIdentityWrittenAsInteger(-Infinity) = " + result + ", expected -Infinity"; - } - } -} -testArithMulIdentityWrittenAsInteger(); - - -function arithMulIdentityWrittenAsDouble(x) { - var a = x * 1.0; - var b = 1. * x; - if (!(isNaN(x) && isNaN(a) && isNaN(b)) && a !== b) - throw "Internal error on arithMulIdentityWrittenAsDouble, a = " + a + " b = " + b; - return a; -} -noInline(arithMulIdentityWrittenAsDouble); - -function testArithMulIdentityWrittenAsDouble() { - for (var i = 0; i < 1e4; ++i) { - var result = arithMulIdentityWrittenAsDouble(i); - if (result !== i) { - throw "arithMulIdentityWrittenAsDouble(i) = " + result + ", expected " + i; - } - } - - for (var i = 0; i < 1e4; ++i) { - var result = arithMulIdentityWrittenAsDouble(-0); - if (result !== -0) { - throw "arithMulIdentityWrittenAsDouble(-0) = " + result + ", expected -0 "; - } - } - - for (var i = 0; i < 1e4; ++i) { - var testValue = i + .5; - var result = arithMulIdentityWrittenAsDouble(testValue); - if (result !== testValue) { - throw "arithMulIdentityWrittenAsDouble(i) = " + result + ", expected " + testValue; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithMulIdentityWrittenAsDouble(NaN); - if (!isNaN(result)) { - throw "arithMulIdentityWrittenAsDouble(NaN) = " + result + ", expected NaN"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithMulIdentityWrittenAsDouble(Infinity); - if (isFinite(result)) { - throw "arithMulIdentityWrittenAsDouble(Infinity) = " + result + ", expected Infinity"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithMulIdentityWrittenAsDouble(-Infinity); - if (isFinite(result) || result >= 0) { - throw "arithMulIdentityWrittenAsDouble(-Infinity) = " + result + ", expected -Infinity"; - } - } -} -testArithMulIdentityWrittenAsDouble(); - - -// Test "value * 42". -function arithMul42WrittenAsInteger(x) { - var a = x * 42; - var b = 42 * x; - if (!(isNaN(x) && isNaN(a) && isNaN(b)) && a !== b) - throw "Internal error on arithMul42WrittenAsInteger, a = " + a + " b = " + b; - return a; -} -noInline(arithMul42WrittenAsInteger); - -function testArithMul42WrittenAsInteger() { - for (var i = 0; i < 1e4; ++i) { - var result = arithMul42WrittenAsInteger(13); - if (result !== 546) { - throw "arithMul42WrittenAsInteger(13) = " + result + ", expected 546"; - } - } - - for (var i = 0; i < 1e4; ++i) { - var result = arithMul42WrittenAsInteger(-0); - if (result !== -0) { - throw "arithMul42WrittenAsInteger(-0) = " + result + ", expected -0"; - } - } - - for (var i = 0; i < 1e4; ++i) { - var result = arithMul42WrittenAsInteger(13.3); - if (result !== 558.6) { - throw "arithMul42WrittenAsInteger(13.3) = " + result + ", expected 558.6"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithMul42WrittenAsInteger(NaN); - if (!isNaN(result)) { - throw "arithMul42WrittenAsInteger(NaN) = " + result + ", expected NaN"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithMul42WrittenAsInteger(Infinity); - if (isFinite(result)) { - throw "arithMul42WrittenAsInteger(Infinity) = " + result + ", expected Infinity"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithMul42WrittenAsInteger(-Infinity); - if (isFinite(result) || result >= 0) { - throw "arithMul42WrittenAsInteger(-Infinity) = " + result + ", expected -Infinity"; - } - } -} -testArithMul42WrittenAsInteger(); - - -function arithMul42WrittenAsDouble(x) { - var a = x * 42.0; - var b = 42. * x; - if (!(isNaN(x) && isNaN(a) && isNaN(b)) && a !== b) - throw "Internal error on arithMul42WrittenAsDouble, a = " + a + " b = " + b; - return a; -} -noInline(arithMul42WrittenAsDouble); - -function testArithMul42WrittenAsDouble() { - for (var i = 0; i < 1e4; ++i) { - var result = arithMul42WrittenAsDouble(13); - if (result !== 546) { - throw "arithMul42WrittenAsDouble(i) = " + result + ", expected 546"; - } - } - - for (var i = 0; i < 1e4; ++i) { - var result = arithMul42WrittenAsDouble(-0); - if (result !== -0) { - throw "arithMul42WrittenAsDouble(-0) = " + result + ", expected -0"; - } - } - - for (var i = 0; i < 1e4; ++i) { - var result = arithMul42WrittenAsDouble(13.3); - if (result !== 558.6) { - throw "arithMul42WrittenAsDouble(13.3) = " + result + ", expected 558.6"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithMul42WrittenAsDouble(NaN); - if (!isNaN(result)) { - throw "arithMul42WrittenAsDouble(NaN) = " + result + ", expected NaN"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithMul42WrittenAsDouble(Infinity); - if (isFinite(result)) { - throw "arithMul42WrittenAsDouble(Infinity) = " + result + ", expected Infinity"; - } - } - - for (var i = 0; i < 1e4; ++i) {; - var result = arithMul42WrittenAsDouble(-Infinity); - if (isFinite(result) || result >= 0) { - throw "arithMul42WrittenAsDouble(-Infinity) = " + result + ", expected -Infinity"; - } - } -} -testArithMul42WrittenAsDouble(); \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/arith-nodes-abstract-interpreter-untypeduse.js b/implementation-contributed/javascriptcore/stress/arith-nodes-abstract-interpreter-untypeduse.js deleted file mode 100644 index fb3715b71e..0000000000 --- a/implementation-contributed/javascriptcore/stress/arith-nodes-abstract-interpreter-untypeduse.js +++ /dev/null @@ -1,373 +0,0 @@ -// This test that the DFG Abstract interpreter properly handles UntypedUse for various ArithXXX and CompareXXX nodes. -// This test should run without errors or crashing. - -let errors = 0; -const smallValue = 2.3023e-320; - -function test(functionName, testFunc) { - try{ - var ary_1 = [1.1, 2.2, 3.3]; - var ary_2 = ary_1; - var f64_1 = new Float64Array(0x10); - - for (var i = 0; i < 200000; i++) - testFunc(ary_1, f64_1, '1'); - - testFunc(ary_2, f64_1, { toString:()=>{ ary_2[0] = {}; return "3"}}); - if (ary_2[2] != smallValue) - throw functionName + " returned the wrong value"; - } catch(e) { - errors++; - print("Exception testing " + functionName + ": " + e); - }; -}; - -for (let i = 0; i < 8; i++) { - test("Warmup", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.abs(c); - b[0] = a[0]; - a[2] = smallValue; - }); -} - -test("Unary -", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = -c; - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Unary +", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = +c; - b[0] = a[0]; - a[2] = smallValue; -}); - -test("+", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = a[1] + c; - b[0] = a[0]; - a[2] = smallValue; -}); - -test("-", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = a[1] - c; - b[0] = a[0]; - a[2] = smallValue; -}); - -test("*", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = a[1] * c; - b[0] = a[0]; - a[2] = smallValue; -}); - -test("/", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = a[1] / c; - b[0] = a[0]; - a[2] = smallValue; -}); - -test("%", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = a[1] % c; - b[0] = a[0]; - a[2] = smallValue; -}); - -test("**", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = c ** a[1]; - b[0] = a[0]; - a[2] = smallValue; -}); - -test("prefix ++", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = ++c; - b[0] = a[0]; - a[2] = smallValue; -}); - -test("prefix --", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = --c; - b[0] = a[0]; - a[2] = smallValue; -}); - -test("==", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = c == 7; - b[0] = a[0]; - a[2] = smallValue; -}); - -test("<", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = c < 42; - b[0] = a[0]; - a[2] = smallValue; -}); - -test("<=", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = c <= 7; - b[0] = a[0]; - a[2] = smallValue; -}); - -test(">", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = c > 3; - b[0] = a[0]; - a[2] = smallValue; -}); - -test(">=", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = c >= 12; - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.abs", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.abs(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.acos", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.acos(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.acosh", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.acosh(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.asin", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.asin(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.asinh", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.asinh(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.atan", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.atan(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.atan2", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.atan2(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.atanh", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.atanh(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.ceil", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.ceil(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.cos", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.cos(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.cosh", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.cosh(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.exp", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.exp(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.expm1", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.expm1(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.floor", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.floor(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.fround", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.fround(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.log", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.log(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.log1p", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.log1p(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.log10", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.log10(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.log2", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.log2(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.round", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.round(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.sin", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.sin(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.sign", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.sign(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.sinh", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.sinh(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.sqrt", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.sqrt(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.tan", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.tan(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.tanh", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.tanh(c); - b[0] = a[0]; - a[2] = smallValue; -}); - -test("Math.trunc", function(a, b, c){ - a[0] = 1.1; - a[1] = 2.2; - var tmp = Math.trunc(c); - b[0] = a[0]; - a[2] = smallValue; -}); - - -if (errors) - throw "Failed " + errors + " tests." diff --git a/implementation-contributed/javascriptcore/stress/arith-profile-for-negate-can-see-non-number-due-to-dfg-osr-exit-profiling.js b/implementation-contributed/javascriptcore/stress/arith-profile-for-negate-can-see-non-number-due-to-dfg-osr-exit-profiling.js deleted file mode 100644 index 5d01839867..0000000000 --- a/implementation-contributed/javascriptcore/stress/arith-profile-for-negate-can-see-non-number-due-to-dfg-osr-exit-profiling.js +++ /dev/null @@ -1,32 +0,0 @@ -function runNearStackLimit(f) { - try { - return t(); - } catch (e) { - return f(); - } -} -let flag = false; -function f1() { - return flag ? {} : 10; -} -noInline(f1); - -function f2() { -} - -function f3(arg) { - let r = -(arg ? f1() : f2()); -} - -for (let i = 0; i < 100000; ++i) { - try { - f3(!!(i % 2)); - } catch (e) {} -} - -flag = true; -for (let i = 0; i < 100000; ++i) try { - runNearStackLimit(() => { - return f3(!!(i % 2)); - }); -} catch (e) {} diff --git a/implementation-contributed/javascriptcore/stress/arith-sub-on-double-array-with-holes.js b/implementation-contributed/javascriptcore/stress/arith-sub-on-double-array-with-holes.js deleted file mode 100644 index 855c78ca84..0000000000 --- a/implementation-contributed/javascriptcore/stress/arith-sub-on-double-array-with-holes.js +++ /dev/null @@ -1,98 +0,0 @@ -let testCases = [ - // Numbers - ['1', 0, 0], - ['1.5', 1 - 1.5, 1.5 - 1], - [NaN, NaN, NaN], - - // Strings. - ['""', 1, -1], - ['new String()', 1, -1], - ['"WebKit!"', NaN, NaN], - - // Objects. - ['{ }', NaN, NaN], - ['{ foo: 1 }', NaN, NaN], - ['{ toString: function() { return ""; } }', 1, -1], - ['{ toString: function() { return "WebKit"; } }', NaN, NaN], - - // Others. - ['null', 1, -1], - ['undefined', NaN, NaN] -]; - -for (let testCase of testCases) { - let otherOperand = testCase[0]; - let expectedLeftValue = testCase[1]; - let expectedRightValue = testCase[2]; - eval( - `// Those holes are not observable by arithmetic operation. - // The return value is always going to be NaN. - function nonObservableHoleOnLhs(array, otherValue) { - return array[0] - otherValue; - } - noInline(nonObservableHoleOnLhs); - - function observableHoleOnLhs(array, otherValue) { - let value = array[0]; - return [value - otherValue, value]; - } - noInline(observableHoleOnLhs); - - function nonObservableHoleOnRhs(array, otherValue) { - return otherValue - array[0]; - } - noInline(nonObservableHoleOnRhs); - - function observableHoleOnRhs(array, otherValue) { - let value = array[0]; - return [otherValue - value, value]; - } - noInline(observableHoleOnRhs); - - let testArray = new Array; - for (let i = 1; i < 3; ++i) { - testArray[i] = i + 0.5 - } - - for (let i = 0; i < 1e4; ++i) { - let lhsResult1 = nonObservableHoleOnLhs(testArray, ${otherOperand}); - if (lhsResult1 == lhsResult1) - throw "Error on nonObservableHoleOnLhs at i = " + i; - let lhsResult2 = observableHoleOnLhs(testArray, ${otherOperand}); - if (lhsResult2[0] == lhsResult2[0] || lhsResult2[1] !== undefined) - throw "Error on observableHoleOnLhs at i = " + i; - - let rhsResult1 = nonObservableHoleOnRhs(testArray, ${otherOperand}); - if (rhsResult1 == rhsResult1) - throw "Error on nonObservableHoleOnRhs at i = " + i; - let rhsResult2 = observableHoleOnRhs(testArray, ${otherOperand}); - if (rhsResult2[0] == rhsResult2[0] || rhsResult2[1] !== undefined) - throw "Error on observableHoleOnRhs at i = " + i; - } - - let isEqual = function(a, b) { - if (a === a) { - return a === b; - } - return b !== b; - } - - // Fill the hole, make sure everything still work correctly. - testArray[0] = 1.; - for (let i = 0; i < 1e4; ++i) { - let lhsResult1 = nonObservableHoleOnLhs(testArray, ${otherOperand}); - if (!isEqual(lhsResult1, ${expectedLeftValue})) - throw "Error on non hole nonObservableHoleOnLhs at i = " + i + " expected " + ${expectedLeftValue} + " got " + lhsResult1; - let lhsResult2 = observableHoleOnLhs(testArray, ${otherOperand}); - if (!isEqual(lhsResult2[0], ${expectedLeftValue}) || lhsResult2[1] !== 1) - throw "Error on non hole observableHoleOnLhs at i = " + i + " expected " + ${expectedLeftValue} + " got " + lhsResult2[0]; - - let rhsResult1 = nonObservableHoleOnRhs(testArray, ${otherOperand}); - if (!isEqual(rhsResult1, ${expectedRightValue})) - throw "Error on non hole nonObservableHoleOnRhs at i = " + i + " expected " + ${expectedRightValue} + " got " + rhsResult1; - let rhsResult2 = observableHoleOnRhs(testArray, ${otherOperand}); - if (!isEqual(rhsResult2[0], ${expectedRightValue}) || rhsResult2[1] !== 1) - throw "Error on non hole observableHoleOnRhs at i = " + i; - }` - ); -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/arity-check-ftl-throw-more-args.js b/implementation-contributed/javascriptcore/stress/arity-check-ftl-throw-more-args.js deleted file mode 100644 index ee2ed3c297..0000000000 --- a/implementation-contributed/javascriptcore/stress/arity-check-ftl-throw-more-args.js +++ /dev/null @@ -1,23 +0,0 @@ -// Require lots of arguments so that arity fixup will need a lot of stack, making -// it prone to stack overflow. -var script = "recursionCount, "; -for (var i = 0; i < 5000; ++i) - script += "dummy, " -script += "dummy"; -var g = new Function(script, "return recursionCount ? g(recursionCount - 1) : 0;"); // Ensure that arguments are observed. - -noInline(g); - -// Ensure that f and g get optimized. -for (var i = 0; i < 10000; ++i) { - // Recurse once to ensure profiling along all control flow paths. - g(1); -} - -try { - // Recurse enough times to trigger a stack overflow exception. - g(1000000); -} catch(e) { - if (! (e instanceof RangeError)) - throw "bad value for e"; -} diff --git a/implementation-contributed/javascriptcore/stress/arity-check-ftl-throw.js b/implementation-contributed/javascriptcore/stress/arity-check-ftl-throw.js deleted file mode 100644 index 0a336f75d9..0000000000 --- a/implementation-contributed/javascriptcore/stress/arity-check-ftl-throw.js +++ /dev/null @@ -1,35 +0,0 @@ -// Require lots of arguments so that arity fixup will need a lot of stack, making -// it prone to stack overflow. -var script = ""; -for (var i = 0; i < 128; ++i) - script += "dummy, " -script += "dummy"; -var g = new Function(script, "return arguments;"); // Ensure that arguments are observed. - -function f(recursionCount) -{ - if (!recursionCount) - return; - - // Use too few arguments to force arity fixup. - g(); - - f(--recursionCount); -} - -noInline(g); -noInline(f); - -// Ensure that f and g get optimized. -for (var i = 0; i < 1000000; ++i) { - // Recurse once to ensure profiling along all control flow paths. - f(1); -} - -try { - // Recurse enough times to trigger a stack overflow exception. - f(1000000); -} catch(e) { - if (! (e instanceof RangeError)) - throw "bad value for e"; -} diff --git a/implementation-contributed/javascriptcore/stress/arity-fixup-inlining-dont-generate-invalid-use.js b/implementation-contributed/javascriptcore/stress/arity-fixup-inlining-dont-generate-invalid-use.js deleted file mode 100644 index 17f231185e..0000000000 --- a/implementation-contributed/javascriptcore/stress/arity-fixup-inlining-dont-generate-invalid-use.js +++ /dev/null @@ -1,26 +0,0 @@ -function baz() { } -noInline(baz); - -function bar(x, y, z) { - baz(z); - return x + y + 20.2; -} -function foo(x, b) { - let y = x + 10.54; - let z = y; - if (b) { - y += 1.23; - z += 2.199; - } else { - y += 2.27; - z += 2.18; - } - - let r = bar(b ? y : z, !b ? y : z); - - return r; -} -noInline(foo); - -for (let i = 0; i < 1000; ++i) - foo(i+0.5, !!(i%2)); diff --git a/implementation-contributed/javascriptcore/stress/arity-fixup-should-not-touch-stack-area-below-sp.js b/implementation-contributed/javascriptcore/stress/arity-fixup-should-not-touch-stack-area-below-sp.js deleted file mode 100644 index 8d12dc507b..0000000000 --- a/implementation-contributed/javascriptcore/stress/arity-fixup-should-not-touch-stack-area-below-sp.js +++ /dev/null @@ -1,3 +0,0 @@ -var args = "y,".repeat(30000); -var g = Function(args, "return 0"); -g(); diff --git a/implementation-contributed/javascriptcore/stress/arity-mismatch-arguments-length.js b/implementation-contributed/javascriptcore/stress/arity-mismatch-arguments-length.js deleted file mode 100644 index 4a89e24bb3..0000000000 --- a/implementation-contributed/javascriptcore/stress/arity-mismatch-arguments-length.js +++ /dev/null @@ -1,50 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function test1(arg1, arg2, arg3) - { - return arguments.length; - } - - function test() - { - shouldBe(test1(), 0); - shouldBe(test1(0), 1); - shouldBe(test1(0, 1), 2); - shouldBe(test1(0, 1, 2), 3); - shouldBe(test1(0, 1, 2, 3), 4); - } - noInline(test); - - for (var i = 0; i < 1e4; ++i) - test(); -}()); - -(function () { - function test1(flag, arg1, arg2, arg3) - { - if (flag) - OSRExit(); - return arguments; - } - - function test(flag) - { - shouldBe(test1(flag).length, 1); - shouldBe(test1(flag, 0).length, 2); - shouldBe(test1(flag, 0, 1).length, 3); - shouldBe(test1(flag, 0, 1, 2).length, 4); - shouldBe(test1(flag, 0, 1, 2, 3).length, 5); - } - noInline(test); - for (var i = 0; i < 1e5; ++i) - test(false); - - test(true); - test(true); - test(true); -}()); diff --git a/implementation-contributed/javascriptcore/stress/arity-mismatch-inlining-extra-slots.js b/implementation-contributed/javascriptcore/stress/arity-mismatch-inlining-extra-slots.js deleted file mode 100644 index eaf374370c..0000000000 --- a/implementation-contributed/javascriptcore/stress/arity-mismatch-inlining-extra-slots.js +++ /dev/null @@ -1,17 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function inlineTarget(arg1, arg2) -{ - return [arg1, arg2]; -} - -function test() { - shouldBe(JSON.stringify(inlineTarget(null)), `[null,null]`); -} -noInline(test); -for (var i = 0; i < 3e4; ++i) - test(); diff --git a/implementation-contributed/javascriptcore/stress/arity-mismatch-inlining.js b/implementation-contributed/javascriptcore/stress/arity-mismatch-inlining.js deleted file mode 100644 index 8081d9f212..0000000000 --- a/implementation-contributed/javascriptcore/stress/arity-mismatch-inlining.js +++ /dev/null @@ -1,24 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function inlineTarget(arg1, arg2, arg3, arg4, arg5) -{ - return [arg1, arg2, arg3, arg4, arg5]; -} - -function test() { - shouldBe(JSON.stringify(inlineTarget()), `[null,null,null,null,null]`); - shouldBe(JSON.stringify(inlineTarget(42)), `[42,null,null,null,null]`); - shouldBe(JSON.stringify(inlineTarget(42, 43)), `[42,43,null,null,null]`); - shouldBe(JSON.stringify(inlineTarget(42, 43, 44)), `[42,43,44,null,null]`); - shouldBe(JSON.stringify(inlineTarget(42, 43, 44, 45)), `[42,43,44,45,null]`); - shouldBe(JSON.stringify(inlineTarget(42, 43, 44, 45, 46)), `[42,43,44,45,46]`); - shouldBe(JSON.stringify(inlineTarget(42, 43, 44, 45, 46, 47)), `[42,43,44,45,46]`); - shouldBe(JSON.stringify(inlineTarget(42, 43, 44, 45, 46, 47, 48)), `[42,43,44,45,46]`); -} -noInline(test); -for (var i = 0; i < 3e4; ++i) - test(); diff --git a/implementation-contributed/javascriptcore/stress/arity-mismatch-rest.js b/implementation-contributed/javascriptcore/stress/arity-mismatch-rest.js deleted file mode 100644 index a8584cce29..0000000000 --- a/implementation-contributed/javascriptcore/stress/arity-mismatch-rest.js +++ /dev/null @@ -1,65 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function test2(...rest) - { - return rest; - } - - function test1(arg1, arg2, arg3) - { - return test2(arg1, arg2, arg3); - } - - function test() - { - var result = test1(); - shouldBe(result.length, 3); - shouldBe(result[0], undefined); - shouldBe(result[1], undefined); - shouldBe(result[2], undefined); - } - noInline(test); - - for (var i = 0; i < 1e4; ++i) - test(); -}()); - -(function () { - function test1(...rest) - { - return rest; - } - - function test() - { - var result = test1(); - shouldBe(result.length, 0); - } - noInline(test); - - for (var i = 0; i < 1e4; ++i) - test(); -}()); - -(function () { - function test1(...rest) - { - return rest; - } - noInline(test1); - - function test() - { - var result = test1(); - shouldBe(result.length, 0); - } - noInline(test); - - for (var i = 0; i < 1e4; ++i) - test(); -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-buffer-byte-length.js b/implementation-contributed/javascriptcore/stress/array-buffer-byte-length.js deleted file mode 100644 index 78a72f9232..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-buffer-byte-length.js +++ /dev/null @@ -1,66 +0,0 @@ -//@ skip -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function shouldThrow(func, errorMessage) -{ - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -{ - let arrayBuffer = new ArrayBuffer(42); - let sharedArrayBuffer = new SharedArrayBuffer(500); - shouldBe(arrayBuffer.byteLength, 42); - shouldBe(sharedArrayBuffer.byteLength, 500); - shouldBe(ArrayBuffer.prototype.hasOwnProperty('byteLength'), true); - shouldBe(SharedArrayBuffer.prototype.hasOwnProperty('byteLength'), true); - - shouldBe(arrayBuffer.hasOwnProperty('byteLength'), false); - shouldBe(sharedArrayBuffer.hasOwnProperty('byteLength'), false); - - shouldBe(!!Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'byteLength').get, true); - shouldBe(!!Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, 'byteLength').get, true); - - shouldBe(!!Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'byteLength').set, false); - shouldBe(!!Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, 'byteLength').set, false); - - shouldBe(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'byteLength').get !== Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, 'byteLength').get, true); - - shouldThrow(() => { - Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'byteLength').get.call(sharedArrayBuffer); - }, `TypeError: Receiver should not be a shared array buffer`); - - shouldThrow(() => { - Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, 'byteLength').get.call(arrayBuffer); - }, `TypeError: Receiver should be a shared array buffer`); - - for (let value of [ 0, true, "Cocoa", null, undefined, Symbol("Cappuccino") ]) { - shouldThrow(() => { - Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'byteLength').get.call(value); - }, `TypeError: Receiver should be an array buffer but was not an object`); - shouldThrow(() => { - Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, 'byteLength').get.call(value); - }, `TypeError: Receiver should be an array buffer but was not an object`); - } - - shouldThrow(() => { - Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'byteLength').get.call({}); - }, `TypeError: Receiver should be an array buffer`); - shouldThrow(() => { - Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, 'byteLength').get.call({}); - }, `TypeError: Receiver should be an array buffer`); -} diff --git a/implementation-contributed/javascriptcore/stress/array-concat-fast-spread-proxy.js b/implementation-contributed/javascriptcore/stress/array-concat-fast-spread-proxy.js deleted file mode 100644 index eb6ee0665e..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-concat-fast-spread-proxy.js +++ /dev/null @@ -1,41 +0,0 @@ -// This file tests is concat spreadable when taking the fast path -// (single argument, JSArray receiver) - -function arrayEq(a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) { - if (a[i] !== b[i]) - return false; - } - return true; -} - - -{ - let array = [1,2,3]; - let {proxy:p, revoke} = Proxy.revocable([4, 5], {}); - - // Test it works with proxies by default - for (let i = 0; i < 10000; i++) { - if (!arrayEq(Array.prototype.concat.call(array, p), [1,2,3,4,5])) - throw "failed normally with a proxy" - } - - // Test it works with spreadable false. - p[Symbol.isConcatSpreadable] = false; - for (let i = 0; i < 10000; i++) { - if (!arrayEq(Array.prototype.concat.call(array,p), [1,2,3,p])) - throw "failed with no spread" - } - - p[Symbol.isConcatSpreadable] = undefined; - revoke(); - passed = true; - try { - Array.prototype.concat.call(array,p); - passed = false; - } catch (e) { } - if (!passed) - throw "failed to throw spreading revoked proxy"; -} diff --git a/implementation-contributed/javascriptcore/stress/array-concat-on-frozen-object.js b/implementation-contributed/javascriptcore/stress/array-concat-on-frozen-object.js deleted file mode 100644 index 6b785c03dc..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-concat-on-frozen-object.js +++ /dev/null @@ -1,72 +0,0 @@ -//@ runFTLNoCJIT - -let totalFailed = 0; - -function shouldEqual(testId, actual, expected) { - if (actual != expected) { - throw testId + ": ERROR: expect " + expected + ", actual " + actual; - } -} - -function makeArray() { - return ['unmodifiable']; -} - -function makeArrayLikeObject() { - var obj = {}; - obj[0] = 'unmodifiable'; - obj.length = 1; - return obj; -} - -function emptyArraySourceMaker() { - return []; -} - -function singleElementArraySourceMaker() { - return ['modified_1']; -} - -// Make test functions with unique codeblocks. -function makeConcatTest(testId) { - return new Function("arr", "return arr.concat(['" + testId + "'])"); -} -function makeConcatOnHoleyArrayTest(testId) { - return new Function("arr", "var other = ['" + testId + "']; other[1000] = '" + testId + "'; return arr.concat(other);"); -} - -let numIterations = 10000; - -function runTest(testId, testMaker, targetMaker, sourceMaker, expectedValue, expectedException) { - var test = testMaker(testId); - noInline(test); - - for (var i = 0; i < numIterations; i++) { - var exception = undefined; - - var obj = targetMaker(); - obj = Object.freeze(obj); - - var arr = sourceMaker(); - arr.constructor = { [Symbol.species]: function() { return obj; } }; - - try { - test(arr); - } catch (e) { - exception = "" + e; - exception = exception.substr(0, 10); // Search for "TypeError:". - } - shouldEqual(testId, exception, expectedException); - shouldEqual(testId, obj[0], expectedValue); - } -} - -runTest(10010, makeConcatTest, makeArray, emptyArraySourceMaker, "unmodifiable", "TypeError:"); -runTest(10011, makeConcatTest, makeArray, singleElementArraySourceMaker, "unmodifiable", "TypeError:"); -runTest(10020, makeConcatTest, makeArrayLikeObject, emptyArraySourceMaker, "unmodifiable", "TypeError:"); -runTest(10021, makeConcatTest, makeArrayLikeObject, singleElementArraySourceMaker, "unmodifiable", "TypeError:"); - -runTest(10110, makeConcatOnHoleyArrayTest, makeArray, emptyArraySourceMaker, "unmodifiable", "TypeError:"); -runTest(10111, makeConcatOnHoleyArrayTest, makeArray, singleElementArraySourceMaker, "unmodifiable", "TypeError:"); -runTest(10120, makeConcatOnHoleyArrayTest, makeArrayLikeObject, emptyArraySourceMaker, "unmodifiable", "TypeError:"); -runTest(10121, makeConcatOnHoleyArrayTest, makeArrayLikeObject, singleElementArraySourceMaker, "unmodifiable", "TypeError:"); diff --git a/implementation-contributed/javascriptcore/stress/array-concat-spread-object.js b/implementation-contributed/javascriptcore/stress/array-concat-spread-object.js deleted file mode 100644 index 13b551eba9..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-concat-spread-object.js +++ /dev/null @@ -1,48 +0,0 @@ -// This file tests is concat spreadable. - -function arrayEq(a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) { - if (a[i] !== b[i]) - return false; - } - return true; -} - - -{ - let o = {0:1, 1:2, 2:3, length:3}; - - // Test it works with proxies by default - for (let i = 0; i < 100000; i++) { - if (!arrayEq(Array.prototype.concat.call(o,o), [o,o])) - throw "failed normally with an object" - } - - // Test it works with spreadable true - o[Symbol.isConcatSpreadable] = true; - for (let i = 0; i < 100000; i++) { - let result = Array.prototype.concat.call(o,o) - if (!arrayEq(result, [1,2,3,1,2,3])) - throw "failed with spread got: " + result; - } - - // Test it works with many things - o[Symbol.isConcatSpreadable] = true; - let other = {} - for (let i = 0; i < 100000; i++) { - let result = Array.prototype.concat.call(o,o,true,[1,2],other) - if (!arrayEq(result, [1,2,3,1,2,3,true,1,2,other])) - throw "failed with spread got: " + result; - } - - // Test it works with strings - String.prototype[Symbol.isConcatSpreadable] = true; - for (let i = 0; i < 100000; i++) { - let result = Array.prototype.concat.call("hi","hi") - // This is what the spec says is the correct answer... D: - if (!arrayEq(result, ["h", "i", "hi"])) - throw "failed with string got: " + result + " on iteration " + i; - } -} diff --git a/implementation-contributed/javascriptcore/stress/array-concat-spread-proxy-exception-check.js b/implementation-contributed/javascriptcore/stress/array-concat-spread-proxy-exception-check.js deleted file mode 100644 index 81b06ccbd1..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-concat-spread-proxy-exception-check.js +++ /dev/null @@ -1,34 +0,0 @@ -function arrayEq(a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) { - if (a[i] !== b[i]) - return false; - } - return true; -} - -{ - let concat = Array.prototype.concat; - noInline(concat); - let array = [1, 2, 3]; - let {proxy:p, revoke} = Proxy.revocable(array, { get : function(o, k) { return o[k]; } }); - - concat.call(p,p); - - for (let i = 0; i < 100000; i++) { - if (!arrayEq(concat.call(p,p), [1,2,3,1,2,3])) - throw "bad"; - } - revoke(); - failed = true; - try { - concat.call(p,p); - } catch (e) { - failed = false; - } - - if (failed) - throw "bad" - -} diff --git a/implementation-contributed/javascriptcore/stress/array-concat-spread-proxy.js b/implementation-contributed/javascriptcore/stress/array-concat-spread-proxy.js deleted file mode 100644 index 0726f62aee..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-concat-spread-proxy.js +++ /dev/null @@ -1,40 +0,0 @@ -// This file tests is concat spreadable. - -function arrayEq(a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) { - if (a[i] !== b[i]) - return false; - } - return true; -} - - -{ - let array = [1,2,3]; - let {proxy:p, revoke} = Proxy.revocable(array, { get : function(o, k) { return o[k]; } }); - - // Test it works with proxies by default - for (let i = 0; i < 100000; i++) { - if (!arrayEq(Array.prototype.concat.call(p,p), [1,2,3,1,2,3])) - throw "failed normally with a proxy" - } - - // Test it works with spreadable false. - p[Symbol.isConcatSpreadable] = false; - for (let i = 0; i < 100000; i++) { - if (!arrayEq(Array.prototype.concat.call(p,p), [p,p])) - throw "failed with no spread" - } - - p[Symbol.isConcatSpreadable] = undefined; - revoke(); - passed = true; - try { - Array.prototype.concat.call(p,[]); - passed = false; - } catch (e) { } - if (!passed) - throw "failed to throw spreading revoked proxy"; -} diff --git a/implementation-contributed/javascriptcore/stress/array-concat-with-slow-indexingtypes.js b/implementation-contributed/javascriptcore/stress/array-concat-with-slow-indexingtypes.js deleted file mode 100644 index 492efb1ff3..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-concat-with-slow-indexingtypes.js +++ /dev/null @@ -1,35 +0,0 @@ -function arrayEq(a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) { - if (a[i] !== b[i]) - return false; - } - return true; -} - - -{ - - array = [1,2]; - Object.defineProperty(array, 2, { get: () => { return 1; } }); - - for (let i = 0; i < 100000; i++) { - if (!arrayEq(Array.prototype.concat.call(array,array), [1,2,1,1,2,1])) - throw "failed normally with a getter" - if (!arrayEq(Array.prototype.concat.call([],array), [1,2,1])) - throw "failed with undecided and a getter" - } - - // Test with indexed types on prototype. - array = [1,2]; - array.length = 3; - Array.prototype[2] = 1; - - for (let i = 0; i < 100000; i++) { - if (!arrayEq(Array.prototype.concat.call(array,array), [1,2,1,1,2,1])) - throw "failed normally with an indexed prototype" - if (!arrayEq(Array.prototype.concat.call([],array), [1,2,1])) - throw "failed with undecided and an indexed prototype" - } -} diff --git a/implementation-contributed/javascriptcore/stress/array-constructor-no-result.js b/implementation-contributed/javascriptcore/stress/array-constructor-no-result.js deleted file mode 100644 index be2df9f5ad..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-constructor-no-result.js +++ /dev/null @@ -1,13 +0,0 @@ -var o = {}; -o.__defineSetter__("foo", Array); - -function foo() -{ - o.foo = 42; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) - foo(); - diff --git a/implementation-contributed/javascriptcore/stress/array-copywithin.js b/implementation-contributed/javascriptcore/stress/array-copywithin.js deleted file mode 100644 index 983fed7ecc..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-copywithin.js +++ /dev/null @@ -1,281 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldBeArray(actual, expected) { - shouldBe(actual.length, expected.length); - for (var i = 0; i < expected.length; ++i) { - try { - shouldBe(actual[i], expected[i]); - } catch(e) { - print(JSON.stringify(actual)); - throw e; - } - } -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -shouldBe([].copyWithin.name, 'copyWithin'); -shouldBe([].copyWithin.length, 2); -shouldBe(Array.prototype.hasOwnProperty('copyWithin'), true); -shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(Array.prototype, 'copyWithin')), '{"writable":true,"enumerable":false,"configurable":true}'); - -// 0 arguments. (it is equivalent to copyWithin(0)) -shouldBeArray([1, 2, 3, 4, 5].copyWithin(), [1, 2, 3, 4, 5]); -shouldBeArray([].copyWithin(), []); - -// 1 arguments. -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-5), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-4), [1, 1, 2, 3, 4]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3), [1, 2, 1, 2, 3]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-2), [1, 2, 3, 1, 2]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-1), [1, 2, 3, 4, 1]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(1), [1, 1, 2, 3, 4]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(2), [1, 2, 1, 2, 3]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(3), [1, 2, 3, 1, 2]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(4), [1, 2, 3, 4, 1]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(5), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(6), [1, 2, 3, 4, 5]); - -// 2 arguments. -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 0), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 1), [2, 3, 4, 5, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 2), [3, 4, 5, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 3), [4, 5, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 4), [5, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 5), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 6), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(1, 3), [1, 4, 5, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(2, 3), [1, 2, 4, 5, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(3, 3), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(4, 3), [1, 2, 3, 4, 4]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(5, 3), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(6, 3), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-1, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-1, -2), [1, 2, 3, 4, 4]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-1, -3), [1, 2, 3, 4, 3]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -3), [3, 4, 5, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -8), [1, 2, 3, 4, 5]); - -// 3 arguments. -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 3, 4), [4, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 0, 5), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 1, 1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 1, 2), [2, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 1, 3), [2, 3, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 1, 4), [2, 3, 4, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 1, 5), [2, 3, 4, 5, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 1, 6), [2, 3, 4, 5, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(2, 1, 3), [1, 2, 2, 3, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(6, 1, 3), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -0, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 0, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -1, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -2, -1), [4, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -3, -1), [3, 4, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -4, -1), [2, 3, 4, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -5, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -6, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, 0, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -1, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -2, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -3, -2), [3, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -4, -2), [2, 3, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -5, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -6, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -0, -1), [1, 2, 1, 2, 3]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, 0, -1), [1, 2, 1, 2, 3]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -1, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -2, -1), [1, 2, 4, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -3, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -4, -1), [1, 2, 2, 3, 4]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -5, -1), [1, 2, 1, 2, 3]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -6, -1), [1, 2, 1, 2, 3]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, 0, -2), [1, 2, 1, 2, 3]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -1, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -2, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -3, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -4, -2), [1, 2, 2, 3, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -5, -2), [1, 2, 1, 2, 3]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -6, -2), [1, 2, 1, 2, 3]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -1, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -1, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -1, -3), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -1, -4), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -1, -5), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(0, -1, -6), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -2, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -2, -3), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -2, -4), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-3, -2, -5), [1, 2, 3, 4, 5]); - -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -0, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, 0, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, 0, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, 0, 5), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, 1, 1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, 1, 2), [2, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, 1, 3), [2, 3, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, 1, 4), [2, 3, 4, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, 1, 5), [2, 3, 4, 5, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, 1, 6), [2, 3, 4, 5, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, 1, 3), [2, 3, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, 1, 3), [2, 3, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, 3, 4), [4, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -1, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -2, -1), [4, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -3, -1), [3, 4, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -4, -1), [2, 3, 4, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -5, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -6, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -1, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -2, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -3, -2), [3, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -4, -2), [2, 3, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -5, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -6, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -1, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -2, -1), [4, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -3, -1), [3, 4, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -4, -1), [2, 3, 4, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -5, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -6, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -1, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -2, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -3, -2), [3, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -4, -2), [2, 3, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -5, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -6, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -1, -1), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -1, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -1, -3), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -1, -4), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -1, -5), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -1, -6), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -2, -2), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -2, -3), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -2, -4), [1, 2, 3, 4, 5]); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-6, -2, -5), [1, 2, 3, 4, 5]); - -shouldBeArray([1, 2, 3, 4, 5].copyWithin(NaN, 1), [1, 2, 3, 4, 5].copyWithin(0, 1)); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(NaN, NaN, 1), [1, 2, 3, 4, 5].copyWithin(0, 0, 1)); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(NaN, NaN, NaN), [1, 2, 3, 4, 5].copyWithin(0, 0, 0)); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(Infinity, 0, 1), [1, 2, 3, 4, 5].copyWithin(5, 0, 1)); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(Infinity, Infinity, 1), [1, 2, 3, 4, 5].copyWithin(5, 5, 1)); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(1, Infinity, 1), [1, 2, 3, 4, 5].copyWithin(1, 5, 1)); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(1, -Infinity, 1), [1, 2, 3, 4, 5].copyWithin(1, 0, 1)); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(-Infinity, 0, 1), [1, 2, 3, 4, 5].copyWithin(0, 0, 1)); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(1, 0, Infinity), [1, 2, 3, 4, 5].copyWithin(1, 0, 5)); -shouldBeArray([1, 2, 3, 4, 5].copyWithin(1, 0, -Infinity), [1, 2, 3, 4, 5].copyWithin(1, 0, 0)); - -var copyWithin = Array.prototype.copyWithin; - -function arrayToObject(array) { - var object = {}; - for (var [key, value] of array.entries()) { - object[key] = value; - } - object.length = array.length; - return object; -} -var object = arrayToObject([1, 2, 3, 4, 5]); -object.length = -Infinity; -shouldBeArray(copyWithin.call(object, 1), { length: -Infinity }); -shouldBe(JSON.stringify(copyWithin.call(object, 1)), '{"0":1,"1":2,"2":3,"3":4,"4":5,"length":null}'); - -var object = arrayToObject([1, 2, 3, 4, 5]); -object.length = -Infinity; -shouldBe(JSON.stringify(copyWithin.call(object, 1)), '{"0":1,"1":2,"2":3,"3":4,"4":5,"length":null}'); - -var array = [1, 2, 3, 4, 5]; -var same = array.copyWithin(0, 3); -shouldBeArray(same, [4, 5, 3, 4, 5]); -shouldBeArray(array, [4, 5, 3, 4, 5]); -shouldBe(same, array); - -shouldBe(JSON.stringify([].copyWithin.call({length: 5, 3: 1}, 0, 3)), '{"0":1,"3":1,"length":5}'); -shouldBe(JSON.stringify([].copyWithin.call(new Int32Array([1, 2, 3, 4, 5]), 0, 3, 4)), '{"0":4,"1":2,"2":3,"3":4,"4":5}'); - -shouldBe(JSON.stringify([].copyWithin.call({length: 5.5, 3: 1}, 0, 3)), '{"0":1,"3":1,"length":5.5}'); -shouldBe(JSON.stringify([].copyWithin.call({length: 5.5, 3: 1}, 0.1, 3)), '{"0":1,"3":1,"length":5.5}'); -shouldBe(JSON.stringify([].copyWithin.call({length: 5.5, 3: 1}, 0.1, 3.3)), '{"0":1,"3":1,"length":5.5}'); -shouldBe(JSON.stringify([].copyWithin.call({length: 5.5, 3: 1}, 0.1, 3.8)), '{"0":1,"3":1,"length":5.5}'); -shouldBe(JSON.stringify([].copyWithin.call({length: 5.5, 3: 1}, 0.1, 4.1)), '{"3":1,"length":5.5}'); - -var object = arrayToObject([1, 2, 3, 4, 5]); -delete object[2]; -delete object[3]; -delete object[4]; -var result = copyWithin.call(object, 0, 3, 5); -shouldBe(JSON.stringify(result), '{"length":5}'); - -// 'copyWithin' in Array's @unscopables -(function () { - var array = []; - var copyWithin = 42; - var forEach = 42; - with (array) { - shouldBe(copyWithin, 42); - shouldBe(forEach, [].forEach); - } -}()); - -shouldThrow(function () { - Array.prototype.copyWithin.call(undefined); -}, 'TypeError: Array.prototype.copyWithin requires that |this| not be null or undefined'); - -shouldThrow(function () { - Array.prototype.copyWithin.call(null); -}, 'TypeError: Array.prototype.copyWithin requires that |this| not be null or undefined'); - - -function valueOf(code) { - return { - valueOf() { - throw new Error(code); - } - }; -} - -shouldThrow(function () { - var object = arrayToObject([1, 2, 3, 4, 5]); - object.length = valueOf(0); - copyWithin.call(object, valueOf(1), valueOf(2), valueOf(3)); -}, 'Error: 0'); - -shouldThrow(function () { - var object = arrayToObject([1, 2, 3, 4, 5]); - copyWithin.call(object, valueOf(1), valueOf(2), valueOf(3)); -}, 'Error: 1'); - -shouldThrow(function () { - var object = arrayToObject([1, 2, 3, 4, 5]); - copyWithin.call(object, 0, valueOf(2), valueOf(3)); -}, 'Error: 2'); - -shouldThrow(function () { - var object = arrayToObject([1, 2, 3, 4, 5]); - copyWithin.call(object, 0, 1, valueOf(3)); -}, 'Error: 3'); - -shouldThrow(function () { - var object = arrayToObject([1, 2, 3, 4, 5]); - Object.freeze(object); - copyWithin.call(object, 0, 1, 2); -}, 'TypeError: Attempted to assign to readonly property.'); diff --git a/implementation-contributed/javascriptcore/stress/array-fill-put-by-val.js b/implementation-contributed/javascriptcore/stress/array-fill-put-by-val.js deleted file mode 100644 index 29eefef98b..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-fill-put-by-val.js +++ /dev/null @@ -1,44 +0,0 @@ -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -var array = new Array(10); - -for (var i = 0; i < 10; ++i) { - (function (index) { - var seenOnce = false; - var storage = null; - Object.defineProperty(Array.prototype, index, { - get() { - throw new Error('get is called.' + index); - return storage; - }, - set(value) { - if (seenOnce) - throw new Error('set is called.' + index); - seenOnce = true; - storage = value; - return storage; - } - }); - }(i)); -} - -// No error, but all seenOnce becomes true. -array.fill(42); - -// Ensures that all setter is called once. -for (var i = 0; i < 10; ++i) { - shouldThrow(function () { - array[i] = i; - }, "Error: set is called." + i); -} diff --git a/implementation-contributed/javascriptcore/stress/array-filter-put-by-val-direct.js b/implementation-contributed/javascriptcore/stress/array-filter-put-by-val-direct.js deleted file mode 100644 index 0a92d812a2..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-filter-put-by-val-direct.js +++ /dev/null @@ -1,27 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -for (var i = 0; i < 10; ++i) { - Object.defineProperty(Array.prototype, i, { - get() { - throw new Error('get is called.'); - }, - set(value) { - throw new Error('set is called.'); - } - }); -} - -var original = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; - -// Doesn't throw any errors. -var filtered = original.filter(function (value, index) { - return index % 2 == 0; -}); - -shouldBe(filtered.length, 5); -for (var i = 0; i < 5; ++i) { - shouldBe(filtered[i], i * 2); -} diff --git a/implementation-contributed/javascriptcore/stress/array-find-does-not-lookup-twice.js b/implementation-contributed/javascriptcore/stress/array-find-does-not-lookup-twice.js deleted file mode 100644 index 87f767ff59..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-find-does-not-lookup-twice.js +++ /dev/null @@ -1,47 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -var array = new Array(10); - -for (var i = 0; i < 10; ++i) { - (function (index) { - var seenOnce = false; - Object.defineProperty(array, index, { - get() { - if (seenOnce) - throw new Error('get is called.' + index); - seenOnce = true; - return index; - } - }); - }(i)); -} - -shouldBe(array.length, 10); - -// Doesn't throw any errors. -var findValue = array.find(function (value) { - return value === 9; -}); -shouldBe(findValue, 9); - -for (var i = 0; i < 10; ++i) { - shouldThrow(function () { - var value = array[i]; - }, "Error: get is called." + i); -} diff --git a/implementation-contributed/javascriptcore/stress/array-flatmap.js b/implementation-contributed/javascriptcore/stress/array-flatmap.js deleted file mode 100644 index 1d1e4d04c9..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-flatmap.js +++ /dev/null @@ -1,97 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldBeArray(actual, expected) { - shouldBe(actual.length, expected.length); - for (var i = 0; i < expected.length; ++i) { - try { - if (Array.isArray(expected[i])) { - shouldBe(Array.isArray(actual[i]), true); - shouldBeArray(actual[i], expected[i]); - } else - shouldBe(actual[i], expected[i]); - } catch(e) { - print(JSON.stringify(actual)); - throw e; - } - } -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -shouldThrow(() => { - [].flatMap(); -}, `TypeError: Array.prototype.flatMap callback must be a function`); - -var array = [42]; -shouldBeArray(array.flatMap(function (v) { - "use strict"; - shouldBe(v, 42); - return this; -}, `Cocoa`), [`Cocoa`]); - -shouldBeArray([].flatMap((v) => v), []); -shouldBeArray([42].flatMap((v) => v), [42]); -shouldBeArray([42].flatMap((v) => [v]), [42]); -shouldBeArray([42].flatMap((v) => [[v]]), [[42]]); -shouldBeArray([42].flatMap((v) => [v, v, v]), [42,42,42]); -shouldBeArray([42,[43],44].flatMap((v) => [v, v]), [42,42,[43],[43],44,44]); -shouldBeArray([,,,,,,].flatMap((v) => [v, v]), []); -shouldBeArray([42,43,44].flatMap((v) => []), []); -shouldBeArray([42,[43],44].flatMap((v) => v), [42,43,44]); - -class DerivedArray extends Array { } -shouldBe((new DerivedArray).flatMap(() => {}) instanceof DerivedArray, true); -var flatMap = [].flatMap; -var realm = createGlobalObject(); -shouldBe(flatMap.call({}, () => {}) instanceof Array, true); -shouldBe(flatMap.call(new realm.Array, () => {}) instanceof Array, true); -var array2 = new realm.Array; -array2.constructor = 0; - -shouldThrow(() => { - flatMap.call(array2, () => {}); -}, `TypeError: 0 is not a constructor`); - -var array2 = new realm.Array; -array2.constructor = undefined; -shouldBe(flatMap.call(array2, () => {}) instanceof Array, true); - -var array2 = new realm.Array; -array2.constructor = { - get [Symbol.species]() { - return null; - } -}; -shouldBe(flatMap.call(array2, () => {}) instanceof Array, true); - -var array2 = new realm.Array; -array2.constructor = { - get [Symbol.species]() { - return undefined; - } -}; -shouldBe(flatMap.call(array2, () => {}) instanceof Array, true); - -var array2 = new realm.Array; -array2.constructor = { - get [Symbol.species]() { - return DerivedArray; - } -}; -shouldBe(flatMap.call(array2, () => {}) instanceof DerivedArray, true); diff --git a/implementation-contributed/javascriptcore/stress/array-flatten.js b/implementation-contributed/javascriptcore/stress/array-flatten.js deleted file mode 100644 index b1a7c085d6..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-flatten.js +++ /dev/null @@ -1,108 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldBeArray(actual, expected) { - shouldBe(actual.length, expected.length); - for (var i = 0; i < expected.length; ++i) { - try { - if (Array.isArray(expected[i])) { - shouldBe(Array.isArray(actual[i]), true); - shouldBeArray(actual[i], expected[i]); - } else - shouldBe(actual[i], expected[i]); - } catch(e) { - print(JSON.stringify(actual)); - throw e; - } - } -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -shouldBe([].flat.length, 0); -shouldBe([].flat.name, `flat`); - -shouldBeArray([].flat(), []); -shouldBeArray([0, 1, 2, 3, , 4].flat(), [0, 1, 2, 3, 4]); -shouldBeArray([,,,,,].flat(), []); - -shouldBeArray([].flat(0), []); -shouldBeArray([0, 1, 2, 3, , 4].flat(0), [0, 1, 2, 3, 4]); -shouldBeArray([,,,,,].flat(0), []); - -shouldBeArray([].flat(-1), []); -shouldBeArray([0, 1, 2, 3, , 4].flat(-1), [0, 1, 2, 3, 4]); -shouldBeArray([,,,,,].flat(-1), []); - -shouldBeArray([[],[]].flat(), []); -shouldBeArray([[0],[1]].flat(), [0,1]); -shouldBeArray([[0],[],1].flat(), [0,1]); -shouldBeArray([[0],[[]],1].flat(), [0,[],1]); -shouldBeArray([[0],[[]],1].flat(1), [0,[],1]); -shouldBeArray([[0],[[]],1].flat(2), [0,1]); - -shouldBeArray([[],[]].flat(0), [[],[]]); -shouldBeArray([[0],[1]].flat(0), [[0],[1]]); -shouldBeArray([[0],[],1].flat(0), [[0],[],1]); -shouldBeArray([[0],[[]],1].flat(0), [[0],[[]],1]); - -shouldBeArray([[[[[[[[[[[[[[[[[[[[[42]]]]]]]]]]]]]]]]]]]]].flat(Infinity), [42]); - -var array = []; -shouldBe(array.flat() !== array, true); - -class DerivedArray extends Array { } -shouldBe((new DerivedArray).flat() instanceof DerivedArray, true); -var flat = [].flat; -var realm = createGlobalObject(); -shouldBe(flat.call({}) instanceof Array, true); -shouldBe(flat.call(new realm.Array) instanceof Array, true); -var array2 = new realm.Array; -array2.constructor = 0; - -shouldThrow(() => { - flat.call(array2); -}, `TypeError: 0 is not a constructor`); - -var array2 = new realm.Array; -array2.constructor = undefined; -shouldBe(flat.call(array2) instanceof Array, true); - -var array2 = new realm.Array; -array2.constructor = { - get [Symbol.species]() { - return null; - } -}; -shouldBe(flat.call(array2) instanceof Array, true); - -var array2 = new realm.Array; -array2.constructor = { - get [Symbol.species]() { - return undefined; - } -}; -shouldBe(flat.call(array2) instanceof Array, true); - -var array2 = new realm.Array; -array2.constructor = { - get [Symbol.species]() { - return DerivedArray; - } -}; -shouldBe(flat.call(array2) instanceof DerivedArray, true); diff --git a/implementation-contributed/javascriptcore/stress/array-from-abs-and-floor.js b/implementation-contributed/javascriptcore/stress/array-from-abs-and-floor.js deleted file mode 100644 index 8bbb48a152..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-from-abs-and-floor.js +++ /dev/null @@ -1,42 +0,0 @@ -function target1() { - return Array.from({ - length: 5, - 0: 0, - 1: 0, - 2: 0, - 3: 0, - 4: 0 - }); -} -noInline(target1); - -function target2() { - return Array.from({ - length: 5.4, - 0: 0, - 1: 0, - 2: 0, - 3: 0, - 4: 0 - }); -} -noInline(target2); - -function target3() { - return Array.from({ - length: -5.4, - 0: 0, - 1: 0, - 2: 0, - 3: 0, - 4: 0 - }); -} -noInline(target3); - -for (var i = 0; i < 10000; ++i) - target1(); -for (var i = 0; i < 10000; ++i) - target2(); -for (var i = 0; i < 10000; ++i) - target3(); diff --git a/implementation-contributed/javascriptcore/stress/array-from-put-by-val-direct.js b/implementation-contributed/javascriptcore/stress/array-from-put-by-val-direct.js deleted file mode 100644 index fc8792f730..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-from-put-by-val-direct.js +++ /dev/null @@ -1,25 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -for (var i = 0; i < 10; ++i) { - Object.defineProperty(Array.prototype, i, { - get() { - throw new Error('get is called.'); - }, - set(value) { - throw new Error('set is called.'); - } - }); -} - -var original = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; - -// Doesn't throw any errors. -var generated = Array.from(original); - -shouldBe(generated.length, 10); -for (var i = 0; i < 10; ++i) { - shouldBe(generated[i], i); -} diff --git a/implementation-contributed/javascriptcore/stress/array-from-set-length.js b/implementation-contributed/javascriptcore/stress/array-from-set-length.js deleted file mode 100644 index ab6adeadb0..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-from-set-length.js +++ /dev/null @@ -1,45 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -for (var i = 0; i < 10; ++i) { - Object.defineProperty(Array.prototype, i, { - get() { - throw new Error('get is called.'); - }, - set(value) { - throw new Error('set is called.'); - } - }); -} - -class ArrayLike { - constructor(length) { - this.lengthCalled = false; - this._length = length; - } - set length(value) { - this.lengthCalled = true; - this._length = value; - } - get length() { - return this._length; - } -} - -var arrayLike = new ArrayLike(10); -for (var i = 0; i < 10; ++i) { - arrayLike[i] = i; -} -shouldBe(arrayLike.lengthCalled, false); - -var generated = Array.from.call(ArrayLike, arrayLike); - -shouldBe(generated.length, 10); -shouldBe(generated instanceof ArrayLike, true); -for (var i = 0; i < 10; ++i) { - shouldBe(generated[i], i); -} -shouldBe(arrayLike.lengthCalled, false); -shouldBe(generated.lengthCalled, true); diff --git a/implementation-contributed/javascriptcore/stress/array-from-with-accessors.js b/implementation-contributed/javascriptcore/stress/array-from-with-accessors.js deleted file mode 100644 index cfe65ca063..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-from-with-accessors.js +++ /dev/null @@ -1,22 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var array = [0, 1, 2, 3, 4, 5]; -Object.defineProperty(Array.prototype, '0', { - get() { - throw new Error('cannot get to 0 getter'); - }, - set() { - throw new Error('cannot put to 0 setter'); - } -}); - -var result = Array.from(array); -shouldBe(result.length, array.length); -shouldBe(result instanceof Array, true); - -for (var i = 0; i < array.length; ++i) - shouldBe(result[i], array[i]); - diff --git a/implementation-contributed/javascriptcore/stress/array-from-with-iterable.js b/implementation-contributed/javascriptcore/stress/array-from-with-iterable.js deleted file mode 100644 index 67e0a2824b..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-from-with-iterable.js +++ /dev/null @@ -1,69 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -// Set is iterable. -var set = new Set([0, 1, 2, 3, 4, 5]); -var array = Array.from(set); - -shouldBe(array.length, set.size); -for (var i = 0; i < array.length; ++i) { - shouldBe(set.has(array[i]), true); -} - -// Map is iterable. -var map = new Map([ - [0, 0], - [1, 0], - [2, 0], - [3, 0], - [4, 0], - [5, 0] -]); -var array = Array.from(map); - -shouldBe(array.length, map.size); -for (var i = 0; i < array.length; ++i) { - shouldBe(array[i][1], 0); - shouldBe(map.has(array[i][0]), true); - shouldBe(map.get(array[i][0]), 0); -} - -// String is iterable -var string = "Cocoa Cappuccino"; -var array = Array.from(string); -shouldBe(array.length, string.length); -for (var i = 0; i < array.length; ++i) { - shouldBe(array[i], string[i]); -} - -// Arguments is iterable -var argumentsGenerators = [ - function () { - return arguments; - }, - - function () { - 'use strict'; - return arguments; - }, - - function (a, b, c) { - return arguments; - }, - - function (a, b, c) { - 'use strict'; - return arguments; - } -]; - -for (var gen of argumentsGenerators) { - var args = gen(1, 2, 3, 4, 5); - var array = Array.from(args); - shouldBe(array.length, args.length); - for (var i = 0; i < array.length; ++i) { - shouldBe(array[i], args[i]); - } -} diff --git a/implementation-contributed/javascriptcore/stress/array-from-with-iterator.js b/implementation-contributed/javascriptcore/stress/array-from-with-iterator.js deleted file mode 100644 index 6d645e4a96..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-from-with-iterator.js +++ /dev/null @@ -1,129 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -var originalArray = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; - -var array = Array.from(originalArray.values()); -shouldBe(array.length, originalArray.length); -for (var i = 0; i < array.length; ++i) { - shouldBe(array[i], originalArray[i]); -} - -function createIterator(callback) { - var array = [0,1,2,3,4,5]; - var iterator = array[Symbol.iterator](); - iterator.return = function () { - iterator.returned = true; - if (callback) - return callback(this); - return { done: true, value: undefined }; - }; - iterator.returned = false; - return iterator; -} - -var iterator = createIterator(); -var result = Array.from(iterator); -shouldBe(result.length, 6); -for (var i = 0; i < 6; ++i) { - shouldBe(result[i], i); -} -shouldBe(iterator.returned, false); - -// mapFn raises an error. -var iterator = createIterator(); -shouldThrow(function () { - var result = Array.from(iterator, function () { - throw new Error('map func'); - }); -}, "Error: map func"); -shouldBe(iterator.returned, true); - -// mapFn raises an error and iterator.return also raises an error. -var iterator = createIterator(function () { - throw new Error('iterator.return'); -}); - -// An error raised in iterator.return is discarded. -shouldThrow(function () { - var result = Array.from(iterator, function () { - throw new Error('map func'); - }); -}, "Error: map func"); -shouldBe(iterator.returned, true); - -// iterable[Symbol.iterator] is not a function. -shouldThrow(function () { - var iterator = [].values(); - iterator[Symbol.iterator] = {}; - Array.from(iterator); -}, "TypeError: Array.from requires that the property of the first argument, items[Symbol.iterator], when exists, be a function"); - -// iterable[Symbol.iterator] raises an error. -shouldThrow(function () { - var iterable = []; - iterable[Symbol.iterator] = function () { - throw new Error("iterator"); - }; - Array.from(iterable); -}, "Error: iterator"); - -// iterable[Symbol.iterator] lookup is only once. -(function () { - var iterable = [0, 1, 2, 3, 4, 5]; - var count = 0; - var iteratorCallCount = 0; - Object.defineProperty(iterable, Symbol.iterator, { - get() { - ++count; - return function () { - ++iteratorCallCount; - return this.values(); - }; - } - }); - var generated = Array.from(iterable); - shouldBe(generated.length, iterable.length); - for (var i = 0; i < iterable.length; ++i) { - shouldBe(generated[i], iterable[i]); - } - shouldBe(count, 1); - shouldBe(iteratorCallCount, 1); -}()); - -// The Symbol.iterator method of the iterator generated by iterable[Symbol.iterator] is not looked up. -(function () { - var iterable = [0, 1, 2, 3, 4, 5]; - var count = 0; - iterable[Symbol.iterator] = function () { - ++count; - var iterator = this.values(); - Object.defineProperty(iterator, Symbol.iterator, { - get() { - throw new Error('iterator[@@iterator] is touched'); - } - }); - return iterator; - }; - var generated = Array.from(iterable); - shouldBe(generated.length, iterable.length); - for (var i = 0; i < iterable.length; ++i) { - shouldBe(generated[i], iterable[i]); - } - shouldBe(count, 1); -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-array-prototype-change.js b/implementation-contributed/javascriptcore/stress/array-indexof-array-prototype-change.js deleted file mode 100644 index 1280d9b25b..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-array-prototype-change.js +++ /dev/null @@ -1,24 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function indexOfInt32(array, value) - { - return array.indexOf(value); - } - noInline(indexOfInt32); - var int32Array = [0, 1, 2, 3, 4, , 6, 7, 8, 9, 10, 11, 12]; - - var value = -1; - for (var i = 0; i < 1e5; ++i) { - shouldBe(indexOfInt32(int32Array, 5), value); - shouldBe(indexOfInt32(int32Array, 6), 6); - if (i === 1e4) { - Array.prototype[5] = 5; - value = 5; - } - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-arraystorage.js b/implementation-contributed/javascriptcore/stress/array-indexof-arraystorage.js deleted file mode 100644 index 0686f04bef..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-arraystorage.js +++ /dev/null @@ -1,85 +0,0 @@ -// ArrayIndexOf intrinsic does not support ArrayStorage. -// Thus, if ArrayStorage comes, we should not use that intrinsic. - -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function indexOfInt32Other(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfInt32Other); - - function indexOfInt32Cell(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfInt32Cell); - - function indexOfInt32Boolean(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfInt32Boolean); - - function indexOfDoubleOther(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfDoubleOther); - - function indexOfDoubleCell(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfDoubleCell); - - function indexOfDoubleBoolean(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfDoubleBoolean); - - function indexOfInt32(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfInt32); - - function indexOfDouble(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfDouble); - - var key = {}; - var int32Array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; - var doubleArray = [0, 1, 2, 3, 4.2, 5, 6, 7, 8, 9, 10.5, 11, 12]; - - ensureArrayStorage(int32Array); - ensureArrayStorage(doubleArray); - - for (var i = 0; i < 1e4; ++i) { - shouldBe(indexOfInt32Other(int32Array, null, 0), -1); - shouldBe(indexOfInt32Other(int32Array, undefined, 0), -1); - shouldBe(indexOfInt32Cell(int32Array, key, 0), -1); - shouldBe(indexOfInt32Cell(int32Array, Symbol("Cocoa"), 0), -1); - shouldBe(indexOfInt32Cell(int32Array, "Cocoa", 0), -1); - shouldBe(indexOfInt32Boolean(int32Array, true, 0), -1); - shouldBe(indexOfInt32Boolean(int32Array, false, 0), -1); - shouldBe(indexOfInt32(int32Array, 12, 0), 12); - - shouldBe(indexOfDoubleOther(doubleArray, null, 0), -1); - shouldBe(indexOfDoubleOther(doubleArray, undefined, 0), -1); - shouldBe(indexOfDoubleCell(doubleArray, key, 0), -1); - shouldBe(indexOfDoubleCell(doubleArray, Symbol("Cocoa"), 0), -1); - shouldBe(indexOfDoubleCell(doubleArray, "Cocoa", 0), -1); - shouldBe(indexOfDoubleBoolean(doubleArray, true, 0), -1); - shouldBe(indexOfDoubleBoolean(doubleArray, false, 0), -1); - shouldBe(indexOfDouble(doubleArray, 12, 0), 12); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-constant-folding.js b/implementation-contributed/javascriptcore/stress/array-indexof-constant-folding.js deleted file mode 100644 index 527880e87d..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-constant-folding.js +++ /dev/null @@ -1,72 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function indexOfInt32Other(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfInt32Other); - - function indexOfInt32Cell(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfInt32Cell); - - function indexOfInt32Boolean(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfInt32Boolean); - - function indexOfDoubleOther(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfDoubleOther); - - function indexOfDoubleCell(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfDoubleCell); - - function indexOfDoubleBoolean(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfDoubleBoolean); - - var key = {}; - var int32Array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; - var doubleArray = [0, 1, 2, 3, 4.2, 5, 6, 7, 8, 9, 10.5, 11, 12]; - - for (var i = 0; i < 1e4; ++i) { - shouldBe(indexOfInt32Other(int32Array, null, 0), -1); - shouldBe(indexOfInt32Other(int32Array, undefined, 0), -1); - shouldBe(indexOfInt32Cell(int32Array, key, 0), -1); - shouldBe(indexOfInt32Cell(int32Array, Symbol("Cocoa"), 0), -1); - shouldBe(indexOfInt32Cell(int32Array, "Cocoa", 0), -1); - shouldBe(indexOfInt32Boolean(int32Array, true, 0), -1); - shouldBe(indexOfInt32Boolean(int32Array, false, 0), -1); - - shouldBe(indexOfDoubleOther(doubleArray, null, 0), -1); - shouldBe(indexOfDoubleOther(doubleArray, undefined, 0), -1); - shouldBe(indexOfDoubleCell(doubleArray, key, 0), -1); - shouldBe(indexOfDoubleCell(doubleArray, Symbol("Cocoa"), 0), -1); - shouldBe(indexOfDoubleCell(doubleArray, "Cocoa", 0), -1); - shouldBe(indexOfDoubleBoolean(doubleArray, true, 0), -1); - shouldBe(indexOfDoubleBoolean(doubleArray, false, 0), -1); - } - - shouldBe(indexOfInt32Other(int32Array, 1, 0), 1); - shouldBe(indexOfInt32Cell(int32Array, 1, 0), 1); - shouldBe(indexOfInt32Boolean(int32Array, 1, 0), 1); - shouldBe(indexOfDoubleOther(doubleArray, 1, 0), 1); - shouldBe(indexOfDoubleCell(doubleArray, 1, 0), 1); - shouldBe(indexOfDoubleBoolean(doubleArray, 1, 0), 1); -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-have-a-bad-time-getter.js b/implementation-contributed/javascriptcore/stress/array-indexof-have-a-bad-time-getter.js deleted file mode 100644 index f5fb88da4f..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-have-a-bad-time-getter.js +++ /dev/null @@ -1,28 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function indexOfInt32(array, value) - { - return array.indexOf(value); - } - noInline(indexOfInt32); - var int32Array = [0, 1, 2, 3, 4, , 6, 7, 8, 9, 10, 11, 12]; - - var value = -1; - for (var i = 0; i < 1e5; ++i) { - shouldBe(indexOfInt32(int32Array, 5), value); - shouldBe(indexOfInt32(int32Array, 6), 6); - if (i === 1e4) { - value = 5; - Object.defineProperty(Array.prototype, 5, { - get: function () { - return 5; - } - }); - } - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-have-a-bad-time.js b/implementation-contributed/javascriptcore/stress/array-indexof-have-a-bad-time.js deleted file mode 100644 index 9ed42f6f85..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-have-a-bad-time.js +++ /dev/null @@ -1,35 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function indexOfInt32(array, value) - { - return array.indexOf(value); - } - noInline(indexOfInt32); - var int32Array = [0, 1, 2, 3, 4, , 6, 7, 8, 9, 10, 11, 12]; - - var value = -1; - for (var i = 0; i < 1e5; ++i) { - shouldBe(indexOfInt32(int32Array, 5), value); - shouldBe(indexOfInt32(int32Array, 6), 6); - if (i === 1e4) { - Object.defineProperty(Map.prototype, 5, { - get: function () { - return 42; - } - }); - } - if (i === 3e4) { - value = 5; - Object.defineProperty(Array.prototype, 5, { - get: function () { - return 5; - } - }); - } - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-hole-and-other.js b/implementation-contributed/javascriptcore/stress/array-indexof-hole-and-other.js deleted file mode 100644 index cb87f12f4f..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-hole-and-other.js +++ /dev/null @@ -1,38 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function indexOf(array, value) - { - return array.indexOf(value); - } - noInline(indexOf); - - var array = new Array(100); - - for (var i = 0; i < 1e4; ++i) { - shouldBe(indexOf(array, undefined), -1); - shouldBe(indexOf(array, null), -1); - } -}()); - -(function () { - function indexOf(array, value) - { - return array.indexOf(value); - } - noInline(indexOf); - - var array = new Array(100); - array.push({}); - - for (var i = 0; i < 1e4; ++i) { - shouldBe(indexOf(array, undefined), -1); - shouldBe(indexOf(array, null), -1); - } -}()); - - diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-hole-with-prototype.js b/implementation-contributed/javascriptcore/stress/array-indexof-hole-with-prototype.js deleted file mode 100644 index aa61b81515..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-hole-with-prototype.js +++ /dev/null @@ -1,35 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -Array.prototype[42] = 0; - -(function () { - function indexOf(array, value) - { - return array.indexOf(value); - } - noInline(indexOf); - - var array = new Array(100); - array.push(10); - - for (var i = 0; i < 1e5; ++i) - shouldBe(indexOf(array, 0), 42); -}()); - -(function () { - function indexOf(array, value) - { - return array.indexOf(value); - } - noInline(indexOf); - - var array = new Array(100); - array.push(25.5); - - for (var i = 0; i < 1e5; ++i) - shouldBe(indexOf(array, 0), 42); -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-hole.js b/implementation-contributed/javascriptcore/stress/array-indexof-hole.js deleted file mode 100644 index fb2aa2b3a1..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-hole.js +++ /dev/null @@ -1,33 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function indexOf(array, value) - { - return array.indexOf(value); - } - noInline(indexOf); - - var array = new Array(100); - array.push(10); - - for (var i = 0; i < 1e5; ++i) - shouldBe(indexOf(array, 0), -1); -}()); - -(function () { - function indexOf(array, value) - { - return array.indexOf(value); - } - noInline(indexOf); - - var array = new Array(100); - array.push(25.5); - - for (var i = 0; i < 1e5; ++i) - shouldBe(indexOf(array, 0), -1); -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-index.js b/implementation-contributed/javascriptcore/stress/array-indexof-index.js deleted file mode 100644 index a1a56cd0fe..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-index.js +++ /dev/null @@ -1,63 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function indexOfInt32(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfInt32); - - function indexOfDouble(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfDouble); - - function indexOfString(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfString); - - function indexOfObject(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfObject); - - function indexOfValue(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfValue); - - var key = {}; - var int32Array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; - var doubleArray = [0, 1, 2, 3, 4.2, 5, 6, 7, 8, 9, 10.5, 11, 12]; - var stringArray = [ "cocoa", "cappuccino", "matcha", "rize", "kilimanjaro" ]; - var objectArray = [ {}, {}, {}, {}, {}, key, {}, {}, {} ]; - var valueArray = [ {}, {}, {}, {}, {}, null, {}, {}, {} ]; - - for (var i = 0; i < 1e5; ++i) { - shouldBe(indexOfInt32(int32Array, 3, 0), 3); - shouldBe(indexOfInt32(int32Array, 3, 8), -1); - shouldBe(indexOfDouble(doubleArray, 3, 0), 3); - shouldBe(indexOfDouble(doubleArray, 3, 20), -1); - shouldBe(indexOfDouble(doubleArray, 4.2, 8), -1); - shouldBe(indexOfDouble(doubleArray, 4.2, 0), 4); - shouldBe(indexOfDouble(doubleArray, 4.2, 20), -1); - shouldBe(indexOfString(stringArray, "cocoa", 0), 0); - shouldBe(indexOfString(stringArray, "cocoa", 4), -1); - shouldBe(indexOfString(stringArray, "cocoa", 20), -1); - shouldBe(indexOfObject(objectArray, key, 0), 5); - shouldBe(indexOfObject(objectArray, key, 6), -1); - shouldBe(indexOfObject(objectArray, key, 20), -1); - shouldBe(indexOfValue(valueArray, null, 0), 5); - shouldBe(indexOfValue(valueArray, null, 6), -1); - shouldBe(indexOfValue(valueArray, null, 20), -1); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-negative-index.js b/implementation-contributed/javascriptcore/stress/array-indexof-negative-index.js deleted file mode 100644 index 6de226be79..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-negative-index.js +++ /dev/null @@ -1,72 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function indexOfInt32(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfInt32); - - function indexOfDouble(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfDouble); - - function indexOfString(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfString); - - function indexOfObject(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfObject); - - function indexOfValue(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfValue); - - var key = {}; - var int32Array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; - var doubleArray = [0, 1, 2, 3, 4.2, 5, 6, 7, 8, 9, 10.5, 11, 12]; - var stringArray = [ "cocoa", "cappuccino", "matcha", "rize", "kilimanjaro" ]; - var objectArray = [ {}, {}, {}, {}, {}, key, {}, {}, {} ]; - var valueArray = [ {}, {}, {}, {}, {}, null, {}, {}, {} ]; - - for (var i = 0; i < 1e5; ++i) { - shouldBe(indexOfInt32(int32Array, 3, -2), -1); - shouldBe(indexOfInt32(int32Array, 3, -10), 3); - shouldBe(indexOfInt32(int32Array, 3, -20), 3); - shouldBe(indexOfDouble(doubleArray, 3, -1), -1); - shouldBe(indexOfDouble(doubleArray, 3, -10), 3); - shouldBe(indexOfDouble(doubleArray, 3, -20), 3); - shouldBe(indexOfDouble(doubleArray, 4.2, -8), -1); - shouldBe(indexOfDouble(doubleArray, 4.2, -1), -1); - shouldBe(indexOfDouble(doubleArray, 4.2, -10), 4); - shouldBe(indexOfDouble(doubleArray, 4.2, -20), 4); - shouldBe(indexOfString(stringArray, "cocoa", -1), -1); - shouldBe(indexOfString(stringArray, "cocoa", -4), -1); - shouldBe(indexOfString(stringArray, "cocoa", -5), 0); - shouldBe(indexOfString(stringArray, "cocoa", -20), 0); - shouldBe(indexOfObject(objectArray, key, -1), -1); - shouldBe(indexOfObject(objectArray, key, -2), -1); - shouldBe(indexOfObject(objectArray, key, -3), -1); - shouldBe(indexOfObject(objectArray, key, -4), 5); - shouldBe(indexOfObject(objectArray, key, -6), 5); - shouldBe(indexOfObject(objectArray, key, -20), 5); - shouldBe(indexOfValue(valueArray, null, -1), -1); - shouldBe(indexOfValue(valueArray, null, -3), -1); - shouldBe(indexOfValue(valueArray, null, -4), 5); - shouldBe(indexOfValue(valueArray, null, -6), 5); - shouldBe(indexOfValue(valueArray, null, -20), 5); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-non-int32-start-index.js b/implementation-contributed/javascriptcore/stress/array-indexof-non-int32-start-index.js deleted file mode 100644 index 977d0a2462..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-non-int32-start-index.js +++ /dev/null @@ -1,21 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function indexOf(array, value, index) -{ - return array.indexOf(value, index); -} -noInline(indexOf); - -var object = { - valueOf() - { - return 0; - } -} -var array = [0,1,2,3,4,5,6,7,8,9]; -for (var i = 0; i < 1e5; ++i) - shouldBe(indexOf(array, 9, object), 9); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-object-prototype-change.js b/implementation-contributed/javascriptcore/stress/array-indexof-object-prototype-change.js deleted file mode 100644 index b4c1acc9d4..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-object-prototype-change.js +++ /dev/null @@ -1,24 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function indexOfInt32(array, value) - { - return array.indexOf(value); - } - noInline(indexOfInt32); - var int32Array = [0, 1, 2, 3, 4, , 6, 7, 8, 9, 10, 11, 12]; - - var value = -1; - for (var i = 0; i < 1e5; ++i) { - shouldBe(indexOfInt32(int32Array, 5), value); - shouldBe(indexOfInt32(int32Array, 6), 6); - if (i === 1e4) { - Object.prototype[5] = 5; - value = 5; - } - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-object.js b/implementation-contributed/javascriptcore/stress/array-indexof-object.js deleted file mode 100644 index 26bba01543..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-object.js +++ /dev/null @@ -1,42 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function indexOf(array, value) - { - return array.indexOf(value); - } - noInline(indexOf); - - var array = []; - var object = {}; - for (var i = 0; i < 100; ++i) - array.push({}); - array.push(object); - - for (var i = 0; i < 1e5; ++i) - shouldBe(indexOf(array, object), 100); -}()); - -(function () { - function indexOf(array, value) - { - return array.indexOf(value); - } - noInline(indexOf); - - var array = []; - var object = {}; - for (var i = 0; i < 100; ++i) { - array.push(42); - array.push({}); - array.push(String(i)); - } - array.push(object); - - for (var i = 0; i < 1e5; ++i) - shouldBe(indexOf(array, object), 100 * 3); -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-original-array.js b/implementation-contributed/javascriptcore/stress/array-indexof-original-array.js deleted file mode 100644 index 3290927a2c..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-original-array.js +++ /dev/null @@ -1,46 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function indexOfInt32(array, value) - { - return array.indexOf(value); - } - noInline(indexOfInt32); - var int32Array = [0, 1, 2, 3, 4, , 6, 7, 8, 9, 10, 11, 12]; - - var value = -1; - for (var i = 0; i < 1e5; ++i) { - shouldBe(indexOfInt32(int32Array, 5), value); - shouldBe(indexOfInt32(int32Array, 6), 6); - if (i === 1e4) { - int32Array.hello = 42; - } - } -}()); - - -(function () { - function indexOfInt32(array, value) - { - return array.indexOf(value); - } - noInline(indexOfInt32); - var int32Array = [0, 1, 2, 3, 4, , 6, 7, 8, 9, 10, 11, 12]; - - var value = -1; - for (var i = 0; i < 1e5; ++i) { - shouldBe(indexOfInt32(int32Array, 5), value); - shouldBe(indexOfInt32(int32Array, 6), 6); - if (i === 1e4) { - value = 5; - int32Array.__proto__ = { - __proto__: int32Array.__proto__, - 5: 5 - }; - } - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-other.js b/implementation-contributed/javascriptcore/stress/array-indexof-other.js deleted file mode 100644 index 422362a22a..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-other.js +++ /dev/null @@ -1,50 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function indexOfInt32(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfInt32); - - function indexOfDouble(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfDouble); - - function indexOfString(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfString); - - function indexOfObject(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfObject); - - var key = {}; - var int32Array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; - var doubleArray = [0, 1, 2, 3, 4.2, 5, 6, 7, 8, 9, 10.5, 11, 12]; - var stringArray = [ "cocoa", "cappuccino", "matcha", "rize", "kilimanjaro" ]; - var objectArray = [ {}, {}, {}, {}, {}, key, {}, {}, {}, null, undefined ]; - - for (var i = 0; i < 1e5; ++i) { - shouldBe(indexOfInt32(int32Array, null, 0), -1); - shouldBe(indexOfInt32(int32Array, undefined, 0), -1); - shouldBe(indexOfDouble(doubleArray, null, 0), -1); - shouldBe(indexOfDouble(doubleArray, undefined, 0), -1); - shouldBe(indexOfDouble(doubleArray, null, 0), -1); - shouldBe(indexOfDouble(doubleArray, undefined, 0), -1); - shouldBe(indexOfString(stringArray, null, 0), -1); - shouldBe(indexOfString(stringArray, undefined, 0), -1); - shouldBe(indexOfObject(objectArray, null, 0), 9); - shouldBe(indexOfObject(objectArray, undefined, 0), 10); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-string.js b/implementation-contributed/javascriptcore/stress/array-indexof-string.js deleted file mode 100644 index f0f8804f6c..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-string.js +++ /dev/null @@ -1,37 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function indexOf(array, value) - { - return array.indexOf(value); - } - noInline(indexOf); - - var array = []; - for (var i = 0; i < 100; ++i) - array.push(String(i)); - - for (var i = 0; i < 1e5; ++i) - shouldBe(indexOf(array, "42"), 42); -}()); - -(function () { - function indexOf(array, value) - { - return array.indexOf(value); - } - noInline(indexOf); - - var array = []; - for (var i = 0; i < 100; ++i) { - array.push(String(i + 0.5)); - array.push({}); - } - - for (var i = 0; i < 1e5; ++i) - shouldBe(indexOf(array, "42.5"), 42 * 2); -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-structure-change-convert.js b/implementation-contributed/javascriptcore/stress/array-indexof-structure-change-convert.js deleted file mode 100644 index d998a73353..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-structure-change-convert.js +++ /dev/null @@ -1,32 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function indexOf(array, value) -{ - return array.indexOf(value); -} -noInline(indexOf); - -(function () { - var array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; - var array2 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; - var array3 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; - - array3[9] = 8; - array3[8] = 10.2; - - for (var i = 0; i < 1e6; ++i) - shouldBe(indexOf(array, 8), 8); - - array[9] = 8; - array[8] = 10.2; - - for (var i = 0; i < 1e6; ++i) - shouldBe(indexOf(array, 8), 9); - - for (var i = 0; i < 1e6; ++i) - shouldBe(indexOf(array2, 8), 8); -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-structure-change.js b/implementation-contributed/javascriptcore/stress/array-indexof-structure-change.js deleted file mode 100644 index 7d03865a2d..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-structure-change.js +++ /dev/null @@ -1,20 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function indexOf(array, value) -{ - return array.indexOf(value); -} -noInline(indexOf); - -var array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; -for (var i = 0; i < 1e6; ++i) { - if (i === 1e6 - 1) { - array[8] = "Hello"; - shouldBe(indexOf(array, 8), -1); - } else - shouldBe(indexOf(array, 8), 8); -} diff --git a/implementation-contributed/javascriptcore/stress/array-indexof-symbol.js b/implementation-contributed/javascriptcore/stress/array-indexof-symbol.js deleted file mode 100644 index 9cc2cac13f..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof-symbol.js +++ /dev/null @@ -1,52 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function indexOfInt32(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfInt32); - - function indexOfDouble(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfDouble); - - function indexOfString(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfString); - - function indexOfObject(array, value, index) - { - return array.indexOf(value, index); - } - noInline(indexOfObject); - - var key = {}; - var cocoa = Symbol("Cocoa"); - var cappuccino = Symbol("Cappuccino"); - var int32Array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; - var doubleArray = [0, 1, 2, 3, 4.2, 5, 6, 7, 8, 9, 10.5, 11, 12]; - var stringArray = [ "cocoa", "cappuccino", "matcha", "rize", "kilimanjaro" ]; - var objectArray = [ {}, {}, {}, {}, {}, key, {}, {}, {}, cocoa, cappuccino ]; - - for (var i = 0; i < 1e5; ++i) { - shouldBe(indexOfInt32(int32Array, null, 0), -1); - shouldBe(indexOfInt32(int32Array, undefined, 0), -1); - shouldBe(indexOfDouble(doubleArray, null, 0), -1); - shouldBe(indexOfDouble(doubleArray, undefined, 0), -1); - shouldBe(indexOfDouble(doubleArray, null, 0), -1); - shouldBe(indexOfDouble(doubleArray, undefined, 0), -1); - shouldBe(indexOfString(stringArray, null, 0), -1); - shouldBe(indexOfString(stringArray, undefined, 0), -1); - shouldBe(indexOfObject(objectArray, cocoa, 0), 9); - shouldBe(indexOfObject(objectArray, cappuccino, 0), 10); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-indexof.js b/implementation-contributed/javascriptcore/stress/array-indexof.js deleted file mode 100644 index d530bfe23d..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-indexof.js +++ /dev/null @@ -1,35 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function indexOf(array, value) - { - return array.indexOf(value); - } - noInline(indexOf); - - var array = []; - for (var i = 0; i < 100; ++i) - array.push(i); - - for (var i = 0; i < 1e5; ++i) - shouldBe(indexOf(array, 42), 42); -}()); - -(function () { - function indexOf(array, value) - { - return array.indexOf(value); - } - noInline(indexOf); - - var array = []; - for (var i = 0; i < 100; ++i) - array.push(i + 0.5); - - for (var i = 0; i < 1e5; ++i) - shouldBe(indexOf(array, 42 + 0.5), 42); -}()); diff --git a/implementation-contributed/javascriptcore/stress/array-iterators-next-error-messages.js b/implementation-contributed/javascriptcore/stress/array-iterators-next-error-messages.js deleted file mode 100644 index c0316e60fa..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-iterators-next-error-messages.js +++ /dev/null @@ -1,18 +0,0 @@ -function assert(a, b) { - if (a != b) - throw new Error("assertion failed"); -} - -next = [].values().next; - -try { - next.call(null); -} catch(e) { - assert(e, "TypeError: %ArrayIteratorPrototype%.next requires that |this| not be null or undefined"); -} - -try { - next.call(undefined); -} catch(e) { - assert(e, "TypeError: %ArrayIteratorPrototype%.next requires that |this| not be null or undefined"); -} diff --git a/implementation-contributed/javascriptcore/stress/array-iterators-next-with-call.js b/implementation-contributed/javascriptcore/stress/array-iterators-next-with-call.js deleted file mode 100644 index ab7f87d237..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-iterators-next-with-call.js +++ /dev/null @@ -1,117 +0,0 @@ -// This test checks the behavior of the %ArrayIteratorPrototype%.next methods with call. - -var array = [0, 1, 2, 3, 4]; -var arrayIterator = array[Symbol.iterator](); -var arrayIteratorPrototype = arrayIterator.__proto__; -var arrayIteratorPrototypeNext = arrayIteratorPrototype.next; - -if (arrayIterator.hasOwnProperty('next')) - throw "next method should exists on %ArrayIteratorPrototype%"; -if (!arrayIteratorPrototype.hasOwnProperty('next')) - throw "next method should exists on %ArrayIteratorPrototype%"; - -var array1 = [42, 43, 41]; -var array1Iterator = array1[Symbol.iterator](); -var index = 0; -while (true) { - var result = arrayIteratorPrototypeNext.call(array1Iterator); - var value = result.value; - if (result.done) { - break; - } - if (value !== array1[index++]) - throw "Error: bad value: " + value; -} -if (index !== 3) - throw "Error: bad index: " + index; - -function increment(iter) { - return arrayIteratorPrototypeNext.call(iter); -} -var array1 = [42, 43, -20]; -var array2 = [42, 43, -20]; -var array1Iterator = array1[Symbol.iterator](); -var array2Iterator = array2[Symbol.iterator](); -for (var i = 0; i < 3; ++i) { - var value1 = increment(array1Iterator).value; - var value2 = increment(array2Iterator).value; - if (value1 !== value2) - throw "Error: bad value: " + value1 + " " + value2; -} - -var array1 = [ 0, 1, 2, 4, 5, 6 ]; -var array1Iterator = array1[Symbol.iterator](); - -var value = array1Iterator.next().value; -if (value !== 0) - throw "Error: bad value: " + value; -var value = array1Iterator.next().value; -if (value !== 1) - throw "Error: bad value: " + value; -var value = array1Iterator.next().value; -if (value !== 2) - throw "Error: bad value: " + value; -var value = arrayIteratorPrototypeNext.call(array1Iterator).value; -if (value !== 4) - throw "Error: bad value: " + value; -var value = arrayIteratorPrototypeNext.call(array1Iterator).value; -if (value !== 5) - throw "Error: bad value: " + value; -var value = arrayIteratorPrototypeNext.call(array1Iterator).value; -if (value !== 6) - throw "Error: bad value: " + value; -var value = arrayIteratorPrototypeNext.call(array1Iterator).value; -if (value !== undefined) - throw "Error: bad value: " + value; - -var primitives = [ - "string", - 42, - 0.03, - false, - true, - Symbol("Cocoa"), - null, - undefined -]; -for (var primitive of primitives) { - var didThrow = null; - try { - arrayIteratorPrototypeNext.call(primitive); - } catch (e) { - didThrow = e; - } - if (!didThrow) - throw "Error: no error thrown"; - var expectedMessage = 'TypeError: %ArrayIteratorPrototype%.next requires that |this| be an Array Iterator instance'; - if (primitive === null) - expectedMessage = 'TypeError: %ArrayIteratorPrototype%.next requires that |this| not be null or undefined'; - if (primitive === undefined) - expectedMessage = 'TypeError: %ArrayIteratorPrototype%.next requires that |this| not be null or undefined'; - if (String(didThrow) !== expectedMessage) - throw "Error: bad error thrown: " + didThrow; -} - -var nonRelatedObjects = [ - {}, - [], - new Date(), - new Error(), - Object(Symbol()), - new String("Cappuccino"), - new Number(42), - new Boolean(false), - function () { }, -]; -for (var object of nonRelatedObjects) { - var didThrow = null; - try { - arrayIteratorPrototypeNext.call(object); - } catch (e) { - didThrow = e; - } - if (!didThrow) - throw "Error: no error thrown"; - if (String(didThrow) !== 'TypeError: %ArrayIteratorPrototype%.next requires that |this| be an Array Iterator instance') - throw "Error: bad error thrown: " + didThrow; -} diff --git a/implementation-contributed/javascriptcore/stress/array-iterators-next.js b/implementation-contributed/javascriptcore/stress/array-iterators-next.js deleted file mode 100644 index 200e8038e7..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-iterators-next.js +++ /dev/null @@ -1,108 +0,0 @@ -// This test checks the behavior of the iterator.next methods on Array objects - -var testArray = [1,2,3,4,5,6] -var keys = testArray.keys(); -var i = 0; -while (true) { - var {done, value: key} = keys.next(); - if (done) - break; - if (key !== i) - throw "Error: bad value: " + key; - i++; -} - -if (testArray.length !== i) - throw "Error: bad value: " + i; - -var value = keys.next().value; -if (value !== undefined) - throw "Error: bad value: " + value; - -var values = testArray[Symbol.iterator](); -var i = 0; -while (true) { - var {done, value} = values.next(); - if (done) - break; - i++; - if (value !== i) - throw "Error: bad value: " + value; -} - -if (testArray.length !== i) - throw "Error: bad value: " + i; - -var value = values.next().value; -if (value !== undefined) - throw "Error: bad value: " + value; - -var values = testArray.values(); -var i = 0; -while (true) { - var {done, value} = values.next(); - if (done) - break; - i++; - if (value !== i) - throw "Error: bad value: " + value; -} - -if (testArray.length !== i) - throw "Error: bad value: " + i; - -var value = values.next().value; -if (value !== undefined) - throw "Error: bad value: " + value; - -var entries = testArray.entries(); -var i = 0; -do { - var {done, value: entry} = entries.next(); - if (done) - break; - var [key, value] = entry; - if (value !== testArray[key]) - throw "Error: bad value: " + value + " " + testArray[key]; - if (key !== i) - throw "Error: bad value: " + key; - i++ - if (value !== i) - throw "Error: bad value: " + value + " " + i; -} while (!done); - -if (testArray.length !== i) - throw "Error: bad value: " + i; - -var value = entries.next().value; -if (value !== undefined) - throw "Error: bad value: " + value; - -var entries = testArray.entries(); -var i = 0; -do { - var {done, value: entry} = entries.next(); - if (done) - break; - var [key, value] = entry; - if (value !== testArray[key]) - throw "Error: bad value: " + value + " " + testArray[key]; - if (key !== i) - throw "Error: bad value: " + key; - i++ - if (i % 2 == 0) - testArray[i] *= 2; - if (i < 4) - testArray.push(testArray.length) - if (i == 4) - delete testArray[4] - if (i == 5) - testArray[4] = 5 -} while (!done); - -if (testArray.length !== i) - throw "Error: bad value: " + i; - -var value = entries.next().value; -if (value !== undefined) - throw "Error: bad value: " + value; diff --git a/implementation-contributed/javascriptcore/stress/array-join-on-strings-need-overflow-checks.js b/implementation-contributed/javascriptcore/stress/array-join-on-strings-need-overflow-checks.js deleted file mode 100644 index abe5f36e4f..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-join-on-strings-need-overflow-checks.js +++ /dev/null @@ -1,33 +0,0 @@ -function assert(x, y) { - if (x != y) - throw(" Expect: " + y + ", actual: " + x); -} - -s1 = ""; -for (var k = 0; k < 2000; ++k) - s1 += "z"; -var expectedLength = 2000; -assert(s1.length, 2000); - -s2 = 'x'; -expectedLength = 1; -assert(s2.length, expectedLength); - -for (var i = 0; i < 22; ++i) { - expectedLength += expectedLength; - s2 += s2; - assert(s2.length, expectedLength); -} - -var caughtException; -try { - expectedLength = ((s1.length - 1) * s2.length) + 1; - result = Array.prototype.join.apply(s1, [s2]); - assert(result.length, expectedLength); -} catch (e) { - caughtException = e; -} - -if (!caughtException) - throw("Array.prototype.join should have thrown an exception when string length overflows"); -assert(caughtException, "Error: Out of memory"); diff --git a/implementation-contributed/javascriptcore/stress/array-length-array-storage-plain-object.js b/implementation-contributed/javascriptcore/stress/array-length-array-storage-plain-object.js deleted file mode 100644 index e424933244..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-length-array-storage-plain-object.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(o) { - return o.length; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var a = [1]; - a.length = 99999999; - a.f = 42; - foo(a); -} - -var result = foo({}); -if (result !== void 0) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/array-length-not-writable.js b/implementation-contributed/javascriptcore/stress/array-length-not-writable.js deleted file mode 100644 index 4e325a28f2..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-length-not-writable.js +++ /dev/null @@ -1,22 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} - -let arr = []; -assert(arr.length === 0); -Object.freeze(arr); -assert(arr.length === 0); -arr.length = 5; -assert(arr.length === 0); -arr.length = "test"; -assert(arr.length === 0); - -arr = [1]; -assert(arr.length === 1); -Object.defineProperty(arr, "length", {value: 3, writable: false}); -assert(arr.length === 3); -arr.length = 5; -assert(arr.length === 3); -arr.length = "test"; -assert(arr.length === 3); diff --git a/implementation-contributed/javascriptcore/stress/array-length-plain-object.js b/implementation-contributed/javascriptcore/stress/array-length-plain-object.js deleted file mode 100644 index ed85751727..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-length-plain-object.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo(o) { - return o.length; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var a = [1]; - a.f = 42; - foo(a); -} - -var result = foo({}); -if (result !== void 0) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/array-map-put-by-val-direct.js b/implementation-contributed/javascriptcore/stress/array-map-put-by-val-direct.js deleted file mode 100644 index 88e5cdef02..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-map-put-by-val-direct.js +++ /dev/null @@ -1,27 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -for (var i = 0; i < 10; ++i) { - Object.defineProperty(Array.prototype, i, { - get() { - throw new Error('get is called.'); - }, - set(value) { - throw new Error('set is called.'); - } - }); -} - -var original = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; - -// Doesn't throw any errors. -var mapped = original.map(function (value) { - return value * 2; -}); - -shouldBe(mapped.length, 10); -for (var i = 0; i < 10; ++i) { - shouldBe(mapped[i], i * 2); -} diff --git a/implementation-contributed/javascriptcore/stress/array-pop-array-storage.js b/implementation-contributed/javascriptcore/stress/array-pop-array-storage.js deleted file mode 100644 index cb356bc226..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-pop-array-storage.js +++ /dev/null @@ -1,65 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(array) { - return [array.pop(), array.pop(), array.pop(), array.pop()]; -} - -noInline(test); - -for (var i = 0; i < 1e4; ++i) { - var array = ["foo", "bar", "baz"]; - ensureArrayStorage(array); - var result = test(array); - shouldBe(result[0], "baz"); - shouldBe(result[1], "bar"); - shouldBe(result[2], "foo"); - shouldBe(result[3], undefined); - shouldBe(array.length, 0); -} - -for (var i = 0; i < 1e4; ++i) { - var array = ["foo", "bar", , "baz"]; - ensureArrayStorage(array); - var result = test(array); - shouldBe(result[0], "baz"); - shouldBe(result[1], undefined); - shouldBe(result[2], "bar"); - shouldBe(result[3], "foo"); - shouldBe(array.length, 0); -} - -for (var i = 0; i < 1e4; ++i) { - var array = ["foo", "bar", , "baz", , , "OK"]; - ensureArrayStorage(array); - shouldBe(array.length, 7); - var result = test(array); - shouldBe(result[0], "OK"); - shouldBe(result[1], undefined); - shouldBe(result[2], undefined); - shouldBe(result[3], "baz"); - shouldBe(array.length, 3); - shouldBe(array[0], "foo"); - shouldBe(array[1], "bar"); - shouldBe(array[2], undefined); - shouldBe(array[3], undefined); -} - -for (var i = 0; i < 1e4; ++i) { - var array = ["foo", "bar", "baz"]; - ensureArrayStorage(array); - array.length = 0xffffffff - 1; - shouldBe(array.length, 0xffffffff - 1); - var result = test(array); - shouldBe(result[0], undefined); - shouldBe(result[1], undefined); - shouldBe(result[2], undefined); - shouldBe(result[3], undefined); - shouldBe(array.length, 0xffffffff - 5); - shouldBe(array[0], "foo"); - shouldBe(array[1], "bar"); - shouldBe(array[2], "baz"); - shouldBe(array[3], undefined); -} diff --git a/implementation-contributed/javascriptcore/stress/array-pop-contiguous.js b/implementation-contributed/javascriptcore/stress/array-pop-contiguous.js deleted file mode 100644 index 86333fae12..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-pop-contiguous.js +++ /dev/null @@ -1,11 +0,0 @@ -function foo(array) { - return [array.pop(), array.pop(), array.pop(), array.pop()]; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(["foo", "bar", "baz"]); - if (result.toString() != "baz,bar,foo,") - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/array-pop-double-hole.js b/implementation-contributed/javascriptcore/stress/array-pop-double-hole.js deleted file mode 100644 index 6782ea203e..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-pop-double-hole.js +++ /dev/null @@ -1,14 +0,0 @@ -function foo() { - var array = [1.5, 2, 3.5]; - array.pop(); - array[3] = 4.5; - return array; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(); - if (result.toString() != "1.5,2,,4.5") - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/array-pop-double.js b/implementation-contributed/javascriptcore/stress/array-pop-double.js deleted file mode 100644 index 69c36c5cc7..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-pop-double.js +++ /dev/null @@ -1,11 +0,0 @@ -function foo(array) { - return [array.pop(), array.pop(), array.pop(), array.pop()]; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo([1.5, 2.5, 3.5]); - if (result.toString() != "3.5,2.5,1.5,") - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/array-pop-int32.js b/implementation-contributed/javascriptcore/stress/array-pop-int32.js deleted file mode 100644 index 14075f343c..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-pop-int32.js +++ /dev/null @@ -1,11 +0,0 @@ -function foo(array) { - return [array.pop(), array.pop(), array.pop(), array.pop()]; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo([1, 2, 3]); - if (result.toString() != "3,2,1,") - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/array-profile-should-record-copy-on-write.js b/implementation-contributed/javascriptcore/stress/array-profile-should-record-copy-on-write.js deleted file mode 100644 index 0de63e9230..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-profile-should-record-copy-on-write.js +++ /dev/null @@ -1,39 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} -noInline(shouldBe); - -function test1(array) -{ - for (var i = 0; i < 5; ++i) { - array[0] = array[0] + 1; - } - return array; -} -noInline(test1); - -function test2(array) -{ - for (var i = 0; i < 5; ++i) { - array[0] = array[0] + 1; - } - return array; -} -noInline(test2); - -function test3(array) -{ - for (var i = 0; i < 5; ++i) { - array[0] = array[0] + 1; - } - return array; -} -noInline(test3); - -for (var i = 0; i < 1e5; ++i) { - shouldBe(String(test1([0, 1, 2, 3, 4])), `5,1,2,3,4`); - shouldBe(String(test2([0.1, 1.1, 2.1, 3.1, 4.1])), `5.1,1.1,2.1,3.1,4.1`); - shouldBe(String(test3(['C', 'o', 'c', 'o', 'a'])), `C11111,o,c,o,a`); -} diff --git a/implementation-contributed/javascriptcore/stress/array-prototype-concat-of-long-spliced-arrays.js b/implementation-contributed/javascriptcore/stress/array-prototype-concat-of-long-spliced-arrays.js deleted file mode 100644 index 8658a921a6..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-prototype-concat-of-long-spliced-arrays.js +++ /dev/null @@ -1,36 +0,0 @@ -function shouldEqual(actual, expected) { - if (actual != expected) { - throw "ERROR: expect " + expected + ", actual " + actual; - } -} - -function test() { - var exception; - try { - var a = []; - a.length = 0xffffff00; - - var b = a.splice(0, 0x100000); // Undecided array - - var args = []; - args.length = 4094; - args.fill(b); - - var q = []; - q.length = 0x1000; - q.fill(7); - - var c = a.splice(0, 0xfffef); //Shorter undecided array - - args[4094] = c; - args[4095] = q; - - b.concat.apply(b, args); - } catch (e) { - exception = e; - } - - shouldEqual(exception, "RangeError: Length exceeded the maximum array length"); -} - -test(); diff --git a/implementation-contributed/javascriptcore/stress/array-prototype-concat-of-long-spliced-arrays2.js b/implementation-contributed/javascriptcore/stress/array-prototype-concat-of-long-spliced-arrays2.js deleted file mode 100644 index 49e4c8db0b..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-prototype-concat-of-long-spliced-arrays2.js +++ /dev/null @@ -1,26 +0,0 @@ -function shouldEqual(actual, expected) { - if (actual != expected) { - throw "ERROR: expect " + expected + ", actual " + actual; - } -} - -function test() { - var exception; - try { - var a = []; - a.length = 0xffffff00; - - var b = a.splice(0, 0x100000); // Undecided array - - var args = []; - args.length = 4096; - args.fill(b); - - b.concat.apply(b, args); - } catch (e) { - exception = e; - } - shouldEqual(exception, "RangeError: Length exceeded the maximum array length"); -} - -test(); diff --git a/implementation-contributed/javascriptcore/stress/array-prototype-slow-put-having-a-bad-time-2.js b/implementation-contributed/javascriptcore/stress/array-prototype-slow-put-having-a-bad-time-2.js deleted file mode 100644 index 94abb3e3a2..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-prototype-slow-put-having-a-bad-time-2.js +++ /dev/null @@ -1,14 +0,0 @@ -function assert(b) { - if (!b) - throw new Error; -} - -let result; -Object.defineProperty(Object.prototype, '1', { - get() { return result; }, - set(x) { result = x; } -}); -Array.prototype.length = 0x10000000; -Array.prototype[1] = 42; -assert(result === 42); -assert(Array.prototype[1] === 42); diff --git a/implementation-contributed/javascriptcore/stress/array-prototype-slow-put-having-a-bad-time.js b/implementation-contributed/javascriptcore/stress/array-prototype-slow-put-having-a-bad-time.js deleted file mode 100644 index 876ac6c0d7..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-prototype-slow-put-having-a-bad-time.js +++ /dev/null @@ -1,15 +0,0 @@ -function assert(b) { - if (!b) - throw new Error; -} - -let result; -Object.defineProperty(Object.prototype, '1', { - get() { return result; }, - set(x) { result = x; } -}); - -Array.prototype.length = 5; -Array.prototype[1] = 42; -assert(result === 42); -assert(Array.prototype[1] === 42); diff --git a/implementation-contributed/javascriptcore/stress/array-prototype-splice-making-typed-array.js b/implementation-contributed/javascriptcore/stress/array-prototype-splice-making-typed-array.js deleted file mode 100644 index 7017d6f190..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-prototype-splice-making-typed-array.js +++ /dev/null @@ -1,66 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion!") -} - -function test(f, n = 4) { - for (let i = 0; i < n; i++) - f(); -} - -test(function() { - // This should not crash. - let x = [1,2,3,4,5]; - x.constructor = Uint8Array; - delete x[2]; - assert(!(2 in x)); - let err = null; - try { - let removed = x.splice(1,3); - assert(removed instanceof Uint8Array); - assert(removed.length === 3); - assert(removed[0] === 2); - assert(removed[1] === 0); - assert(removed[2] === 4); - } catch(e) { - err = e; - } - assert(err.toString() === "TypeError: Attempting to configure non-configurable property on a typed array at index: 0"); - - assert(x instanceof Array); - assert(x.length === 5); - assert(x[0] === 1); - assert(x[1] === 2); - assert(x[2] === undefined); - assert(x[3] === 4); - assert(x[4] === 5); -}); - -test(function() { - let x = [1,2,3,4,5]; - x.constructor = Uint8Array; - delete x[2]; - assert(!(2 in x)); - Object.defineProperty(Uint8Array, Symbol.species, {value: null}); - assert(Uint8Array[Symbol.species] === null); - x = new Proxy(x, { - get(target, property, receiver) { - if (parseInt(property, 10)) - assert(property !== "2"); - return Reflect.get(target, property, receiver); - } - }); - - let removed = x.splice(1,3); - assert(removed instanceof Array); // We shouldn't make a TypedArray here because Symbol.species is null. - assert(removed.length === 3); - assert(removed[0] === 2); - assert(removed[1] === undefined); - assert(!(1 in removed)); - assert(removed[2] === 4); - - assert(x instanceof Array); - assert(x.length === 2); - assert(x[0] === 1); - assert(x[1] === 5); -}); diff --git a/implementation-contributed/javascriptcore/stress/array-push-array-storage-beyond-int32.js b/implementation-contributed/javascriptcore/stress/array-push-array-storage-beyond-int32.js deleted file mode 100644 index 82f4979d5d..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-array-storage-beyond-int32.js +++ /dev/null @@ -1,27 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(array, val1) -{ - return array.push(val1); -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - var array = ["Cocoa"]; - ensureArrayStorage(array); - array.length = 2; - shouldBe(test(array, "Cocoa"), 3); - shouldBe(array[0], "Cocoa"); - shouldBe(array[1], undefined); - shouldBe(array[2], "Cocoa"); -} - -var array = ["Cocoa"]; -ensureArrayStorage(array); -array.length = 0x7fffffff; -shouldBe(test(array, "Cocoa"), 0x7fffffff + 1); -shouldBe(array[0x7fffffff], "Cocoa"); diff --git a/implementation-contributed/javascriptcore/stress/array-push-array-storage.js b/implementation-contributed/javascriptcore/stress/array-push-array-storage.js deleted file mode 100644 index 887aa0d796..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-array-storage.js +++ /dev/null @@ -1,40 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(array, val1) -{ - return array.push(val1); -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - var array = ["Cocoa"]; - ensureArrayStorage(array); - shouldBe(test(array, "Cocoa"), 2); - shouldBe(array[0], "Cocoa"); - shouldBe(array[1], "Cocoa"); - shouldBe(array[2], undefined); - shouldBe(array[3], undefined); - shouldBe(array[4], undefined); - shouldBe(test(array, "Cappuccino"), 3); - shouldBe(array[0], "Cocoa"); - shouldBe(array[1], "Cocoa"); - shouldBe(array[2], "Cappuccino"); - shouldBe(array[3], undefined); - shouldBe(array[4], undefined); - shouldBe(test(array, "Matcha"), 4); - shouldBe(array[0], "Cocoa"); - shouldBe(array[1], "Cocoa"); - shouldBe(array[2], "Cappuccino"); - shouldBe(array[3], "Matcha"); - shouldBe(array[4], undefined); - shouldBe(test(array, "Matcha"), 5); - shouldBe(array[0], "Cocoa"); - shouldBe(array[1], "Cocoa"); - shouldBe(array[2], "Cappuccino"); - shouldBe(array[3], "Matcha"); - shouldBe(array[4], "Matcha"); -} diff --git a/implementation-contributed/javascriptcore/stress/array-push-contiguous.js b/implementation-contributed/javascriptcore/stress/array-push-contiguous.js deleted file mode 100644 index 8f5e28512d..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-contiguous.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo() { - var array = []; - var result = []; - for (var i = 0; i < 42; ++i) - result.push(array.push("hello")); - return [array, result]; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(); - if (result[0].toString() != "hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello,hello") - throw "Error: bad array: " + result[0]; - if (result[1].toString() != "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42") - throw "Error: bad array: " + result[1]; -} - diff --git a/implementation-contributed/javascriptcore/stress/array-push-double-then-nan.js b/implementation-contributed/javascriptcore/stress/array-push-double-then-nan.js deleted file mode 100644 index fdc6eabf52..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-double-then-nan.js +++ /dev/null @@ -1,23 +0,0 @@ -function foo(x) { - var array = []; - var result = []; - for (var i = 0; i < 42; ++i) - result.push(array.push(x)); - return [array, result]; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(5.5); - if (result[0].toString() != "5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5,5.5") - throw "Error: bad array: " + result[0]; - if (result[1].toString() != "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42") - throw "Error: bad array: " + result[1]; -} - -var result = foo(0/0); -if (result[0].toString() != "NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN") - throw "Error: bad array: " + result[0]; -if (result[1].toString() != "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42") - throw "Error: bad array: " + result[1]; diff --git a/implementation-contributed/javascriptcore/stress/array-push-double.js b/implementation-contributed/javascriptcore/stress/array-push-double.js deleted file mode 100644 index a7065ffc1f..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-double.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo() { - var array = []; - var result = []; - for (var i = 0; i < 42; ++i) - result.push(array.push(7.5 - i)); - return [array, result]; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(); - if (result[0].toString() != "7.5,6.5,5.5,4.5,3.5,2.5,1.5,0.5,-0.5,-1.5,-2.5,-3.5,-4.5,-5.5,-6.5,-7.5,-8.5,-9.5,-10.5,-11.5,-12.5,-13.5,-14.5,-15.5,-16.5,-17.5,-18.5,-19.5,-20.5,-21.5,-22.5,-23.5,-24.5,-25.5,-26.5,-27.5,-28.5,-29.5,-30.5,-31.5,-32.5,-33.5") - throw "Error: bad array: " + result[0]; - if (result[1].toString() != "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42") - throw "Error: bad array: " + result[1]; -} - diff --git a/implementation-contributed/javascriptcore/stress/array-push-multiple-array-storage-beyond-int32.js b/implementation-contributed/javascriptcore/stress/array-push-multiple-array-storage-beyond-int32.js deleted file mode 100644 index 7af11983ac..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-multiple-array-storage-beyond-int32.js +++ /dev/null @@ -1,29 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(array, val1, val2) -{ - return array.push(val1, val2); -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - var array = ["Cocoa"]; - ensureArrayStorage(array); - array.length = 2; - shouldBe(test(array, "Cocoa", "Cappuccino"), 4); - shouldBe(array[0], "Cocoa"); - shouldBe(array[1], undefined); - shouldBe(array[2], "Cocoa"); - shouldBe(array[3], "Cappuccino"); -} - -var array = ["Cocoa"]; -ensureArrayStorage(array); -array.length = 0x7fffffff - 1; -shouldBe(test(array, "Cocoa", "Cappuccino"), 0x7fffffff + 1); -shouldBe(array[0x7fffffff - 1], "Cocoa"); -shouldBe(array[0x7fffffff - 0], "Cappuccino"); diff --git a/implementation-contributed/javascriptcore/stress/array-push-multiple-contiguous.js b/implementation-contributed/javascriptcore/stress/array-push-multiple-contiguous.js deleted file mode 100644 index b336b3d90b..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-multiple-contiguous.js +++ /dev/null @@ -1,19 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(array, val1, val2, val3) -{ - return array.push(val1, val2, val3); -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - var array = []; - shouldBe(test(array, "Cocoa", "Cappuccino", "Matcha"), 3); - shouldBe(array[0], "Cocoa"); - shouldBe(array[1], "Cappuccino"); - shouldBe(array[2], "Matcha"); -} diff --git a/implementation-contributed/javascriptcore/stress/array-push-multiple-double-nan.js b/implementation-contributed/javascriptcore/stress/array-push-multiple-double-nan.js deleted file mode 100644 index 9d16b8fd25..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-multiple-double-nan.js +++ /dev/null @@ -1,25 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(array, val1, val2, val3) -{ - return array.push(val1, val2, val3); -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - var array = []; - var value = 3.3; - if (i === 1e5 - 1) - value = NaN; - shouldBe(test(array, 1.1, 2.2, value), 3); - shouldBe(array[0], 1.1); - shouldBe(array[1], 2.2); - if (i === 1e5 - 1) - shouldBe(Number.isNaN(array[2]), true); - else - shouldBe(array[2], 3.3); -} diff --git a/implementation-contributed/javascriptcore/stress/array-push-multiple-double.js b/implementation-contributed/javascriptcore/stress/array-push-multiple-double.js deleted file mode 100644 index bbeed2602f..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-multiple-double.js +++ /dev/null @@ -1,32 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(array, val1, val2, val3) -{ - return array.push(val1, val2, val3); -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - var array = []; - shouldBe(test(array, 1.1, 2.2, 3.3), 3); - shouldBe(array[0], 1.1); - shouldBe(array[1], 2.2); - shouldBe(array[2], 3.3); -} - -for (var i = 0; i < 1e5; ++i) { - var array = []; - shouldBe(test(array, 1.1, 2.2, 4), 3); - shouldBe(array[0], 1.1); - shouldBe(array[1], 2.2); - shouldBe(array[2], 4); -} -var array = []; -shouldBe(test(array, 1.1, 2.2, "String"), 3); -shouldBe(array[0], 1.1); -shouldBe(array[1], 2.2); -shouldBe(array[2], "String"); diff --git a/implementation-contributed/javascriptcore/stress/array-push-multiple-int32.js b/implementation-contributed/javascriptcore/stress/array-push-multiple-int32.js deleted file mode 100644 index 553ee58b55..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-multiple-int32.js +++ /dev/null @@ -1,24 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(array, val1, val2, val3) -{ - return array.push(val1, val2, val3); -} -noInline(test); - -for (var i = 0; i < 1e7; ++i) { - var array = []; - shouldBe(test(array, 1, 2, 3), 3); - shouldBe(array[0], 1); - shouldBe(array[1], 2); - shouldBe(array[2], 3); -} -var array = []; -shouldBe(test(array, 1, 2, 3.3), 3); -shouldBe(array[0], 1); -shouldBe(array[1], 2); -shouldBe(array[2], 3.3); diff --git a/implementation-contributed/javascriptcore/stress/array-push-multiple-many-contiguous.js b/implementation-contributed/javascriptcore/stress/array-push-multiple-many-contiguous.js deleted file mode 100644 index 906be99a2f..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-multiple-many-contiguous.js +++ /dev/null @@ -1,20 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(array, val1, val2, val3, val4, val5, val6, val7, val8, val9, val10, val11, val12) -{ - return array.push(val1, val2, val3, val4, val5, val6, val7, val8, val9, val10, val11, val12); -} -noInline(test); - -var values = [ "AB", "BC", "CD", "DE", "EF", "FG", "GH", "HI", "IJ", "JK", "KL", "LM" ]; -shouldBe(values.length, 12); -for (var i = 0; i < 1e5; ++i) { - var array = []; - shouldBe(test(array, values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11]), 12); - for (var j = 0; j < values.length; ++j) - shouldBe(array[j], values[j]); -} diff --git a/implementation-contributed/javascriptcore/stress/array-push-multiple-many-double.js b/implementation-contributed/javascriptcore/stress/array-push-multiple-many-double.js deleted file mode 100644 index 3fe89f259b..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-multiple-many-double.js +++ /dev/null @@ -1,20 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(array, val1, val2, val3, val4, val5, val6, val7, val8, val9, val10, val11, val12) -{ - return array.push(val1, val2, val3, val4, val5, val6, val7, val8, val9, val10, val11, val12); -} -noInline(test); - -var values = [ 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2 ]; -shouldBe(values.length, 12); -for (var i = 0; i < 1e5; ++i) { - var array = []; - shouldBe(test(array, values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11]), 12); - for (var j = 0; j < values.length; ++j) - shouldBe(array[j], values[j]); -} diff --git a/implementation-contributed/javascriptcore/stress/array-push-multiple-many-int32.js b/implementation-contributed/javascriptcore/stress/array-push-multiple-many-int32.js deleted file mode 100644 index bc1157339b..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-multiple-many-int32.js +++ /dev/null @@ -1,20 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(array, val1, val2, val3, val4, val5, val6, val7, val8, val9, val10, val11, val12) -{ - return array.push(val1, val2, val3, val4, val5, val6, val7, val8, val9, val10, val11, val12); -} -noInline(test); - -var values = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]; -shouldBe(values.length, 12); -for (var i = 0; i < 1e5; ++i) { - var array = []; - shouldBe(test(array, values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11]), 12); - for (var j = 0; j < values.length; ++j) - shouldBe(array[j], values[j]); -} diff --git a/implementation-contributed/javascriptcore/stress/array-push-multiple-many-storage.js b/implementation-contributed/javascriptcore/stress/array-push-multiple-many-storage.js deleted file mode 100644 index 7a2939ff17..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-multiple-many-storage.js +++ /dev/null @@ -1,21 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(array, val1, val2, val3, val4, val5, val6, val7, val8, val9, val10, val11, val12) -{ - return array.push(val1, val2, val3, val4, val5, val6, val7, val8, val9, val10, val11, val12); -} -noInline(test); - -var values = [ "AB", "BC", "CD", "DE", "EF", "FG", "GH", "HI", "IJ", "JK", "KL", "LM" ]; -shouldBe(values.length, 12); -for (var i = 0; i < 1e5; ++i) { - var array = []; - ensureArrayStorage(array); - shouldBe(test(array, values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11]), 12); - for (var j = 0; j < values.length; ++j) - shouldBe(array[j], values[j]); -} diff --git a/implementation-contributed/javascriptcore/stress/array-push-multiple-storage-continuous.js b/implementation-contributed/javascriptcore/stress/array-push-multiple-storage-continuous.js deleted file mode 100644 index 663c99928f..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-multiple-storage-continuous.js +++ /dev/null @@ -1,31 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(array, val1, val2, val3) -{ - return array.push(val1, val2, val3); -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - var array = []; - ensureArrayStorage(array); - shouldBe(test(array, "Cocoa", "Cappuccino", "Matcha"), 3); - shouldBe(array[0], "Cocoa"); - shouldBe(array[1], "Cappuccino"); - shouldBe(array[2], "Matcha"); -} - -var array = []; -ensureArrayStorage(array); -for (var i = 0; i < 1e3; ++i) { - shouldBe(test(array, "Cocoa", "Cappuccino", "Matcha"), 3 * (i + 1)); -} -for (var i = 0; i < 1e3; ++i) { - shouldBe(array[3 * i + 0], "Cocoa"); - shouldBe(array[3 * i + 1], "Cappuccino"); - shouldBe(array[3 * i + 2], "Matcha"); -} diff --git a/implementation-contributed/javascriptcore/stress/array-push-multiple-storage.js b/implementation-contributed/javascriptcore/stress/array-push-multiple-storage.js deleted file mode 100644 index 4efe4450a4..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-multiple-storage.js +++ /dev/null @@ -1,29 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(array, val1, val2, val3) -{ - return array.push(val1, val2, val3); -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - var array = []; - ensureArrayStorage(array); - shouldBe(test(array, "Cocoa", "Cappuccino", "Matcha"), 3); - shouldBe(array[0], "Cocoa"); - shouldBe(array[1], "Cappuccino"); - shouldBe(array[2], "Matcha"); -} -for (var i = 0; i < 1e5; ++i) { - var array = [0]; - ensureArrayStorage(array); - shouldBe(test(array, "Cocoa", "Cappuccino", "Matcha"), 4); - shouldBe(array[0], 0); - shouldBe(array[1], "Cocoa"); - shouldBe(array[2], "Cappuccino"); - shouldBe(array[3], "Matcha"); -} diff --git a/implementation-contributed/javascriptcore/stress/array-push-nan-to-double-array-cse-sane-and-insane-chain.js b/implementation-contributed/javascriptcore/stress/array-push-nan-to-double-array-cse-sane-and-insane-chain.js deleted file mode 100644 index 510bc53484..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-nan-to-double-array-cse-sane-and-insane-chain.js +++ /dev/null @@ -1,23 +0,0 @@ -function foo(array, otherArray, i) -{ - var x = otherArray[i]; - var y = otherArray[i]; - array.push(y); - return x / 42; -} - -function bar() -{ - return []; -} - -noInline(foo); -noInline(bar); - -for (var i = 0; i < 10000; ++i) - foo(bar(), [42.5], 0); - -var result = bar(); -foo(result, [,42.5], 0); -if (result[0] !== void 0) - throw "Bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/array-push-nan-to-double-array.js b/implementation-contributed/javascriptcore/stress/array-push-nan-to-double-array.js deleted file mode 100644 index 3322ea7d27..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push-nan-to-double-array.js +++ /dev/null @@ -1,20 +0,0 @@ -function foo(array, num, denum) -{ - array.push(num/denum); -} - -function bar() -{ - return []; -} - -noInline(foo); -noInline(bar); - -for (var i = 0; i < 10000; ++i) - foo(bar(), 42.5, 3.1); - -var result = bar(); -foo(result, 0, 0); -if ("" + result[0] !== "NaN") - throw "Bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/array-push.js b/implementation-contributed/javascriptcore/stress/array-push.js deleted file mode 100644 index 0560987abe..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-push.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo() { - var array = []; - var result = []; - for (var i = 0; i < 42; ++i) - result.push(array.push(7 - i)); - return [array, result]; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(); - if (result[0].toString() != "7,6,5,4,3,2,1,0,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,-30,-31,-32,-33,-34") - throw "Error: bad array: " + result[0]; - if (result[1].toString() != "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42") - throw "Error: bad array: " + result[1]; -} - diff --git a/implementation-contributed/javascriptcore/stress/array-reverse-doesnt-clobber.js b/implementation-contributed/javascriptcore/stress/array-reverse-doesnt-clobber.js deleted file mode 100644 index c98a4b5d1f..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-reverse-doesnt-clobber.js +++ /dev/null @@ -1,63 +0,0 @@ -//@ skip if $memoryLimited - -// This tests that array.Prototype.reverse() doesn't inadvertently clobber indexed properties. -// This test shouldn't throw or crash. - -const outerArrayLength = 10000; -const innerArrayLength = 128; - -function testArrayReverse(createArray) -{ - const limit = 5; - let save = [0, 0]; - - for (let at = 0; at < limit; at++) { - let arr = createArray(); - - let v = []; - for (let i = 0; i < 273; i++) { - for (let j = 0; j < 8; j++) - arr.reverse(); - - v.push(new String("X").repeat(123008)); - } - - for (let i = 0; i < arr.length; i++) { - if (arr[i].length != innerArrayLength) - throw "arr[" + i + "].length has changed from " + innerArrayLength + " to " + arr[i].length; - } - - let f = []; - for (let i = 0; i < 1000; i++) - f.push(new Array(16).fill(0x42424242)); - - save.push(arr); - save.push(v); - save.push(f); - } -} - -function createArrayOfArrays() -{ - let result = new Array(outerArrayLength); - - for (let i = 0; i < result.length; i++) - result[i] = new Array(innerArrayLength).fill(0x41414141); - - return result; -} - -var alt = 0; - -function createArrayStorage() -{ - let result = createArrayOfArrays(); - - if (!(typeof ensureArrayStorage === undefined) && alt++ % 0) - ensureArrayStorage(result); - - return result; -} - -testArrayReverse(createArrayOfArrays); -testArrayReverse(createArrayStorage); diff --git a/implementation-contributed/javascriptcore/stress/array-reverse-proxy.js b/implementation-contributed/javascriptcore/stress/array-reverse-proxy.js deleted file mode 100644 index 45d843defb..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-reverse-proxy.js +++ /dev/null @@ -1,221 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("bad assertion!"); -} - -function test(f) { - for (let i = 0; i < 1000; i++) - f(); -} - -function shallowCopy(arr) { - let result = []; - for (let item of arr) - result.push(item); - return result; -} - -function shallowEqual(a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) { - if (a[i] !== b[i]) - return false; - } - - return true; -} - -test(function() { - let target = [10, 20, 30, 40]; - let copy = shallowCopy(target); - let handler = { }; - let proxy = new Proxy(target, handler); - proxy.reverse(); - copy.reverse(); - assert(shallowEqual(proxy, target)); - assert(shallowEqual(target, copy)); -}); - -test(function() { - let target = [10, 20, 30, 40]; - let copy = shallowCopy(target); - let getSet = new Set; - let hasSet = new Set; - let handler = { - get(theTarget, key) { - getSet.add(key); - return theTarget[key]; - }, - has(theTarget, key) { - hasSet.add(key); - return Reflect.has(theTarget, key); - } - }; - let proxy = new Proxy(target, handler); - proxy.reverse(); - copy.reverse(); - assert(shallowEqual(proxy, target)); - assert(shallowEqual(target, copy)); - - assert(getSet.has("0")); - assert(getSet.has("1")); - assert(getSet.has("2")); - assert(getSet.has("3")); - assert(getSet.has("length")); - - assert(hasSet.has("0")); - assert(hasSet.has("1")); - assert(hasSet.has("2")); - assert(hasSet.has("3")); -}); - -test(function() { - let target = [10, 20, 30, 40]; - let getSet = new Set; - let hasSet = new Set; - let deleteSet = new Set; - let handler = { - get(theTarget, key) { - getSet.add(key); - return theTarget[key]; - }, - has(theTarget, key) { - hasSet.add(key); - if (key === "0" || key === "1") - return true; - assert(key === "2" || key === "3"); - return false; - }, - deleteProperty(theTarget, key) { - deleteSet.add(key); - return Reflect.deleteProperty(theTarget, key); - } - }; - - let proxy = new Proxy(target, handler); - proxy.reverse(); - assert(shallowEqual(proxy, target)); - - assert(getSet.has("0")); - assert(getSet.has("1")); - assert(getSet.has("2")); - assert(getSet.has("3")); - assert(getSet.has("length")); - assert(getSet.has("reverse")); - assert(getSet.size === 6); - - assert(hasSet.has("0")); - assert(hasSet.has("1")); - assert(hasSet.has("2")); - assert(hasSet.has("3")); - assert(hasSet.size === 4); - - assert(deleteSet.has("0")); - assert(deleteSet.has("1")); - assert(!deleteSet.has("2")); - assert(!deleteSet.has("3")); -}); - -test(function() { - let target = [10, 20, 30, 40]; - let error; - let handler = { - has(theTarget, key) { - return false; - }, - deleteProperty(theTarget, key) { - if (key === "0") { - error = new Error; - throw error; - } - return true; - } - }; - - let proxy = new Proxy(target, handler); - let threw = false; - try { - proxy.reverse(); - } catch(e) { - threw = true; - assert(e === error); - } - assert(threw); -}); - -test(function() { - let target = [10, 20, 30, 40]; - let error; - let handler = { - has(theTarget, key) { - if (key === "0") { - error = new Error; - throw error; - } - return false; - } - }; - - let proxy = new Proxy(target, handler); - let threw = false; - try { - proxy.reverse(); - } catch(e) { - threw = true; - assert(e === error); - } - assert(threw); -}); - -test(function() { - let target = [10, 20, 30, 40]; - let error; - let handler = { - has(theTarget, key) { - if (key === "3") { - error = new Error; - throw error; - } - return false; - } - }; - - let proxy = new Proxy(target, handler); - let threw = false; - try { - proxy.reverse(); - } catch(e) { - threw = true; - assert(e === error); - } - assert(threw); -}); - -test(function() { - let target = [10, 20, 30, 40]; - let error; - let getSet = new Set; - let handler = { - get(theTarget, key) { - getSet.add(key); - return theTarget[key]; - }, - has(theTarget, key) { - return false; - }, - deleteProperty() { - return true; - } - }; - - let proxy = new Proxy(target, handler); - proxy.reverse(); - assert(!getSet.has("0")); - assert(!getSet.has("1")); - assert(!getSet.has("2")); - assert(!getSet.has("3")); - assert(getSet.size === 2); - assert(getSet.has("reverse")); - assert(getSet.has("length")); -}); diff --git a/implementation-contributed/javascriptcore/stress/array-setLength-on-ArrayClass-with-large-length.js b/implementation-contributed/javascriptcore/stress/array-setLength-on-ArrayClass-with-large-length.js deleted file mode 100644 index c534a3a7a3..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-setLength-on-ArrayClass-with-large-length.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runDefault -// This test should not crash - -function assertEqual(actual, expected) { - function toString(x) { - return '' + x; - } - if (typeof actual != typeof expected) - throw Error("Failed: typeof expected: '" + typeof(expected) + "', typeof actual: '" + typeof(actual) + "'");; - - if (toString(actual) != toString(expected)) - throw Error("Failed: expected: '" + toString(expected) + "', actual: '" + toString(actual) + "'");; -} - -assertEqual(Array.prototype.length, 0); - -Array.prototype.length = 0x40000000; - -assertEqual(Array.prototype.length, 0x40000000); diff --git a/implementation-contributed/javascriptcore/stress/array-setLength-on-ArrayClass-with-small-length.js b/implementation-contributed/javascriptcore/stress/array-setLength-on-ArrayClass-with-small-length.js deleted file mode 100644 index 5ac4c8c317..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-setLength-on-ArrayClass-with-small-length.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runDefault -// This test should not crash - -function assertEqual(actual, expected) { - function toString(x) { - return '' + x; - } - if (typeof actual != typeof expected) - throw Error("Failed: typeof expected: '" + typeof(expected) + "', typeof actual: '" + typeof(actual) + "'");; - - if (toString(actual) != toString(expected)) - throw Error("Failed: expected: '" + toString(expected) + "', actual: '" + toString(actual) + "'");; -} - -assertEqual(Array.prototype.length, 0); - -Array.prototype.length = 5; - -assertEqual(Array.prototype.length, 5); diff --git a/implementation-contributed/javascriptcore/stress/array-slice-cow.js b/implementation-contributed/javascriptcore/stress/array-slice-cow.js deleted file mode 100644 index 57f1ccf78e..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-slice-cow.js +++ /dev/null @@ -1,31 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testInt32() -{ - var array = [0, 1, 2, 3]; - return array.slice(1); -} -noInline(testInt32); - -function testDouble() -{ - var array = [0.1, 1.1, 2.1, 3.1]; - return array.slice(1); -} -noInline(testDouble); - -function testContiguous() -{ - var array = [true, false, true, false]; - return array.slice(1); -} -noInline(testContiguous); - -for (var i = 0; i < 1e4; ++i) { - shouldBe(JSON.stringify(testInt32()), `[1,2,3]`); - shouldBe(JSON.stringify(testDouble()), `[1.1,2.1,3.1]`); - shouldBe(JSON.stringify(testContiguous()), `[false,true,false]`); -} diff --git a/implementation-contributed/javascriptcore/stress/array-slice-intrinsic.js b/implementation-contributed/javascriptcore/stress/array-slice-intrinsic.js deleted file mode 100644 index 562db6d5a3..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-slice-intrinsic.js +++ /dev/null @@ -1,49 +0,0 @@ -function assert(b, ...m) { - if (!b) - throw new Error("Bad: ", ...m); -} -noInline(assert); - -function shallowEq(a, b) { - assert(a.length === b.length, a, b); - for (let i = 0; i < a.length; i++) - assert(a[i] === b[i], a, b); -} -noInline(shallowEq); - -let tests = [ - [[1,2,3,4,5], [1,2,3,4,5], 0, 5], - [[1,2,3,4,5], [1,2,3,4,5], 0], - [[1,2,3,4,5], [4], -2, -1], - [[1,2,3,4,5], [5], -1], - [[1,2,3,4,5], [5], -1, 5], - [[1,2,3,4,5], [], -10, -20], - [[1,2,3,4,5], [], -20, -10], - [[1,2,3,4,5], [], 6, 4], - [[1,2,3,4,5], [], 3, 2], - [[1,2,3,4,5], [4,5], 3, 10], - [[1,2,3,4,5], [3,4,5], 2, 10], - [[1,2,3,4,5], [1,2,3,4,5], -10, 10], - [[1,2,3,4,5], [1,2,3,4,5], -5, 10], - [[1,2,3,4,5], [2,3,4,5], -4, 10], -]; - -function runTest1(a, b) { - return a.slice(b); -} -noInline(runTest1); - -function runTest2(a, b, c) { - return a.slice(b, c); -} -noInline(runTest2); - -for (let i = 0; i < 10000; i++) { - for (let [input, output, ...args] of tests) { - assert(args.length === 1 || args.length === 2); - if (args.length === 1) - shallowEq(runTest1(input, args[0]), output); - else - shallowEq(runTest2(input, args[0], args[1]), output); - } -} diff --git a/implementation-contributed/javascriptcore/stress/array-slice-jettison-on-constructor-change.js b/implementation-contributed/javascriptcore/stress/array-slice-jettison-on-constructor-change.js deleted file mode 100644 index 13aa63c93a..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-slice-jettison-on-constructor-change.js +++ /dev/null @@ -1,72 +0,0 @@ -function assert(b, ...m) { - if (!b) - throw new Error("Bad: ", ...m) -} -noInline(assert); - -let shouldBeNewConstructor = false; -const newConstructor = {}; - -function shallowEq(a, b) { - assert(a.length === b.length, a, b); - if (shouldBeNewConstructor) - assert(b.constructor === newConstructor); - for (let i = 0; i < a.length; i++) - assert(a[i] === b[i], a, b); -} -noInline(shallowEq); - -let tests = [ - [[1,2,3,4,5], [1,2,3,4,5], 0, 5], - [[1,2,3,4,5], [1,2,3,4,5], 0], - [[1,2,3,4,5], [4], -2, -1], - [[1,2,3,4,5], [5], -1], - [[1,2,3,4,5], [5], -1, 5], - [[1,2,3,4,5], [], -10, -20], - [[1,2,3,4,5], [], -20, -10], - [[1,2,3,4,5], [], 6, 4], - [[1,2,3,4,5], [], 3, 2], - [[1,2,3,4,5], [4,5], 3, 10], - [[1,2,3,4,5], [3,4,5], 2, 10], - [[1,2,3,4,5], [1,2,3,4,5], -10, 10], - [[1,2,3,4,5], [1,2,3,4,5], -5, 10], - [[1,2,3,4,5], [2,3,4,5], -4, 10], -]; - -function runTest1(a, b) { - let result = a.slice(b); - return result; -} -noInline(runTest1); - -function runTest2(a, b, c) { - let result = a.slice(b, c); - return result; -} -noInline(runTest2); - -function addRandomProperties(input) { - for (let i = 0; i < 4; i++) { - input["prop" + i + ((Math.random() * 100000) | 0)] = i; - } -} -noInline(addRandomProperties); - -function runTests() { - for (let i = 0; i < 10000; i++) { - for (let [input, output, ...args] of tests) { - addRandomProperties(input); - assert(args.length === 1 || args.length === 2); - if (args.length === 1) - shallowEq(runTest1(input, args[0]), output); - else - shallowEq(runTest2(input, args[0], args[1]), output); - } - } -} - -runTests(); - -Array.prototype.constructor = newConstructor; -shouldBeNewConstructor = true; -runTests(); diff --git a/implementation-contributed/javascriptcore/stress/array-slice-on-frozen-object.js b/implementation-contributed/javascriptcore/stress/array-slice-on-frozen-object.js deleted file mode 100644 index d99baee234..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-slice-on-frozen-object.js +++ /dev/null @@ -1,64 +0,0 @@ -//@ runFTLNoCJIT - -let totalFailed = 0; - -function shouldEqual(testId, actual, expected) { - if (actual != expected) { - throw testId + ": ERROR: expect " + expected + ", actual " + actual; - } -} - -function makeArray() { - return ['unmodifiable']; -} - -function makeArrayLikeObject() { - var obj = {}; - obj[0] = 'unmodifiable'; - obj.length = 1; - return obj; -} - -function emptyArraySourceMaker() { - return []; -} - -function singleElementArraySourceMaker() { - return ['modified_1']; -} - -// Make test functions with unique codeblocks. -function makeSliceTest(testId) { - return new Function("arr", "arr.slice(0); return " + testId + ";"); -} - -let numIterations = 10000; - -function runTest(testId, testMaker, targetMaker, sourceMaker, expectedValue, expectedException) { - var test = testMaker(testId); - noInline(test); - - for (var i = 0; i < numIterations; i++) { - var exception = undefined; - - var obj = targetMaker(); - obj = Object.freeze(obj); - - var arr = sourceMaker(); - arr.constructor = { [Symbol.species]: function() { return obj; } }; - - try { - test(arr); - } catch (e) { - exception = "" + e; - exception = exception.substr(0, 10); // Search for "TypeError:". - } - shouldEqual(testId, exception, expectedException); - shouldEqual(testId, obj[0], expectedValue); - } -} - -runTest(10010, makeSliceTest, makeArray, emptyArraySourceMaker, "unmodifiable", "TypeError:"); -runTest(10011, makeSliceTest, makeArray, singleElementArraySourceMaker, "unmodifiable", "TypeError:"); -runTest(10020, makeSliceTest, makeArrayLikeObject, emptyArraySourceMaker, "unmodifiable", "TypeError:"); -runTest(10021, makeSliceTest, makeArrayLikeObject, singleElementArraySourceMaker, "unmodifiable", "TypeError:"); diff --git a/implementation-contributed/javascriptcore/stress/array-slice-osr-exit-2.js b/implementation-contributed/javascriptcore/stress/array-slice-osr-exit-2.js deleted file mode 100644 index 15a7f442d3..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-slice-osr-exit-2.js +++ /dev/null @@ -1,76 +0,0 @@ -function assert(b, ...m) { - if (!b) - throw new Error("Bad: ", ...m) -} -noInline(assert); - -class Foo extends Array { - constructor(...args) { - super(...args); - } -}; -function shallowEq(a, b) { - assert(a.length === b.length, a, b); - for (let i = 0; i < a.length; i++) - assert(a[i] === b[i], a, b); -} -noInline(shallowEq); - -let tests = [ - [[1,2,3,4,5], [1,2,3,4,5], 0, 5], - [[1,2,3,4,5], [1,2,3,4,5], 0], - [[1,2,3,4,5], [4], -2, -1], - [[1,2,3,4,5], [5], -1], - [[1,2,3,4,5], [5], -1, 5], - [[1,2,3,4,5], [], -10, -20], - [[1,2,3,4,5], [], -20, -10], - [[1,2,3,4,5], [], 6, 4], - [[1,2,3,4,5], [], 3, 2], - [[1,2,3,4,5], [4,5], 3, 10], - [[1,2,3,4,5], [3,4,5], 2, 10], - [[1,2,3,4,5], [1,2,3,4,5], -10, 10], - [[1,2,3,4,5], [1,2,3,4,5], -5, 10], - [[1,2,3,4,5], [2,3,4,5], -4, 10], -]; - -function runTest1(a, b) { - let result = a.slice(b); - assert(a instanceof Foo === result instanceof Foo); - return result; -} -noInline(runTest1); - -function runTest2(a, b, c) { - let result = a.slice(b, c); - assert(a instanceof Foo === result instanceof Foo); - return result; -} -noInline(runTest2); - -function addRandomProperties(input) { - for (let i = 0; i < 4; i++) { - input["prop" + i + ((Math.random() * 100000) | 0)] = i; - } -} -noInline(addRandomProperties); - -function runTests() { - for (let i = 0; i < 10000; i++) { - for (let [input, output, ...args] of tests) { - addRandomProperties(input); - assert(args.length === 1 || args.length === 2); - if (args.length === 1) - shallowEq(runTest1(input, args[0]), output); - else - shallowEq(runTest2(input, args[0], args[1]), output); - } - } -} - -runTests(); - -tests.push([new Foo(1,2,3,4,5), [1,2,3,4,5], -10, 10]); -tests.push([new Foo(1,2,3,4,5), [1,2,3,4,5], -5, 10]); -tests.push([new Foo(1,2,3,4,5), [2,3,4,5], -4, 10]); -tests.push([new Foo(1,2,3,4,5), [2,3,4,5], -4]); -runTests(); diff --git a/implementation-contributed/javascriptcore/stress/array-slice-osr-exit.js b/implementation-contributed/javascriptcore/stress/array-slice-osr-exit.js deleted file mode 100644 index 980feace06..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-slice-osr-exit.js +++ /dev/null @@ -1,74 +0,0 @@ -function assert(b, ...m) { - if (!b) - throw new Error("Bad: ", ...m) -} -noInline(assert); - -class Foo extends Array { - constructor(...args) { - super(...args); - } -}; -function shallowEq(a, b) { - assert(a.length === b.length, a, b); - for (let i = 0; i < a.length; i++) - assert(a[i] === b[i], a, b); -} -noInline(shallowEq); - -let tests = [ - [[1,2,3,4,5], [1,2,3,4,5], 0, 5], - [[1,2,3,4,5], [1,2,3,4,5], 0], - [[1,2,3,4,5], [4], -2, -1], - [[1,2,3,4,5], [5], -1], - [[1,2,3,4,5], [5], -1, 5], - [[1,2,3,4,5], [], -10, -20], - [[1,2,3,4,5], [], -20, -10], - [[1,2,3,4,5], [], 6, 4], - [[1,2,3,4,5], [], 3, 2], - [[1,2,3,4,5], [4,5], 3, 10], - [[1,2,3,4,5], [3,4,5], 2, 10], - [[1,2,3,4,5], [1,2,3,4,5], -10, 10], - [[1,2,3,4,5], [1,2,3,4,5], -5, 10], - [[1,2,3,4,5], [2,3,4,5], -4, 10], -]; -tests.push([new Foo(1,2,3,4,5), [1,2,3,4,5], -10, 10]); -tests.push([new Foo(1,2,3,4,5), [1,2,3,4,5], -5, 10]); -tests.push([new Foo(1,2,3,4,5), [2,3,4,5], -4, 10]); -tests.push([new Foo(1,2,3,4,5), [2,3,4,5], -4]); - -function runTest1(a, b) { - let result = a.slice(b); - assert(a instanceof Foo === result instanceof Foo); - return result; -} -noInline(runTest1); - -function runTest2(a, b, c) { - let result = a.slice(b, c); - assert(a instanceof Foo === result instanceof Foo); - return result; -} -noInline(runTest2); - -function addRandomProperties(input) { - for (let i = 0; i < 4; i++) { - input["prop" + i + ((Math.random() * 100000) | 0)] = i; - } -} -noInline(addRandomProperties); - -function runTests() { - for (let i = 0; i < 10000; i++) { - for (let [input, output, ...args] of tests) { - addRandomProperties(input); - assert(args.length === 1 || args.length === 2); - if (args.length === 1) - shallowEq(runTest1(input, args[0]), output); - else - shallowEq(runTest2(input, args[0], args[1]), output); - } - } -} - -runTests(); diff --git a/implementation-contributed/javascriptcore/stress/array-slice-with-zero.js b/implementation-contributed/javascriptcore/stress/array-slice-with-zero.js deleted file mode 100644 index 3d82f81699..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-slice-with-zero.js +++ /dev/null @@ -1,34 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(array) -{ - return array.slice(0); -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - var array = [i, i, i]; - var result = test(array); - shouldBe(array !== result, true); - shouldBe(result.length, 3); - for (var j = 0; j < 3; ++j) - shouldBe(result[j], i); -} - -function test2(array, i) -{ - return array.slice(0, i); -} -noInline(test2); - -for (var i = 0; i < 1e5; ++i) { - var array = [i, i, i]; - var result = test2(array, 2); - shouldBe(array !== result, true); - shouldBe(result.length, 2); - for (var j = 0; j < 2; ++j) - shouldBe(result[j], i); -} diff --git a/implementation-contributed/javascriptcore/stress/array-slice-zero-args.js b/implementation-contributed/javascriptcore/stress/array-slice-zero-args.js deleted file mode 100644 index 48fe9ca5c1..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-slice-zero-args.js +++ /dev/null @@ -1,19 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(array) -{ - return array.slice(); -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) { - var array = [i, i, i]; - var result = test(array); - shouldBe(array !== result, true); - shouldBe(result.length, 3); - for (var j = 0; j < 3; ++j) - shouldBe(result[j], i); -} diff --git a/implementation-contributed/javascriptcore/stress/array-sort-bad-comparator.js b/implementation-contributed/javascriptcore/stress/array-sort-bad-comparator.js deleted file mode 100644 index c08203ae26..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-sort-bad-comparator.js +++ /dev/null @@ -1,28 +0,0 @@ -//@ runDefault - -function test() { - try { - [1,2].sort(null); - return false; - } catch (enull) {} - try { - [1,2].sort(true); - return false; - } catch (etrue) {} - try { - [1,2].sort({}); - return false; - } catch (eobj) {} - try { - [1,2].sort([]); - return false; - } catch (earr) {} - try { - [1,2].sort(/a/g); - return false; - } catch (eregex) {} - return true; -} - -if(!test()) - throw new Error("Bad result"); diff --git a/implementation-contributed/javascriptcore/stress/array-species-config-array-constructor.js b/implementation-contributed/javascriptcore/stress/array-species-config-array-constructor.js deleted file mode 100644 index ddc3ff2175..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-species-config-array-constructor.js +++ /dev/null @@ -1,49 +0,0 @@ -class A extends Array { } -Object.defineProperty(Array, Symbol.species, { value: A, configurable: true }); - -foo = [1,2,3,4]; -result = foo.concat([1]); -if (!(result instanceof A)) - throw "concat failed"; - -result = foo.splice(); -if (!(result instanceof A)) - throw "splice failed"; - -result = foo.slice(); -if (!(result instanceof A)) - throw "slice failed"; - -Object.defineProperty(Array, Symbol.species, { value: Int32Array, configurable: true }); - -// We can't write to the length property on a typed array by default. -Object.defineProperty(Int32Array.prototype, "length", { value: 0, writable: true }); - -function shouldThrow(f, m) { - let err; - try { - f(); - } catch(e) { - err = e; - } - if (err.toString() !== m) - throw new Error("Wrong error: " + err); -} - -function test() { - const message = "TypeError: Attempting to configure non-configurable property on a typed array at index: 0"; - shouldThrow(() => foo.concat([1]), message); - foo = [1,2,3,4]; - shouldThrow(() => foo.slice(0), message); - foo = [1,2,3,4]; - let r = foo.splice(); - if (!(r instanceof Int32Array)) - throw "Bad"; - if (r.length !== 0) - throw "Bad"; - foo = [1,2,3,4]; - shouldThrow(() => foo.splice(0), message); -} -noInline(test); -for (let i = 0; i < 3000; ++i) - test(); diff --git a/implementation-contributed/javascriptcore/stress/array-species-functions.js b/implementation-contributed/javascriptcore/stress/array-species-functions.js deleted file mode 100644 index dca7c89ece..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-species-functions.js +++ /dev/null @@ -1,83 +0,0 @@ -C = class extends Array { } -N = class { } -N[Symbol.species] = function() { throw "this should never be called"; } - -function id(x) { return x; } - -testFunctions = [ - [Array.prototype.concat, []], - [Array.prototype.slice, [1,2]], - [Array.prototype.splice, []], - [Array.prototype.splice, [0,1]], - [Array.prototype.map, [id]], - [Array.prototype.filter, [id]] -]; - -objProp = Object.defineProperty; - -function funcThrows(func, args) { - try { - func.call(...args) - return false; - } catch (e) { - return true; - } -} - -function test(testData) { - "use strict"; - let [protoFunction, args] = testData; - let foo = new C(10); - let n = new N(); - - // Test non-array ignores constructor. - objProp(n, "constructor", { value: C }); - let bar = protoFunction.call(n, ...args); - if (!(bar instanceof Array) || bar instanceof N || bar instanceof C) - throw Error(); - - objProp(foo, "constructor", { value: null }); - if (!funcThrows(protoFunction, [foo, ...args])) - throw "didn't throw"; - - // Test array defaults cases. - foo = new C(10); - - objProp(C, Symbol.species, { value: undefined, writable: true}); - bar = protoFunction.call(foo, ...args); - if (!(bar instanceof Array) || bar instanceof C) - throw Error(); - - C[Symbol.species] = null; - bar = protoFunction.call(foo, ...args); - if (!(bar instanceof Array) || bar instanceof C) - throw Error(); - - // Test species is custom constructor. - let called = false; - function species(...args) { - called = true; - return new C(...args); - } - - C[Symbol.species] = species; - bar = protoFunction.call(foo, ...args); - - if (!(bar instanceof Array) || !(bar instanceof C) || !called) - throw Error("failed on " + protoFunction); - - function speciesThrows() { - throw Error(); - } - - C[Symbol.species] = speciesThrows; - if (!funcThrows(protoFunction, [foo, ...args])) - throw "didn't throw"; - - C[Symbol.species] = true; - if (!funcThrows(protoFunction, [foo, ...args])) - throw "didn't throw"; - -} - -testFunctions.forEach(test); diff --git a/implementation-contributed/javascriptcore/stress/array-storage-array-unshift.js b/implementation-contributed/javascriptcore/stress/array-storage-array-unshift.js deleted file mode 100644 index a4ae62c592..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-storage-array-unshift.js +++ /dev/null @@ -1,8 +0,0 @@ -//@ runDefault -var x = [2.5, 1.5]; -x.length = 1000000000; -x.length = 2; -Array.prototype.unshift.call(x, 3.5); -if (x.toString() != "3.5,2.5,1.5") - throw "Error: bad result: " + describe(x); - diff --git a/implementation-contributed/javascriptcore/stress/array-storage-get-by-val.js b/implementation-contributed/javascriptcore/stress/array-storage-get-by-val.js deleted file mode 100644 index c8dcba5423..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-storage-get-by-val.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var object = { a: 10 }; -Object.defineProperties(object, { - "0": { - get: function() { return this.a; }, - set: function(x) { this.a = x; }, - }, -}); - -var array = [ 0, 1, 2, 3, 4, 5 ]; -ensureArrayStorage(array); - -function testOutOfBound() -{ - var results = 0; - for (var i = 0; i < 1e5; ++i) { - for (var j = 0; j < 7; ++j) { - var value = array[j]; - if (value !== undefined) - results += value; - } - } - return results; -} -noInline(testOutOfBound); - -function testInBound() -{ - var results = 0; - for (var i = 0; i < 1e5; ++i) { - for (var j = 0; j < 6; ++j) - results += array[j]; - } - return results; -} -noInline(testInBound); - -var slowPutArray = [ 0, 1, 2, 3, 4, 5 ]; -ensureArrayStorage(slowPutArray); -slowPutArray.__proto__ = object; - -function testSlowPutOutOfBound() -{ - var results = 0; - for (var i = 0; i < 1e5; ++i) { - for (var j = 0; j < 7; ++j) { - var value = slowPutArray[j]; - if (value !== undefined) - results += value; - } - } - return results; -} -noInline(testSlowPutOutOfBound); - -function testSlowPutInBound() -{ - var results = 0; - for (var i = 0; i < 1e5; ++i) { - for (var j = 0; j < 6; ++j) - results += slowPutArray[j]; - } - return results; -} -noInline(testSlowPutInBound); - -shouldBe(testOutOfBound(), 1500000); -shouldBe(testInBound(), 1500000); -shouldBe(testSlowPutOutOfBound(), 1500000); -shouldBe(testSlowPutInBound(), 1500000); diff --git a/implementation-contributed/javascriptcore/stress/array-storage-length.js b/implementation-contributed/javascriptcore/stress/array-storage-length.js deleted file mode 100644 index 4eb5800997..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-storage-length.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var object = { a: 10 }; -Object.defineProperties(object, { - "0": { - get: function() { return this.a; }, - set: function(x) { this.a = x; }, - }, -}); - -var array = [ 0, 1, 2, 3, 4, 5 ]; -ensureArrayStorage(array); - -function testInBound(array) -{ - return array.length; -} -noInline(testInBound); -for (var i = 0; i < 1e5; ++i) - shouldBe(testInBound(array), 6); - -function testUncountable(array) -{ - return array.length; -} -noInline(testUncountable); -for (var i = 0; i < 1e5; ++i) - shouldBe(testUncountable(array), 6); -array.length = 0xffffffff - 1; -for (var i = 0; i < 1e5; ++i) - shouldBe(testUncountable(array), 0xffffffff - 1); - - -var slowPutArray = [ 0, 1, 2, 3, 4, 5 ]; -ensureArrayStorage(slowPutArray); -slowPutArray.__proto__ = object; - -function testSlowPutInBound(array) -{ - return array.length; -} -noInline(testSlowPutInBound); -for (var i = 0; i < 1e5; ++i) - shouldBe(testSlowPutInBound(slowPutArray), 6); - -function testSlowPutUncountable(array) -{ - return array.length; -} -noInline(testSlowPutUncountable); -for (var i = 0; i < 1e5; ++i) - shouldBe(testSlowPutUncountable(slowPutArray), 6); -slowPutArray.length = 0xffffffff - 1; -for (var i = 0; i < 1e5; ++i) - shouldBe(testSlowPutUncountable(slowPutArray), 0xffffffff - 1); diff --git a/implementation-contributed/javascriptcore/stress/array-symbol-species-lazy-watchpoints.js b/implementation-contributed/javascriptcore/stress/array-symbol-species-lazy-watchpoints.js deleted file mode 100644 index 05e5166098..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-symbol-species-lazy-watchpoints.js +++ /dev/null @@ -1,47 +0,0 @@ -// This tests that the lazy watchpoints we set for Symbol.species in our Builtin arrayPrototype functions work. - - -function test(array) { - array = array.splice(2, 2); - array = array.slice(0, 5); - array = array.concat([1,2,3]); - return array; -} -noInline(test); - -function arrayEq(a, b) { - if (a.length !== b.length) - throw new Error(); - - for (let i = 0; i < a.length; i++) { - if (a[i] !== b[i]) - throw new Error(); - } -} - -for (let i = 0; i < 100; i++) - arrayEq(test([1,2,3,4,5,6,7,8,9]), [3,4,1,2,3]); - -class A extends Array { } - -for (let i = 0; i < 100; i++) { - let result = test(new A(1,2,3,4,5,6,7,8,9)); - arrayEq(result, [3,4,1,2,3]); - if (!(result instanceof A)) - throw new Error(); -} - -for (let i = 0; i < 100; i++) - arrayEq(test([1,2,3,4,5,6,7,8,9]), [3,4,1,2,3]); - -delete Array.prototype.sort; - -for (let i = 0; i < 100; i++) - arrayEq(test([1,2,3,4,5,6,7,8,9]), [3,4,1,2,3]); - -for (let i = 0; i < 100; i++) { - let result = test(new A(1,2,3,4,5,6,7,8,9)); - arrayEq(result, [3,4,1,2,3]); - if (!(result instanceof A)) - throw new Error(); -} diff --git a/implementation-contributed/javascriptcore/stress/array-to-locale-string.js b/implementation-contributed/javascriptcore/stress/array-to-locale-string.js deleted file mode 100644 index 116e629e83..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-to-locale-string.js +++ /dev/null @@ -1,7 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var array = [null, null, null]; -shouldBe(array.toLocaleString(), `,,`) diff --git a/implementation-contributed/javascriptcore/stress/array-unshift-zero-property-storage.js b/implementation-contributed/javascriptcore/stress/array-unshift-zero-property-storage.js deleted file mode 100644 index b4ed0332b9..0000000000 --- a/implementation-contributed/javascriptcore/stress/array-unshift-zero-property-storage.js +++ /dev/null @@ -1,34 +0,0 @@ -let foo = "get some property storage"; -let first = "new first element"; -let bar = "ensure property storage is zeroed"; - -function run(array) { - array.foo = foo; - array.unshift(first, ...new Array(100)); - array.bar = bar; - return array; -} -noInline(run); - -function test() { - let array = run([]); - if (array.foo !== foo) - throw new Error(); - if (array.bar !== bar) - throw new Error(); - if (array[0] !== first) - throw new Error(); - - array = []; - array.unshift(1); - array = run(array); - if (array.foo !== foo) - throw new Error(); - if (array.bar !== bar) - throw new Error(); - if (array[0] !== first) - throw new Error(); -} - -for (let i = 0; i < 1; i++) - test(); diff --git a/implementation-contributed/javascriptcore/stress/arrayify-array-storage-array.js b/implementation-contributed/javascriptcore/stress/arrayify-array-storage-array.js deleted file mode 100644 index c5ba5bbebe..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrayify-array-storage-array.js +++ /dev/null @@ -1,29 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var array = [1, 2, 3, 4, 5]; -var array2 = [1, "HELLO", 3, 4, 5]; -var array3 = [0.1, "OK", 0.3, 0.4, 0.5]; -ensureArrayStorage(array2); -array.ok = 42; -array2.ok = 42; -array3.ok = 42; - -// Arrayify(ArrayStorage) works with ftl-eager -function testArrayStorage(array) -{ - return array.length; -} -noInline(testArrayStorage); - -for (var i = 0; i < 1e6; ++i) { - shouldBe(testArrayStorage(array), 5); - shouldBe(testArrayStorage(array2), 5); - shouldBe(testArrayStorage(array3), 5); -} - -var array4 = {0:1, 1:"HELLO", 2:3, 3:4, 4:5}; -ensureArrayStorage(array4); -shouldBe(testArrayStorage(array4), undefined); diff --git a/implementation-contributed/javascriptcore/stress/arrayify-array-storage-non-array.js b/implementation-contributed/javascriptcore/stress/arrayify-array-storage-non-array.js deleted file mode 100644 index c6f62bb27f..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrayify-array-storage-non-array.js +++ /dev/null @@ -1,28 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var array = {0:1, 1:2, 2:3, 3:4, 4:5}; -var array2 = {0:1, 1:"HELLO", 2:3, 3:4, 4:5}; -var array3 = {0:0.1, 1:"OK", 2:0.3, 3:0.4, 4:0.5}; -ensureArrayStorage(array2); -array.ok = 42; -array2.ok = 42; -array3.ok = 42; - -// Arrayify(ArrayStorage) works with ftl-eager -function testArrayStorage(array) -{ - return array[4]; -} -noInline(testArrayStorage); - -for (var i = 0; i < 1e6; ++i) { - shouldBe(testArrayStorage(array), 5); - shouldBe(testArrayStorage(array2), 5); - shouldBe(testArrayStorage(array3), 0.5); -} - -var array4 = [0, 1, 2, 3, 4]; -shouldBe(testArrayStorage(array4), 4); diff --git a/implementation-contributed/javascriptcore/stress/arrayify-array-storage-typed-array.js b/implementation-contributed/javascriptcore/stress/arrayify-array-storage-typed-array.js deleted file mode 100644 index 34f764f7c8..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrayify-array-storage-typed-array.js +++ /dev/null @@ -1,36 +0,0 @@ -function make1() { - var a = []; - a.__defineGetter__(42, function() { return 42; }); - return a; -} - -noInline(make1); - -function make2() { - return [42]; -} - -noInline(make2); - -for (var i = 0; i < 10000; ++i) { - make1(); - make2(); -} - -function foo(o) { - o[0] = 0; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - foo(make1()); - foo(make2()); -} - -var o = new Int8Array(100); -var b = o.buffer; -foo(o); -if (o.buffer != b) - throw "Error: buffer changed."; - diff --git a/implementation-contributed/javascriptcore/stress/arrayify-array-storage.js b/implementation-contributed/javascriptcore/stress/arrayify-array-storage.js deleted file mode 100644 index 0e1bfa2c34..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrayify-array-storage.js +++ /dev/null @@ -1,25 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var array = [1, 2, 3, 4, 5]; -var array2 = [1, "HELLO", 3, 4, 5]; -var array3 = [0.1, "OK", 0.3, 0.4, 0.5]; -ensureArrayStorage(array2); -array.ok = 42; -array2.ok = 42; -array3.ok = 42; - -// Arrayify(ArrayStorage) works with ftl-eager -function testArrayStorage(array) -{ - return array.length; -} -noInline(testArrayStorage); - -for (var i = 0; i < 1e6; ++i) { - shouldBe(testArrayStorage(array), 5); - shouldBe(testArrayStorage(array2), 5); - shouldBe(testArrayStorage(array3), 5); -} diff --git a/implementation-contributed/javascriptcore/stress/arrayify-fires-watchpoint.js b/implementation-contributed/javascriptcore/stress/arrayify-fires-watchpoint.js deleted file mode 100644 index 5ef7e3315b..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrayify-fires-watchpoint.js +++ /dev/null @@ -1,28 +0,0 @@ -function foo(a, b) { - var x = b.f; - x += a[0]; - return x + b.f; -} - -noInline(foo); - -function test(a, b, c) { - var result = foo(a, b); - if (result != c) - throw new Error("bad result: expected " + c + " but got: " + result); -} - -function makeObjectArray(value) { - var result = {}; - result[0] = value; - return result; -} - -var p = {f:42}; -p[0] = 5; -for (var i = 0; i < 100000; ++i) { - test(makeObjectArray(4), p, 88); - test(makeObjectArray(4.5), p, 88.5); -} - -test(p, p, 89); diff --git a/implementation-contributed/javascriptcore/stress/arrayify-int32-typed-array.js b/implementation-contributed/javascriptcore/stress/arrayify-int32-typed-array.js deleted file mode 100644 index e7dd2e7d9f..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrayify-int32-typed-array.js +++ /dev/null @@ -1,34 +0,0 @@ -function make1() { - return []; -} - -noInline(make1); - -function make2() { - return [42]; -} - -noInline(make2); - -for (var i = 0; i < 10000; ++i) { - make1(); - make2(); -} - -function foo(o) { - o[0] = 0; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - foo(make1()); - foo(make2()); -} - -var o = new Int8Array(100); -var b = o.buffer; -foo(o); -if (o.buffer != b) - throw "Error: buffer changed."; - diff --git a/implementation-contributed/javascriptcore/stress/arrayify-slow-put-array-storage-pass-array-storage.js b/implementation-contributed/javascriptcore/stress/arrayify-slow-put-array-storage-pass-array-storage.js deleted file mode 100644 index dd6ab65af3..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrayify-slow-put-array-storage-pass-array-storage.js +++ /dev/null @@ -1,40 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var object = { a: 10 }; -Object.defineProperties(object, { - "0": { - get: function() { return this.a; }, - set: function(x) { this.a = x; }, - }, -}); - -var array1 = [0.1, "OK", 0.3, 0.4, 0.5]; -var array2 = [1, "HELLO", 3, 4, 5]; -ensureArrayStorage(array2); -array1.ok = 42; -array2.ok = 42; -array2.__proto__ = object; - -// Arrayify(SlowPutArrayStorage) works with ftl-eager -function testArrayStorage(array) -{ - return array.length; -} -noInline(testArrayStorage); - -for (var i = 0; i < 1e6; ++i) { - shouldBe(testArrayStorage(array1), 5); - shouldBe(testArrayStorage(array2), 5); -} - -var array3 = [1, 2, 3]; -ensureArrayStorage(array3); -shouldBe(testArrayStorage(array3), 3); -var array4 = [1, 2, 3]; -shouldBe(testArrayStorage(array4), 3); -var array5 = {0:1, 1:2}; -ensureArrayStorage(array5); -shouldBe(testArrayStorage(array5), undefined); diff --git a/implementation-contributed/javascriptcore/stress/arrayify-slow-put-array-storage.js b/implementation-contributed/javascriptcore/stress/arrayify-slow-put-array-storage.js deleted file mode 100644 index 947908342c..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrayify-slow-put-array-storage.js +++ /dev/null @@ -1,31 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var object = { a: 10 }; -Object.defineProperties(object, { - "0": { - get: function() { return this.a; }, - set: function(x) { this.a = x; }, - }, -}); - -var array1 = [0.1, "OK", 0.3, 0.4, 0.5]; -var array2 = [1, "HELLO", 3, 4, 5]; -ensureArrayStorage(array2); -array1.ok = 42; -array2.ok = 42; -array2.__proto__ = object; - -// Arrayify(SlowPutArrayStorage) works with ftl-eager -function testArrayStorage(array) -{ - return array.length; -} -noInline(testArrayStorage); - -for (var i = 0; i < 1e6; ++i) { - shouldBe(testArrayStorage(array1), 5); - shouldBe(testArrayStorage(array2), 5); -} diff --git a/implementation-contributed/javascriptcore/stress/arrayify-structure-bad-test.js b/implementation-contributed/javascriptcore/stress/arrayify-structure-bad-test.js deleted file mode 100644 index 88edb36688..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrayify-structure-bad-test.js +++ /dev/null @@ -1,22 +0,0 @@ -function foo(a, b) { - var x = b.f; - x += a[0]; - return x + b.f; -} - -noInline(foo); - -function test(a, b, c) { - var result = foo(a, b); - if (result != c) - throw new Error("bad result: expected " + c + " but got: " + result); -} - -var p = {f:42}; -p[0] = 5; -for (var i = 0; i < 100000; ++i) { - test([4], p, 88); - test([4.5], p, 88.5); -} - -test(p, p, 89); diff --git a/implementation-contributed/javascriptcore/stress/arrayify-to-structure-contradiction.js b/implementation-contributed/javascriptcore/stress/arrayify-to-structure-contradiction.js deleted file mode 100644 index 22c80192fe..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrayify-to-structure-contradiction.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(array, v, p) { - array[0] = 10; - if (p) - v = "hello"; - array[0] = v; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var array = [42]; - foo(array, 43, false); - if (array[0] != 43) - throw "Error: bad result: " + array; -} - diff --git a/implementation-contributed/javascriptcore/stress/arrayify.js b/implementation-contributed/javascriptcore/stress/arrayify.js deleted file mode 100644 index 0e851dbdcc..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrayify.js +++ /dev/null @@ -1,41 +0,0 @@ -function arrayifyInt32(array) -{ - for (var i = 0; i < 1e2; ++i) - array[i] = 42; -} -noInline(arrayifyInt32); - -function arrayifyDouble(array) -{ - for (var i = 0; i < 1e2; ++i) - array[i] = 42.195; -} -noInline(arrayifyDouble); - -function arrayifyContiguous(array) -{ - for (var i = 0; i < 1e2; ++i) - array[i] = true; -} -noInline(arrayifyContiguous); - -for (var i = 0; i < 1e4; ++i) { - let cocoa = { name: 'Cocoa' }; - let cappuccino = { name: 'Cappuccino' }; - arrayifyInt32(cocoa); - arrayifyInt32(cappuccino); -} - -for (var i = 0; i < 1e4; ++i) { - let cocoa = { name: 'Cocoa' }; - let cappuccino = { name: 'Cappuccino' }; - arrayifyDouble(cocoa); - arrayifyDouble(cappuccino); -} - -for (var i = 0; i < 1e4; ++i) { - let cocoa = { name: 'Cocoa' }; - let cappuccino = { name: 'Cappuccino' }; - arrayifyContiguous(cocoa); - arrayifyContiguous(cappuccino); -} diff --git a/implementation-contributed/javascriptcore/stress/arrow-function-needs-its-own-structure.js b/implementation-contributed/javascriptcore/stress/arrow-function-needs-its-own-structure.js deleted file mode 100644 index f31625a566..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrow-function-needs-its-own-structure.js +++ /dev/null @@ -1,23 +0,0 @@ -function assert(b) { - if (!b) - throw new Error; -} - -function readPrototype(f) { - return f.prototype; -} -noInline(readPrototype); - -{ - let f1 = function () { }; - let f2 = () => undefined; - for (let i = 0; i < 100; ++i) { - assert(!f2.hasOwnProperty("prototype")); - assert(f1.hasOwnProperty("prototype")); - } - - for (let i = 0; i < 100; ++i) - assert(readPrototype(f2) === undefined); - assert(readPrototype(f1) !== undefined); - assert(readPrototype(f1) === f1.prototype); -} diff --git a/implementation-contributed/javascriptcore/stress/arrow-function-token-is-not-keyword.js b/implementation-contributed/javascriptcore/stress/arrow-function-token-is-not-keyword.js deleted file mode 100644 index eccfbdba7b..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrow-function-token-is-not-keyword.js +++ /dev/null @@ -1,15 +0,0 @@ -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -testSyntaxError(`V={=>`, `SyntaxError: Unexpected token '=>'. Expected a property name.`); diff --git a/implementation-contributed/javascriptcore/stress/arrow-functions-as-default-parameter-values.js b/implementation-contributed/javascriptcore/stress/arrow-functions-as-default-parameter-values.js deleted file mode 100644 index cfb0246b4a..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrow-functions-as-default-parameter-values.js +++ /dev/null @@ -1,203 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} -function test(f, n = 1000) { - for (let i = 0; i < n; i++) - f(); -} - -test(function() { - function foo(x = ()=>this) { - return x(); - } - let o = {}; - assert(foo.call(o) === o); -}) - -test(function() { - function foo(x = ()=>arguments) { - assert(x() === arguments); - } - foo(); -}) - -test(function() { - function foo({x = ()=>arguments}) { - assert(x() === arguments); - } - foo({x:undefined}); -}) - -test(function() { - function foo(x = ()=>arguments) { - let a = x(); - assert(a.length === 3); - assert(a[0] === undefined); - assert(a[1] === 20); - assert(a[2] === 40); - } - foo(undefined, 20, 40); -}) - -test(function() { - function foo(x = ()=>new.target) { - assert(x() === foo); - } - new foo(undefined); -}) - -test(function() { - function foo({x = ()=>new.target}) { - assert(x() === foo); - } - new foo({}); -}) - -test(function() { - function foo(x = ()=>arguments) { - var arguments; - assert(x() === arguments); - } - foo(undefined); -}); - -test(function() { - function foo(x = ()=>arguments) { - var arguments = 25; - assert(x() === arguments); - } - foo(undefined); -}); - -test(function() { - function foo(x = (y = ()=>arguments)=>y()) { - assert(x() === arguments); - } - foo(undefined); -}); - -test(function() { - function foo({x = (y = ()=>arguments)=>y()}) { - assert(x() === arguments); - } - foo({}); -}); - -test(function() { - function foo(x = (y = ()=>this)=>y()) { - return x(); - } - let o = {}; - foo.call(o); -}); - -test(function() { - function foo(x = (y = ()=>new.target)=>y()) { - assert(x() === foo); - } - new foo(); -}); - -test(function() { - function foo(x = (y = ()=>new.target)=>y()) { - assert(x() === undefined); - } - foo(); -}); - -test(function() { - class C { - constructor() { this._x = 45; } - get foo() { return this._x;} - } - class D extends C { - constructor(x = () => super.foo) { - super(); - assert(x() === 45); - } - x(x = ()=>super.foo) { - return x(); - } - } - assert((new D).x() === 45); -}); - -test(function() { - class C { - constructor() { this._x = 45; } - get foo() { return this._x;} - } - class D extends C { - x(x = () => {return super.foo}) { - return x(); - } - } - assert((new D).x() === 45); -}); - -test(function() { - class C { - constructor() { this._x = 45; } - get foo() { return this._x;} - } - class D extends C { - x(x = () => {return () => super.foo}) { - return x()(); - } - } - assert((new D).x() === 45); -}); - -test(function() { - class C { - constructor() { this._x = 45; } - get foo() { return this._x;} - } - - class D extends C { - x(y = (y = () => super.foo) => {return y()}) { - return y(); - } - } - assert((new D).x() === 45); -}); - -test(function() { - class C { - constructor() { this._x = 45; } - get foo() { return this._x;} - } - - class D extends C { - constructor(x = () => super.foo) { - super(); - this._x_f = x; - } - - x() { - return this._x_f(); - } - } - assert((new D).x() === 45); -}); - -test(function() { - class C { - constructor() { this._x = 45; } - get foo() { return this._x;} - } - - class D extends C { - - constructor(x = () => super()) { - x(); - } - - x() { - return super.foo; - } - } - assert((new D).x() === 45); -}); - diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-activation-sink-osrexit-default-value-tdz-error.js b/implementation-contributed/javascriptcore/stress/arrowfunction-activation-sink-osrexit-default-value-tdz-error.js deleted file mode 100644 index c1e3a66ea9..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-activation-sink-osrexit-default-value-tdz-error.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; - -var n = 1000000; - -function shouldThrowTDZ(func) { - var hasThrown = false; - try { - func(); - } catch(e) { - if (e.name.indexOf("ReferenceError") !== -1) - hasThrown = true; - } - if (!hasThrown) - throw new Error("Did not throw TDZ error"); -} - -function bar(f) { } - -function foo(b) { - let result = 0; - var set = (x) => { result = x; return tdzPerpetrator; } - if (b) { - OSRExit(); - if (b) { - bar(set); - return tdzPerpetrator; - } - } - let tdzPerpetrator; - return result; -} - -noInline(bar); -noInline(foo); -noInline(shouldThrowTDZ); - -for (var i = 0; i < n; i++) { - var bool = !(i % 100); - if (bool) - shouldThrowTDZ(()=> { foo(bool); }); - else { - var result = foo(bool); - if (result != 0) - throw "Error: bad result: " + result; - } -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-activation-sink-osrexit-default-value.js b/implementation-contributed/javascriptcore/stress/arrowfunction-activation-sink-osrexit-default-value.js deleted file mode 100644 index e41bbe1402..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-activation-sink-osrexit-default-value.js +++ /dev/null @@ -1,37 +0,0 @@ -var n = 1000000; - -function bar(set) { - var result = set(0); - if (result !== void 0) - throw "Error: bad value: " + result; -} - -function foo(b) { - var result = 0; - var imUndefined; - var baz; - var set = (x) => { - result = x; - if (baz !== 50) - throw "Error: bad value: " + baz; - return imUndefined; - }; - baz = 50; - if (b) { - OSRExit(); - if (b) { - bar(set); - } - return 0; - } - return result; -} - -noInline(bar); -noInline(foo); - -for (var i = 0; i < n; i++) { - var result = foo(!(i % 100)); - if (result != 0) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-activation-sink-osrexit.js b/implementation-contributed/javascriptcore/stress/arrowfunction-activation-sink-osrexit.js deleted file mode 100644 index 73ec6e2726..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-activation-sink-osrexit.js +++ /dev/null @@ -1,25 +0,0 @@ -var n = 100000; - -function bar() { } - -function foo(b) { - var result = 0; - var set = (x) => { result = x; } - if (b) { - OSRExit(); - if (b) { - bar(set); - } - return 0; - } - return result; -} - -noInline(bar); -noInline(foo); - -for (var i = 0; i < n; i++) { - var result = foo(!(i % 100)); - if (result != 0) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-activation-sink.js b/implementation-contributed/javascriptcore/stress/arrowfunction-activation-sink.js deleted file mode 100644 index 69d9752150..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-activation-sink.js +++ /dev/null @@ -1,24 +0,0 @@ -var n = 1000000; - -function bar(f) { f(10); } - -function foo(b) { - var result = 0; - var set = x => { result = x; } - if (b) { - bar(set); - if (result != 10) - throw "Error: bad: " + result; - return 0; - } - return result; -} - -noInline(bar); -noInline(foo); - -for (var i = 0; i < n; i++) { - var result = foo(!(i % 100)); - if (result != 0) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-bound.js b/implementation-contributed/javascriptcore/stress/arrowfunction-bound.js deleted file mode 100644 index 92032088ab..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-bound.js +++ /dev/null @@ -1,18 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var d = { - x : "bar", - y : function() { return z => this.x + z; } -}; - -noInline(d.y); - -var e = { x : "baz" }; - -for (var i=0; i<10000; i++) { - testCase(d.y().bind(e, "ley")(), "barley", "Error: function bind shouldn't change lexical binding of the arrow function"); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-call.js b/implementation-contributed/javascriptcore/stress/arrowfunction-call.js deleted file mode 100644 index 6877e0ad9c..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-call.js +++ /dev/null @@ -1,18 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var d = { - x : "foo", - y : function() { return () => this.x; } -}; -noInline(d.y); - -var e = { x : "bar" }; - -for (var i=0; i<10000;i++){ - testCase(d.y().call(e), "foo", "Error: function call shouln't change the lexical binding of the arrow function"); - testCase(d.y().apply(e), "foo", "Error: function apply shouln't change the lexical binding of the arrow function"); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-constructor.js b/implementation-contributed/javascriptcore/stress/arrowfunction-constructor.js deleted file mode 100644 index 15beb557d7..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-constructor.js +++ /dev/null @@ -1,22 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var simpleArrowFunction = () => {}; - -noInline(simpleArrowFunction); - -var errorOnCreate = false; - -for (i=0;i<10000;i++) { - try { - var fc = new simpleArrowFunction(); - } - catch (e) { - errorOnCreate = true; - } - - testCase(errorOnCreate, true, "Error: No exception during run new ArrowFunction"); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-arguments-non-strict-1.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-arguments-non-strict-1.js deleted file mode 100644 index bb8ba7a72b..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-arguments-non-strict-1.js +++ /dev/null @@ -1,252 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var txtMsg = 'Error: arguments is not lexically binded inside of the arrow function '; - -function afFactory0() { - return a => arguments; -} - -var af0 = afFactory0('ABC', 'DEF'); - -noInline(af0); - -for (var i=0; i<10000; i++) { - var arr = af0(i); - - testCase(arr.length, 2, txtMsg + "#1"); - testCase(arr[0],'ABC', txtMsg + "#2"); - testCase(arr[1],'DEF', txtMsg + "#3"); - testCase(typeof arr[2], 'undefined', txtMsg + "#4"); -} - - -function afFactory() { - return a => arguments[0]; -} - -var af = afFactory(12); - -noInline(af); - -for (var i=0; i<10000; i++) { - testCase(af(6), 12, txtMsg + "#5"); -} - -function afFactory1(x, y, z) { - return (a, b) => arguments[0] + '-' + arguments[1] + '-' + arguments[2] + '-' + a + '-' + b; -} - -var af1 = afFactory1('AB', 'CD', 'EF'); - -noInline(af1); - -for (var i = 0; i < 10000; i++) { - testCase(af1('G', i), 'AB-CD-EF-G-' + i, txtMsg + "#5"); -} - -if (true) { - let arguments = []; - - var af2 = (x, y) => arguments[0] + '-' + x + y; - - noInline(af2); - - for (var i = 0; i < 10000; i++) { - testCase(af2('ABC', i), 'undefined-ABC' + i, txtMsg + "#6"); - } - - var af3 = () => arguments; - - noInline(af3); - - for (var i = 0; i < 10000; i++) { - testCase(typeof af3('ABC', i), 'object', txtMsg + "#7"); - testCase(typeof af3('ABC', i)[0], 'undefined', txtMsg + "#8"); - } -} - -var afFactory4 = function () { - this.func = (a, b) => arguments[0] + '_' + arguments[1] + '_' + arguments[2] + '_' + a + '_' + b; -}; - -var af4 = new afFactory4('P1', 'Q2', 'R3'); -noInline(af4); - -for (var i = 0; i < 10000; i++) { - testCase(af4.func('EF', i), 'P1_Q2_R3_EF_' + i, txtMsg + "#9"); -} - -var afFactory5 = function () { - this.func = (a, b) => (c, d) => arguments[0] + '_' + arguments[1] + '_' + arguments[2] + '_' + a + '_' + b + '_' + c + '_' + d; -}; - -var af5 = new afFactory5('PQ', 'RS', 'TU'); -noInline(af5); - -for (var i = 0; i < 10000; i++) { - testCase(af5.func('VW', 'XY')('Z',i), 'PQ_RS_TU_VW_XY_Z_' + i, txtMsg + "#9"); -} - -var afNested = function () { - return function () { - this.func = (a, b) => (c, d) => arguments[0] + '_' + arguments[1] + '_' + arguments[2] + '_' + a + '_' + b + '_' + c + '_' + d; - }; -}; - -var afInternal = new afNested('AB', 'CD', 'EF'); -var af6 = new afInternal('GH', 'IJ', 'KL'); -noInline(af6); - -for (var i = 0; i < 10000; i++) { - testCase(af6.func('VW', 'XY')('Z',i), 'GH_IJ_KL_VW_XY_Z_' + i, txtMsg + "#9"); -} - -if (true) { - let arguments = []; - - var obj = { - name : 'id', - method : (index) => arguments[0] + '-' + index - }; - - noInline(obj.method); - - for (var i = 0; i < 10000; i++) { - testCase(obj.method(i), 'undefined-' + i, txtMsg + "#10"); - } -} - -var objFactory = function () { - return { - name : 'nested', - method : (index) => arguments[0] + '-' + index - }; -}; - -var objInternal = objFactory('ABC', 'DEF'); - -for (var i = 0; i < 10000; i++) { - testCase(objInternal.method(i), 'ABC-' + i, txtMsg + "#11"); -} - -var af_block_scope = function (first, x, y) { - let arr; - if (first) { - let arguments = 'branch-1'; - arr = () => arguments; - } else { - let arguments = 'branch-2'; - arr = () => { - if (true) { - let arguments = 'internal-arrow-block-scope'; - return arguments; - } - }; - } - return arr; -}; - -var af_function_scope = function (first, x, y) { - let arr; - var arguments = 'af_function_scope'; - if (first) { - arr = () => arguments; - } else { - arr = () => { - var arguments = 'internal-arrow-scope'; - return arguments; - }; - } - return arr; -}; - -var af_mixed_scope = function (first, x, y) { - let arr; - var arguments = 'af_mixed_scope'; - if (first) { - let arguments = 'local-scope'; - arr = () => arguments; - } else { - let arguments = 'local-scope-2'; - arr = () => { - let arguments = 'internal-arrow-scope'; - return arguments; - }; - } - return arr; -}; - -for (var i = 0; i < 10000; i++) { - testCase(af_block_scope(true, 'A', 'B')('C'), 'branch-1', txtMsg + "#12"); - testCase(af_block_scope(false, 'A', 'B')('C'), 'internal-arrow-block-scope', txtMsg + "#12"); - testCase(af_function_scope(true, 'D', 'E')('F'), 'af_function_scope', txtMsg + "#13"); - testCase(af_function_scope(false, 'D', 'E')('F'), 'internal-arrow-scope', txtMsg + "#13"); - testCase(af_mixed_scope(true, 'G', 'H')('I'), 'local-scope', txtMsg + "#14"); - testCase(af_mixed_scope(false, 'G', 'H')('I'), 'internal-arrow-scope', txtMsg + "#14"); -} - -function foo() { - var x = (p) => eval(p); - return x; -} - -var foo_arr = foo('A', 'B'); - -for (var i = 0; i < 10000; i++) { - testCase(foo_arr('arguments[0]'), 'A', txtMsg + "#15"); - testCase(foo_arr('arguments[1]'), 'B', txtMsg + "#16"); -} - -function boo() { - return () => { - return () => { - return function () { - return () => arguments; - } - } - } -} - -for (var i = 0; i < 10000; i++) { - testCase(boo('A' + i)('B' + i)('D' + i)('E' + i)('G' + i)[0], 'E' + i, txtMsg + "#17"); -} - -var testValue = 'test-value'; - -function f_args () { - if (true) { - let someValue = ''; - if (true) { - let anotherValue = 'value'; - return () => () => () => arguments[0]; - } - } - - return () => 'no-value'; -} - -for (var i = 0; i < 10000; i++) { - let v = f_args(testValue, 'anotherValue')()()(); - testCase(v, testValue); -} - -function f_args_eval () { - if (true) { - let someValue = ''; - if (true) { - let anotherValue = 'value'; - return () => () => () => eval('arguments[0]'); - } - } - - return () => 'no-value'; -} - -for (var i = 0; i < 10000; i++) { - let v = f_args_eval(testValue, 'anotherValue')()()(); - testCase(v, testValue); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-arguments-non-strict-2.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-arguments-non-strict-2.js deleted file mode 100644 index 1b64135cbf..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-arguments-non-strict-2.js +++ /dev/null @@ -1,100 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var txtMsg = 'Error: arguments is not lexically binded inside of the arrow function '; -var text_value = 'function_global_scope'; -var arguments = text_value; - -var arr = a => arguments; - -noInline(arr); - -for (let i=0; i<10000; i++) { - let value = arr(i); - - testCase(value, text_value, txtMsg + "#1"); -} - -function afFactory0() { - return a => arguments; -} - -var af0 = afFactory0('ABC', 'DEF'); - -noInline(af0); - -for (var i=0; i<10000; i++) { - var arr = af0(i); - - testCase(arr.length, 2, txtMsg + "#2"); - testCase(arr[0],'ABC', txtMsg + "#3"); - testCase(arr[1],'DEF', txtMsg + "#4"); - testCase(typeof arr[2], 'undefined', txtMsg + "#5"); -} - -var innerUseStrict = function () { - 'use strict'; - var createArrow = function (a, b, c) { - return (x, y) => arguments[0] + arguments[1] + arguments[2] + x + y; - }; - - let af = createArrow('A', 'B', 'C'); - noInline(af); - - for (var i=0; i<10000; i++) { - let arr = af('D', 'E'); - testCase(arr, 'ABCDE', txtMsg + "#6"); - } -}; - -innerUseStrict(); - -var obj = function (value) { - this.id = value; -}; - -var arr_nesting = () => () => () => new obj('data'); - -for (var i=0; i<10000; i++) { - testCase(arr_nesting()()().id, 'data'); -} - -class A { - constructor() { - this.list = []; - } -}; - -class B extends A { - addObj(obj) { - this.list.push(obj); - this.result = 0; - } - runAll() { - for (let i = 0; i < this.list.length; i++) { - this.result += this.list[i].operand(1); - } - } -}; - -function test() { - let b = new B(); - - function runTest () { - b.addObj({ operand : (value) => value + value }); - b.addObj({ operand : (value) => value + value }); - } - - for (var i = 0; i < 10000; i++) { - runTest(); - } - - b.runAll(); - - testCase(b.result, 40000, txtMsg + "#7"); -} - -test(); diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-arguments-strict.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-arguments-strict.js deleted file mode 100644 index 86ffeff07a..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-arguments-strict.js +++ /dev/null @@ -1,169 +0,0 @@ -'use strict' -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var txtMsg = 'Error: arguments is not lexically binded inside of the arrow function in strict mode'; -var text_value = 'function_global_scope'; - -function afFactory0() { - return a => arguments; -} - -var af0 = afFactory0('ABC', 'DEF'); - -noInline(af0); - -for (var i=0; i<10000; i++) { - let args = af0(i); - - testCase(args.length, 2, txtMsg + "#2"); - testCase(args[0], 'ABC', txtMsg + "#3"); - testCase(args[1], 'DEF', txtMsg + "#4"); - testCase(typeof args[2], 'undefined', txtMsg + "#5"); -} - -for (var i=0; i<10000; i++) { - let args = af0.call(this, i); - - testCase(args.length, 2, txtMsg + "#2"); - testCase(args[0], 'ABC', txtMsg + "#3"); - testCase(args[1], 'DEF', txtMsg + "#4"); - testCase(typeof args[2], 'undefined', txtMsg + "#5"); -} - -for (var i=0; i<10000; i++) { - var args = af0.apply(this, [i]); - - testCase(args.length, 2, txtMsg + "#2"); - testCase(args[0], 'ABC', txtMsg + "#3"); - testCase(args[1], 'DEF', txtMsg + "#4"); - testCase(typeof args[2], 'undefined', txtMsg + "#5"); -} - -var innerUseStrict = function () { - var createArrow = function (a, b, c) { - return (x, y) => arguments[0] + arguments[1] + arguments[2] + x + y; - }; - - let af = createArrow('A', 'B', 'C'); - noInline(af); - - for (var i=0; i<10000; i++) { - let args = af('D', 'E'); - testCase(args, 'ABCDE', txtMsg + "#6"); - } -}; - -innerUseStrict(); - -var obj = function (value) { - this.id = value; -}; - -var arr_nesting = () => () => () => new obj('data'); - -for (var i=0; i<10000; i++) { - testCase(arr_nesting()()().id, 'data'); -} - -function foo() { - var x = (p) => eval(p); - return x; -} - -var foo_arr = foo('A', 'B'); - -for (var i = 0; i < 10000; i++) { - testCase(foo_arr('arguments[0]'), 'A', txtMsg + "#15"); - testCase(foo_arr('arguments[1]'), 'B', txtMsg + "#16"); -} - -function boo() { - return () => { - return () => { - return function () { - return () => arguments; - } - } - } -} - -for (var i = 0; i < 10000; i++) { - testCase(boo('A' + i)('B' + i)('D' + i)('E' + i)('G' + i)[0], 'E' + i, txtMsg + "#17"); -} - -class A { - constructor() { - this.list = []; - } -}; - -class B extends A { - addObj(obj) { - this.list.push(obj); - this.result = 0; - } - runAll() { - for (let i = 0; i < this.list.length; i++) { - this.result += this.list[i].operand(1); - } - } -}; - -function test() { - let b = new B(); - - function runTest () { - b.addObj({ operand : (value) => value + value }); - b.addObj({ operand : (value) => value + value }); - } - - for (var i = 0; i < 10000; i++) { - runTest(); - } - - b.runAll(); - - testCase(b.result, 40000, txtMsg + "#18"); -} - -test(); - -var testValue = 'test-value'; - -function f_args () { - if (true) { - let someValue = ''; - if (true) { - let anotherValue = 'value'; - return () => () => () => arguments[0]; - } - } - - return () => 'no-value'; -} - -for (var i = 0; i < 10000; i++) { - let v = f_args(testValue, 'anotherValue')()()(); - testCase(v, testValue); -} - -function f_args_eval () { - if (true) { - let someValue = ''; - if (true) { - let anotherValue = 'value'; - return () => () => () => eval('arguments[0]'); - } - } - - return () => 'no-value'; -} - -for (var i = 0; i < 10000; i++) { - let v = f_args_eval(testValue, 'anotherValue')()()(); - testCase(v, testValue); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-newtarget.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-newtarget.js deleted file mode 100644 index 6364017826..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-newtarget.js +++ /dev/null @@ -1,194 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -function getTarget(name) { - return x => new.target; -} - -noInline(getTarget) - -for (var i=0; i < 1000; i++) { - var undefinedTarget = getTarget()(); - testCase(undefinedTarget, undefined, "Error: new.target is not lexically binded inside of the arrow function #1.0"); -} - -for (var i = 0; i < 1000; i++) { - var newTarget = new getTarget()(); - testCase(newTarget, getTarget, "Error: new.target is not lexically binded inside of the arrow function #2.0"); -} - -function getTargetWithBlock(name) { - return x => { - if (false) - return new.target; - else - return new.target; - } -} - -noInline(getTargetWithBlock); - -for (var i=0; i < 1000; i++) { - var undefinedTarget = getTargetWithBlock()(); - testCase(undefinedTarget, undefined, "Error: new.target is not lexically binded inside of the arrow function #1.1"); -} - -for (var i = 0; i < 1000; i++) { - var newTarget = new getTargetWithBlock()(); - testCase(newTarget, getTargetWithBlock, "Error: new.target is not lexically binded inside of the arrow function #2.1"); -} - -var passed = false; -var A = class A { - constructor() { - this.idValue = 123; - passed = passed && new.target === B; - } -}; - -var B = class B extends A { - constructor() { - var f = () => { - passed = new.target === B; - super(); - }; - f(); - } -}; - -for (var i = 0; i < 1000; i++) { - passed = false; - var b = new B(); - - testCase(passed, true, "Error: new.target is not lexically binded inside of the arrow function in constructor #3"); -} - -// newTargetLocal - is hidden variable that emited for arrow function -var C = class C extends A { - constructor(tryToAccessToVarInArrow) { - var f = () => { - super(); - if (tryToAccessToVarInArrow) - this.id2 = newTargetLocal; - }; - - f(); - - if (!tryToAccessToVarInArrow) - this.id = newTargetLocal; - } -}; - -var tryToCreateClass = function (val) { - var result = false; - try { - new C(val); - } - catch (e) { - result = e instanceof ReferenceError; - } - - return result; -}; - -for (var i = 0; i < 1000; i++) { - testCase(tryToCreateClass(true), true, "Error: newTargetLocal should be hided variable"); - testCase(tryToCreateClass(false), true, "Error: newTargetLocal should be hided variable"); -} - -function getTargetBlockScope() { - if (true) { - let someValue = ''; - if (true) - return x => new.target; - } - return ()=>value; -} - -for (var i = 0; i < 1000; i++) { - var undefinedTarget = getTargetBlockScope()() - testCase(undefinedTarget, undefined, "Error: new.target is not lexically binded inside of the arrow function #4"); -} - -class D { - getNewTarget() { - var arr = () => { - if (false) { - return new.target; - } else { - return new.target; - } - } - return arr(); - } -}; - -class E extends D { - getParentNewTarget() { - return super.getNewTarget(); - } -} - -var e = new E(); - -for (var i = 0; i < 1000; i++) { - var parentNewTarget = e.getParentNewTarget(); - testCase(parentNewTarget, undefined, "Error: new.target is not lexically binded inside of the arrow function #5"); -} - - -class F { - constructor() { - let c; - eval('c=(()=>new.target===F)()'); - this.result = c; - } - getNewTargetFromEval() { - return eval('(()=>new.target===F)()'); - } -} - -var f = new F(); - -testCase(f.result, true, "Error: new.target is not lexically binded inside of the arrow function #6"); -testCase(f.getNewTargetFromEval(), false, "Error: new.target is not lexically binded inside of the arrow function #7"); - -class G extends A { - constructor() { - var arr; - super(); - eval('arr = () => new.target'); - this.arrow = arr; - } -} - -let g = new G(); - -testCase(g.arrow(), G, "Error: new.target is not lexically binded inside of the arrow function #8"); - -class H extends A { - constructor() { - var arr; - super(); - eval('arr = () => eval("(() => new.target)()")'); - this.arrow = arr; - } -} - -let h = new H(); - -testCase(h.arrow(), H, "Error: new.target is not lexically binded inside of the arrow function #9"); - -class J extends A { - constructor() { - super(); - this.result = eval('eval("(() => new.target)()")'); - } -} - -let j = new J(); - -testCase(j.result, J, "Error: new.target is not lexically binded inside of the arrow function #10"); diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-supercall-1.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-supercall-1.js deleted file mode 100644 index c247147dfd..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-supercall-1.js +++ /dev/null @@ -1,67 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var testValue = 'test-value'; - -var A = class A { - constructor() { - this.idValue = testValue; - } -}; - -var B = class B extends A { - constructor (inArrowFuction, inConstructor) { - var arrow = () => { - if (inArrowFuction) { - super(); - testCase(this.idValue, testValue, "Error: super() should create this and put value into idValue property"); - } - } - - if (inArrowFuction) - arrow(); - - if (inConstructor) - super(); - - testCase(this.idValue, testValue, "Error: arrow function should return this to constructor"); - } -}; - -for (var i = 0; i < 1000; i++) { - new B(true, false); - new B(false, true); -} - -var testException = function (value1, value2, index) { - var exception; - try { - new B(value1, value2); - } catch (e) { - exception = e; - if (!(e instanceof ReferenceError)) - throw "Exception thrown was not a reference error"; - } - - if (!exception) - throw "Exception not thrown for an unitialized this at iteration " + index; -} - -for (var i=0; i < 1000; i++) { - testException(false, false, i); -} - -var C = class C extends A { - constructor() { - eval("var x = 20"); - super(); - let f = () => this; - let xf = f(); - xf.id = 'test-id'; - } -}; - -var c = new C(); diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-supercall-2.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-supercall-2.js deleted file mode 100644 index 83c8e37777..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-supercall-2.js +++ /dev/null @@ -1,176 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var testValue = 'test-value'; - -var A = class A { - constructor() { - this.idValue = testValue; - } -}; - -var B = class B extends A { - constructor (inArrowFuction, inConstructor, setProtoToNull) { - var arrow = () => () => () => { - if (inArrowFuction) { - super(); - testCase(this.idValue, testValue, "Error: super() should create this and put value into idValue property"); - } - }; - - if (inArrowFuction) - arrow()()(); - - if (inConstructor) - super(); - - testCase(this.idValue, testValue, "Error: arrow function should return this to constructor"); - } -}; - -for (var i=0; i < 1000; i++) { - new B(true, false); - new B(false, true); -} - -var testException = function (index) { - var exception; - try { - new B(false, false); - } catch (e) { - exception = e; - if (!(e instanceof ReferenceError)) - throw "Exception thrown was not a correct error. Expected ReferenceError but was " + e.name; - } - - if (!exception) - throw "Exception not thrown for an unitialized this at iteration #" + index; -} - -for (var i = 0; i < 1000; i++) { - testException(i, ReferenceError); -} - -var C = class C extends A { - constructor () { - var arrow = () => { - let __proto__ = 'some-text'; - var arr = () => { - testCase(typeof __proto__, 'string', "Erorr: __proto__ variable has wrong type"); - super(); - testCase(this.idValue, testValue, "Error: super() should create this and put value into idValue property"); - }; - arr(); - }; - - arrow(); - - testCase(this.idValue, testValue, "Error: arrow function should return this to constructor"); - } -}; - -for (var i = 0; i < 1000; i++) { - new C(); -} - -class D extends A { - constructor(doReplaceProto) { - var arrow = () => super(); - if (doReplaceProto) - D.__proto__ = function () {}; - arrow(); - } -} - -testCase((new D(false)).idValue, testValue, "Error: arrow function bound wrong super"); -testCase(typeof (new D(true)).idValue, "undefined" , "Error: arrow function bound wrong super"); - -class E extends A { - constructor(doReplaceProto) { - var arrow = () => { - if (doReplaceProto) - E.__proto__ = function () {}; - super(); - }; - - arrow(); - } -} - -testCase((new E(false)).idValue, testValue, "Error: arrow function bound wrong super #1"); -testCase(typeof (new E(true)).idValue, "undefined" , "Error: arrow function bound wrong super #1"); - - -class F extends A { - constructor(doReplaceProto) { - var arrow = () => { - F.__proto__ = null; - super(); - }; - - arrow(); - } -} - -var testTypeErrorException = function (index) { - var exception; - try { - new F(); - } catch (e) { - exception = e; - if (!(e instanceof TypeError)) - throw "Exception thrown was not a correct error. Expected TypeError but was " + e.name; - } - - if (!exception) - throw "Exception not thrown for an unitialized this at iteration #" + index; -} - -for (var i = 0; i < 1000; i++) { - testTypeErrorException(i); -} - -var errorStack; - -var ParentClass = class ParentClass { - constructor() { - try { - this.idValue = testValue; - throw new Error('Error'); - } catch (e) { - errorStack = e.stack; - } - } -}; - -var ChildClass = class ChildClass extends ParentClass { - constructor () { - var arrowInChildConstructor = () => { - var nestedArrow = () => { - super(); - } - - nestedArrow(); - }; - - arrowInChildConstructor(); - } -}; - -for (var i = 0; i < 1000; i++) { - errorStack = ''; - let c = new ChildClass(); - - let parentClassIndexOf = errorStack.indexOf('ParentClass'); - let nestedArrowIndexOf = errorStack.indexOf('nestedArrow'); - let arrowInChildConstructorIndexOf = errorStack.indexOf('arrowInChildConstructor'); - let childClassIndexOf = errorStack.indexOf('ChildClass'); - - testCase(parentClassIndexOf > -1 && errorStack.indexOf('ParentClass', parentClassIndexOf + 1) === -1, true, "Error: stack of error should contain ParentClass text"); - testCase(nestedArrowIndexOf > -1 && errorStack.indexOf('nestedArrow', nestedArrowIndexOf + 1) === -1, true, "Error: stack of error should contain nestedArrow text"); - testCase(arrowInChildConstructorIndexOf > -1 && errorStack.indexOf('arrowInChildConstructor', arrowInChildConstructorIndexOf + 1) === -1, true, "Error: stack of error should contain arrowInChildConstructor text"); - testCase(childClassIndexOf > -1 && errorStack.indexOf('ChildClass', childClassIndexOf + 1) === -1, true, "Error: stack of error should contains ChildClass text"); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-supercall-3.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-supercall-3.js deleted file mode 100644 index 6fbb6d5acb..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-supercall-3.js +++ /dev/null @@ -1,52 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var testValue = 'test-value'; - -var A = class A { - constructor() { - this.idValue = testValue; - } -}; - -var B = class B extends A { - constructor (beforeSuper) { - var arrow = () => eval('(() => this.idValue)()'); - - if (beforeSuper) { - var result = arrow(); - super(); - testCase(result, testValue, "Error: has to be TDZ error"); - } else { - super(); - let result= arrow(); - testCase(result, testValue, "Error: super() should create this and put value into idValue property"); - } - } -}; - -for (var i = 0; i < 1000; i++) { - var b = new B(false); -} - -var testException = function (value, index) { - var exception; - try { - new B(value); - } catch (e) { - exception = e; - if (!(e instanceof ReferenceError)) - throw "Exception thrown was not a reference error"; - } - - if (!exception) - throw "Exception not thrown for an unitialized this at iteration #" + index; -} - - -for (var i = 0; i < 1000; i++) { - testException(true, i); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-supercall-4.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-supercall-4.js deleted file mode 100644 index fb887c26ae..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-supercall-4.js +++ /dev/null @@ -1,198 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var testValue = 'test-value'; -var testIdValue = 'test-id-value'; - -var A = class A { - constructor() { - this.idValue = testValue; - } -}; - -var B = class B extends A { - constructor (beforeSuper) { - - var arrow = () => eval('(() => super())()'); - - if (beforeSuper) { - arrow(); - testCase(this.idValue, testValue, "Error: super() should create this and put value into idValue property"); - } else { - testCase(this.idValue, testValue, "Error: has to be TDZ error"); - arrow(); - } - } -}; - -var C = class C extends A { - constructor () { - var arrow = () => eval('(() => super())()'); - arrow(); - return { - value : 'constructor-value' - }; - } -}; - -var D = class D extends A { - constructor () { - var arrow = () => eval('(() => super())()'); - arrow(); - eval('this.id="new-value"'); - } -}; - -var E = class E extends A { - constructor () { - var arrow = () => eval("eval('(() => super())()')"); - arrow(); - eval('eval("this.id=\'new-value\'")'); - } -}; - - -for (var i=0; i < 1000; i++) { - new B(true); - var c = new C(); - testCase(c.value, 'constructor-value', 'Error during set value in eval #1.0'); - testCase(typeof c.id, 'undefined', 'Error during set value in eval #1.1'); - var d = new D(); - testCase(d.idValue, testValue, 'Error during set value in eval #2.0'); - testCase(d.id, 'new-value', 'Error during set value in eval #2.1'); - var e = new E(); - testCase(e.idValue, testValue, 'Error during set value in eval #3.0'); - testCase(e.id, 'new-value', 'Error during set value in eval #3.0'); -} - -var testException = function (Klass, value, index) { - var exception; - try { - new Klass(value); - } catch (e) { - exception = e; - if (!(e instanceof ReferenceError)) - throw "Exception thrown was not a reference error"; - } - - if (!exception) - throw "Exception not thrown for an unitialized this at iteration #" + index; -} - -for (var i=0; i < 1000; i++) { - testException(B, false, i); -} - -class F extends A { - constructor() { - var arr_after = () => { - this.idValue = 'this-value'; - }; - var arr_before = () => { - return 'not-some-value'; - }; - arr_before(); - super(); - arr_after(); - } -} - -let f = new F(); -testCase(f.idValue, 'this-value', 'Error: not correct binding of this in constructor'); - -class G extends A { - constructor() { - var arr_simple = () => { - return 'not-some-value'; - }; - var arr_super = () => { - super(); - }; - arr_simple(); - arr_super(); - } -} - -let g = new G(); -testCase(g.idValue, testValue, 'Error: not correct binding super&this in constructor'); - -class A_this_Prop extends A { - getValue () { - return this.idValue; - } -} - -class H extends A_this_Prop { - constructor() { - var arr_simple = () => { - return 'not-some-value'; - }; - var arr_super = () => { - super(); - }; - var arr_value = () => super.getValue(); - arr_simple(); - arr_super(); - this.someValue = arr_value(); - } -} - -let h = new H(); -testCase(h.someValue, testValue, 'Error: not correct binding superProperty&this in constructor'); - -class I extends A { - constructor (beforeSuper) { - if (beforeSuper) { - eval('(() => super())()'); - testCase(this.idValue, testValue, "Error: super() should create this and put value into idValue property"); - } else { - this.idValue = 'testValue'; - eval('(() => super())()'); - } - } -}; - -let ic = new I(true); -testCase(ic.idValue, testValue, 'Error: not correct binding superProperty&this in constructor'); - -for (var i=0; i < 1000; i++) { - testException(I, false, i); -} - -class J extends A { - constructor (beforeSuper) { - if (beforeSuper) { - const arr = () => { eval('super()'); this._id = testIdValue; }; - arr(); - } - testCase(this.idValue, testValue, "Error: super() should create this and put value into idValue property"); - } -}; - -let jc = new J(true); -testCase(jc.idValue, testValue, 'Error: not correct binding superProperty&this in constructor'); - -for (var i=0; i < 1000; i++) { - testException(J, false, i); -} - -class K extends A { - constructor (beforeSuper) { - if (beforeSuper) { - const arr = () => { (() => () => eval('super()'))()(); (() => { this._id = testIdValue; })(); }; - arr(); - } - testCase(this.idValue, testValue, "Error: super() should create this and put value into idValue property"); - } -}; - -let kc = new K(true); -testCase(kc.idValue, testValue, 'Error: not correct binding superProperty&this in constructor'); - -for (var i=0; i < 1000; i++) { - testException(K, false, i); -} - diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-superproperty.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-superproperty.js deleted file mode 100644 index 9635c4eebc..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-superproperty.js +++ /dev/null @@ -1,290 +0,0 @@ -//@ defaultNoNoLLIntRun if $architecture == "arm" - -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var testValue = 'test-value'; - -var A = class A { - constructor() { - this.value = testValue; - } - getConstValue () { - return testValue; - } - getValue () { - return this.value; - } - setValue (value) { - this.value = value; - } -}; - -var B = class B extends A { - getParentValue() { - var arrow = () => super.getValue(); - return arrow(); - } -}; - -var C = class C { - constructor() { - this.value = testValue; - } - static getStaticValue() { - return testValue; - } -}; - -var D = class D extends C { - static getParentStaticValue() { - var arrow = () => super.getStaticValue(); - return arrow(); - } -}; - -var E = class E extends A { - constructor() { - super(); - } - get prop() { - var arrow = () => super.getConstValue() + '-' + this.value; - return arrow(); - } - set prop(value) { - var arrow = (newVal) => super.setValue(newVal); - arrow(value); - } - setInitValue() { - this.value = testValue; - } - }; - -var b = new B(); -for (var i = 0; i < 10000; i++) { - testCase(b.getParentValue(), testValue, i); -} - -for (var i = 0; i < 10000; i++) { - testCase(D.getParentStaticValue(), testValue, i); -} - -var e = new E(); -for (var i = 0; i < 10000; i++) { - e.setInitValue(); - testCase(e.prop, testValue+'-'+testValue, i); - e.prop = 'new-test-value'; - testCase(e.prop, testValue+'-new-test-value', i); -} - -var F = class F extends A { - newMethod() { - var arrow = () => eval('super.getValue()'); - var r = arrow(); - return r; - } -}; - -var f = new F(); -for (var i=0; i < 10000; i++) { - try { - var result = f.newMethod(); - testCase(result, testValue, i); - } catch(e) { - if (!(e instanceof SyntaxError)) - throw e; - } -} - -var G = class G extends A { - constructor() { - super(); - } - get prop() { - var arrow = () => () => super.getConstValue() + '-' + this.value; - return arrow()(); - } - set prop(value) { - var arrow = () => (newVal) => this.value = newVal; - arrow()(value); - } - setInitValue() { - this.value = testValue; - } - getValueCB() { - var arrow = () => super.getValue(); - return arrow; - } - setValueCB() { - var arrow = (newVal) => this.value = newVal; - return arrow; - } - getParentValue() { - return super.getValue(); - } - - getValueBlockScope() { - if (true) { - var someValue =''; - if (true) { - return () => { - if (true) { - let internalValue = ''; - return super.getValue(); - } - } - } - } - } - *genGetParentValue() { - let arr = () => super.getValue(); - yield arr(); - } - *genGetParentValueDeepArrow() { - let arr = () => () => () => super.getValue(); - yield arr()()(); - } - }; - - var g = new G(); - for (var i = 0; i < 10000; i++) { - g.setInitValue(); - testCase(g.prop, testValue + '-' + testValue, 'Error: Some problem with using arrow and "super" inside of the method'); - g.prop = 'new-test-value'; - testCase(g.prop, testValue + '-new-test-value', 'Error: Some problem with using arrow and "super" inside of the getter and setter'); - } - -var g1 = new G(); -for (var i = 0; i < 10000; i++) { - g1.setInitValue(); - let getValue = g1.getValueCB(); - testCase(getValue(), testValue, 'Error: Some problem with using arrow and "super" inside of the method that retun arrow function'); - let setValue = g1.setValueCB(); - setValue('new-value'); - testCase(getValue(), 'new-value', 'Error: Some problem with using arrow and "super" inside of the method that retun arrow function'); - getValue = g1.getValueBlockScope(); - testCase(getValue(), 'new-value', 'Error: Some problem with using arrow and "super" with deep nesting inside of the method that retun arrow function'); - testCase(g1.genGetParentValue().next().value, 'new-value', 'Error: Some problem with using arrow and "super" with deep nesting inside of the generator method that retun arrow function'); - testCase(g1.genGetParentValueDeepArrow().next().value, 'new-value', 'Error: Some problem with using arrow and "super" with deep nesting inside of the generator method that retun arrow function'); -} - -var H = class H extends A { - constructor() { - var arrow = () => () => super.getValue(); - super(); - this.newValue = arrow()(); - } -}; - -for (var i = 0; i < 10000; i++) { - let h = new H(); - testCase(h.newValue, testValue, 'Error: Some problem with using "super" inside of the constructor'); -} - -var I = class I extends A { - constructor (beforeSuper) { - var arrow = () => super.getValue(); - if (beforeSuper) { - this._value = arrow(); - super(); - } else { - super(); - this._value = arrow(); - } - } -} - -var J = class J extends A { - constructor (beforeSuper) { - var _value; - var arrow = () => super.getConstValue(); - if (beforeSuper) { - _value = arrow(); - super(); - } else { - super(); - _value = arrow(); - } - this._value = _value; - } -} - -for (var i = 0; i < 10000; i++) { - let i = new I(false); - testCase(i._value, testValue, 'Error: Some problem with using "super" inside of the constructor'); - let j = new J(false); - testCase(j._value, testValue, 'Error: Some problem with using "super" inside of the constructor'); - - // FIXME: Problem with access to the super before super() in constructor - // https://bugs.webkit.org/show_bug.cgi?id=152108 - //let j2 = new J(true); - //testCase(j2._value, testValue, 'Error: Some problem with using "super" inside of the constructor'); - error = false; - try { - new I(true); - } catch (e) { - error = e instanceof ReferenceError; - } - testCase(error, true, 'Error: using "super" property before super() should lead to error'); -} - -class K extends A { - newMethodArrowEval() { - var arrow = () => eval('super.getValue()'); - var r = arrow(); - return r; - } - newMethodArrowDoubleEval() { - var arrow = () => eval("eval('super.getValue()')"); - var r = arrow(); - return r; - } - newMethodArrowEvalEvalArrow() { - var arrow = () => eval("eval('(() => super.getValue())()')"); - var r = arrow(); - return r; - } - newMethodArrowEvalEvalArrowEval() { - var arrow = () => eval("eval('(() => eval(\"super.getValue()\"))()')"); - var r = arrow(); - return r; - } - newMethodEval() { - var r = eval("super.getValue()"); - return r; - } - newMethodEvalEval() { - var r = eval("eval('super.getValue()')"); - return r; - } - newMethodEvalArrow() { - var r = eval("(() => super.getValue())()"); - return r; - } - newMethodEvalEvalArrow() { - var r = eval("eval('(() => super.getValue())()')"); - return r; - } - newMethodEvalEvalArrowEval() { - var r = eval("eval('(() => eval(\"(super.getValue())\"))()')"); - return r; - } -} - -var k = new K(); - -for (var i = 0; i < 1000; i++) { - testCase(k.newMethodArrowEval() , testValue, 'Error: Error in lexical bind with eval and arrow function #1'); - testCase(k.newMethodArrowDoubleEval() , testValue, 'Error: Error in lexical bind with eval and arrow function #2'); - testCase(k.newMethodArrowEvalEvalArrow() , testValue, 'Error: Error in lexical bind with eval and arrow function #3'); - testCase(k.newMethodArrowEvalEvalArrowEval() , testValue, 'Error: Error in lexical bind with eval and arrow function #4'); - - testCase(k.newMethodEval() , testValue, 'Error: Error in lexical bind with eval and arrow function #5'); - testCase(k.newMethodEvalEval() , testValue, 'Error: Error in lexical bind with eval and arrow function #6'); - testCase(k.newMethodEvalArrow() , testValue, 'Error: Error in lexical bind with eval and arrow function #7'); - testCase(k.newMethodEvalEvalArrow() , testValue, 'Error: Error in lexical bind with eval and arrow function 8'); - testCase(k.newMethodEvalEvalArrowEval() , testValue, 'Error: Error in lexical bind with eval and arrow function #9'); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-1.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-1.js deleted file mode 100644 index 69cb8cd8ee..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-1.js +++ /dev/null @@ -1,21 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -function Dog(name) { - this.name = name; - this.getName = () => eval("this.name"); - this.getNameHard = () => eval("(() => this.name)()"); - this.getNameReallyHard = () => eval("eval('(() => this.name)()')"); -} - -noInline(Dog) - -for (var i=0;i<10000; i++) { - var d = new Dog("Max"); - testCase(d.getName(), d.name, "Error: this is not lexically binded inside of the arrow function #1"); - testCase(d.getNameHard(), d.name, "Error: this is not lexically binded inside of the arrow function #2"); - testCase(d.getNameReallyHard(), d.name, "Error: this is not lexically binded inside of the arrow function #3"); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-2.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-2.js deleted file mode 100644 index 83e90a86c3..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-2.js +++ /dev/null @@ -1,92 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var functionConstructor = function () { - this.func = () => this; -}; - -var instance = new functionConstructor(); - -testCase(instance.func() === instance, true, "Error: this is not lexically binded inside of the arrow function #2"); - -var obj = { - method: function () { - return () => this; - } -}; - -noInline(obj.method); - -for (var i=0; i < 10000; i++) { - testCase(obj.method()() === obj, true, "Error: this is not lexically binded inside of the arrow function #3"); -} - -var fake = {steal: obj.method()}; -noInline(fake.steal); - -for (var i=0; i < 10000; i++) { - testCase(fake.steal() === obj, true, "Error: this is not lexically binded inside of the arrow function #4"); -} - -var real = {borrow: obj.method}; -noInline(real.borrow); - -for (var i=0; i < 10000; i++) { - testCase(real.borrow()() === real, true, "Error: this is not lexically binded inside of the arrow function #5"); -} - -// Force create the lexical env inside of arrow function - -var functionConstructorWithEval = function () { - this._id = 'old-value'; - this.func = () => { - var f; - eval('10==10'); - this._id = 'new-value'; - return this._id; - }; -}; - -var arrowWithEval = new functionConstructorWithEval(); - -for (var i=0; i < 10000; i++) { - testCase(arrowWithEval.func() === 'new-value', true, "Error: this is not lexically binded inside of the arrow function #6"); -} - -function foo() { - let arr = () => { - var x = 123; - function bas() { - return x; - }; - this._id = '12345'; - return bas(); - }; - this.arr = arr; -}; - -var fooObject = new foo(); - -function fooDefault() { - let arr = (that = this) => { - var x = 123; - function bas() { - return x; - }; - that._id = '12345'; - return bas(); - }; - this.arr = arr; -}; - -var fooDefaultObject = new fooDefault(); - -for (var i=0; i < 10000; i++) { - testCase(fooObject.arr() === 123, true, "Error: this is not lexically binded inside of the arrow function #7"); - testCase(fooObject._id === '12345', true, "Error: this is not lexically binded inside of the arrow function #8"); - testCase(fooDefaultObject.arr() === 123, true, "Error: this is not lexically binded inside of the arrow function #7"); - testCase(fooDefaultObject._id === '12345', true, "Error: this is not lexically binded inside of the arrow function #8"); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-3.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-3.js deleted file mode 100644 index 1019086d58..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-3.js +++ /dev/null @@ -1,28 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - - -var obj = { name:'obj', method: function () { return (value) => this.name + "-name-" + value; }}; - -for (var i=0; i<10000; i++) { - testCase(obj.method()('test' + i.toString()), 'obj-name-test' + i.toString(), "Error: this is not lexically binded inside of the arrow function #1"); -} - -for (var i=0; i<10000; i++) { - var result1 = obj.method()('test' + i.toString()); - testCase(result1, 'obj-name-test' + i.toString(), "Error: this is not lexically binded inside of the arrow function #1"); -} - -obj.name='newObj'; - -for (var i=0; i<10000; i++) { - testCase(obj.method()('test' + i.toString()), 'newObj-name-test' + i.toString(), "Error: this is not lexically binded inside of the arrow function #5"); -} - -for (var i=0; i<10000; i++) { - var result2 = obj.method()('test' + i.toString()); - testCase(result2, 'newObj-name-test' + i.toString(), "Error: this is not lexically binded inside of the arrow function #5"); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-4.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-4.js deleted file mode 100644 index 85bd363e4e..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-4.js +++ /dev/null @@ -1,26 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - - -var obj = { - name:'obj', - internalObject: { - name :'internalObject', - method: function () { return (value) => this.name + "-name-" + value; } - } -}; - -noInline(obj.internalObject.method); - -for (var i=0; i<10000; i++) { - testCase(obj.internalObject.method()('test' + i.toString()), 'internalObject-name-test' + i.toString(), "Error: this is not lexically binded inside of the arrow function #1"); -} - -obj.internalObject.name='newInternalObject'; - -for (var i=0; i<10000; i++) { - testCase(obj.internalObject.method()('test' + i.toString()), 'newInternalObject-name-test' + i.toString(), "Error: this is not lexically binded inside of the arrow function #5"); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-5.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-5.js deleted file mode 100644 index 875494ce6b..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-5.js +++ /dev/null @@ -1,48 +0,0 @@ -var sortedValues; - -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - - -var obj = { - arr: [1, 4, 6, 3, 7, 0], - bubbleSort: function () { - return () => { - var tmp; - var ar = this.arr.slice(); - var _length = ar.length - for (var i = 0; i < _length; i++) { - for (var j = i; j > 0; j--) { - if ((ar[j] - ar[j - 1]) < 0) { - tmp = ar[j]; - ar[j] = ar[j - 1]; - ar[j - 1] = tmp; - } - } - } - return ar; - } - } -}; - -noInline(obj.bubbleSort); - -for (var i=0; i<10000; i++) { - obj.arr = [1, 2, 4, 6, 3, 7, 0]; - testCase(obj.bubbleSort()().length, 7, "Error: this is not lexically binded inside of the arrow function #1"); - - var sortedValues = obj.bubbleSort()(); - testCase(sortedValues[0], 0, "Error: this is not lexically binded inside of the arrow function #6"); - testCase(sortedValues[6], 7, "Error: this is not lexically binded inside of the arrow function #7"); - - obj.arr = [1, 2, 4, 6, 5, 8, 21, 19, 0]; - - testCase(obj.bubbleSort()().length, 9, "Error: this is not lexically binded inside of the arrow function #8"); - - sortedValues = obj.bubbleSort()(); - testCase(sortedValues[1], 1, "Error: this is not lexically binded inside of the arrow function #12"); - testCase(sortedValues[8], 21, "Error: this is not lexically binded inside of the arrow function #13"); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-6.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-6.js deleted file mode 100644 index c417bc7c8f..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-6.js +++ /dev/null @@ -1,24 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -function Dog(name) { - this.name = name; - this.getName = () => this.name; - this.getNameNestingLevel1 = () => () => this.name; - this.getNameNestingLevel2 = () => () => () => this.name; -} - -var d = new Dog("Max"); - -noInline(d.getName()); -noInline(d.getNameNestingLevel1()()); -noInline(d.getNameNestingLevel2()()()); - -for (var i=0;i<10000; i++) { - testCase(d.getName(), d.name, "Error: this is not lexically binded inside of the arrow function #1"); - testCase(d.getNameNestingLevel1()(), d.name, "Error: this is not lexically binded inside of the arrow function #2"); - testCase(d.getNameNestingLevel2()()(), d.name, "Error: this is not lexically binded inside of the arrow function #3"); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-7.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-7.js deleted file mode 100644 index 2f76c9dd6d..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-7.js +++ /dev/null @@ -1,24 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var deepScope = function (x, y) { - var _x = x, _y = y; - return ()=> _x + _y + this.val; -}; - -var a = deepScope.call({val:'A'}, 'D', 'E'); -var b = deepScope.call({val:'B'}, 'D', 'F'); -var c = deepScope.call({val:'C'}, 'D', 'G'); - -var anotherScope = function (_af) { - return _af(); -}; - -for (var i = 0; i < 1000; i++) { - testCase(c(), anotherScope.call({val:'I'}, c), "Error: this is not lexically binded inside of the arrow function #1"); - testCase(b(), anotherScope.call({val:'J'}, b), "Error: this is not lexically binded inside of the arrow function #2"); - testCase(a(), anotherScope.call({val:'K'}, a), "Error: this is not lexically binded inside of the arrow function #3"); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-8.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-8.js deleted file mode 100644 index 8a497a008a..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-bind-this-8.js +++ /dev/null @@ -1,104 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -let testValue = 'test-value'; - -var f_this = function () { - let value = 'value'; - if (true) { - let someValue = 'someValue'; - if (true) { - let = anotherValue = 'value'; - return () => () => () => this.value; - } - } - - return () => value; -} - -for (let i = 0; i < 10000; i++) { - testCase(f_this.call({value : testValue})()()(), testValue); -} - -var f_this_eval = function () { - if (true) { - let someValue = ''; - if (true) { - let = anotherValue = 'value'; - return () => () => () => eval('this.value'); - } - } - - return () => 'no-value'; -} - -for (let i = 0; i < 10000; i++) { - testCase(f_this_eval.call({value : testValue}, false)()()(), testValue); -} - - -function f_this_branches (branch, returnThis) { - let value = 'value'; - if (branch === 'A') { - let someValue = 'someValue'; - if (true) { - let = anotherValue = 'value'; - return () => () => () => { - if (returnThis) - return this.value; - else - return anotherValue; - } - } - } - - return () => value; -} - -for (let i = 0; i < 10000; i++) { - testCase(f_this_branches.call({value : testValue}, 'B')() == testValue, false); - testCase(f_this_branches.call({value : testValue}, 'A', false)()()() == testValue, false); - testCase(f_this_branches.call({value : testValue}, 'A', true)()()(), testValue); -} - -function f_this_eval_branches (branch, returnThis) { - let value = 'value'; - if (branch === 'A') { - let someValue = 'someValue'; - if (true) { - let = anotherValue = 'value'; - return () => () => () => { - if (returnThis) - return eval('this.value'); - else - return anotherValue; - } - } - } - - return () => value; -} - -for (let i = 0; i < 10000; i++) { - testCase(f_this_eval_branches.call({value : testValue}, 'B')() == testValue, false); - testCase(f_this_eval_branches.call({value : testValue}, 'A', false)()()() == testValue, false); - testCase(f_this_eval_branches.call({value : testValue}, 'A', true)()()(), testValue); -} - -let self = this; - -let arrow = () => { - testCase(self, this, "Error: Wrong lexical bind of this"); -}; - -for (let i = 0; i < 10000; i++) { - arrow(); -} - - -for (let i = 0; i < 10000; i++) { - eval("let _self=this;(()=>testCase(self, this, 'Error: Wrong lexical bind of this in eval'))();"); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-activation-sink-osrexit.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-activation-sink-osrexit.js deleted file mode 100644 index ad10a31d67..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-activation-sink-osrexit.js +++ /dev/null @@ -1,34 +0,0 @@ -var n = 10000000; - -var newContext = { - id : 'new-context' -}; - -function bar() { } - -function foo(b) { - var result = 0; - var set = (x) => { - // Check if arrow function store context - if (this != newContext || this.id != newContext.id) - throw 'Wrong context of arrow function'; - result = x; - } - if (b) { - OSRExit(); - if (b) { - bar(set); - } - return result; - } - return result; -} - -noInline(bar); -noInline(foo); - -for (var i = 0; i < n; i++) { - var result = foo.call(newContext, !(i % 100)); - if (result != 0) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-activation-sink.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-activation-sink.js deleted file mode 100644 index ca430637c8..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-activation-sink.js +++ /dev/null @@ -1,38 +0,0 @@ -var n = 10000000; - -var newContext = { - id : 'new-context' -}; - -function bar(f) { - if (this == newContext) - throw 'Wrong context of nesting function'; - f(10); -} - -function foo(b) { - var result = 0; - var set = (x) => { - result = x; - // Check if arrow function store context - if (this != newContext || this.id != newContext.id) - throw 'Wrong context of arrow function'; - }; - - if (b) { - bar(set); - if (result != 10) - throw "Error: bad: " + result; - return 0; - } - return result; -} - -noInline(bar); -noInline(foo); - -for (var i = 0; i < n; i++) { - var result = foo.call(newContext, !(i % 100)); - if (result != 0) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-sinking-no-double-allocate.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-sinking-no-double-allocate.js deleted file mode 100644 index 869e027139..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-sinking-no-double-allocate.js +++ /dev/null @@ -1,37 +0,0 @@ -var newContext = { - id : 'new-context' -}; - -function call(o) { o.x = 3; } -noInline(call); - -// Should be invoced by call with substitute this by newContext -function sink (p, q) { - var f = () => { - // Check if arrow function store context - if (this != newContext || this.id != newContext.id) - throw 'Wrong context of arrow function #1'; - }; - if (p) { - call(f); // Force allocation of f - if (q) { - OSRExit(); - } - return f; - } - return { 'x': 2 }; -} -noInline(sink); - -for (var i = 0; i < 100000; ++i) { - var o = sink.call(newContext, true, false); - if (o.x != 3) - throw "Error: expected o.x to be 2 but is " + result; -} - -// At this point, the arrow function should be compiled down to the FTL - -// Check that the function is properly allocated on OSR exit -var f = sink(true, true); -if (f.x != 3) - throw "Error: expected o.x to be 3 but is " + result; diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-sinking-osrexit.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-sinking-osrexit.js deleted file mode 100644 index 7ffcb3fa5b..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-sinking-osrexit.js +++ /dev/null @@ -1,36 +0,0 @@ -var newContext = { - id : 'new-context' -}; - -// Should be invoced by call with substitute this by newContext -function sink (p, q) { - var g = x => { - // Check if arrow function store context - if (this != newContext || this.id != newContext.id) - throw 'Wrong context of arrow function #1'; - return x; - }; - if (p) { if (q) OSRExit(); return g; } - return x => { - // Check if arrow function store context - if (this != newContext || this.id != newContext.id) - throw 'Wrong context of arrow function #2'; - return x; - }; -} -noInline(sink); - -for (var i = 0; i < 10000; ++i) { - var f = sink.call(newContext, true, false);// Substitute this - var result = f(42); - if (result != 42) - throw "Error: expected 42 but got " + result; -} - -// At this point, the function should be compiled down to the FTL - -// Check that the function is properly allocated on OSR exit -var f = sink.call(newContext,true, true);// Substitute this -var result = f(42); -if (result != 42) - throw "Error: expected 42 but got " + result; diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-sinking-put.js b/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-sinking-put.js deleted file mode 100644 index 057ea07635..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-lexical-this-sinking-put.js +++ /dev/null @@ -1,45 +0,0 @@ -var newContext = { - id : 'new-context' -}; - -// Should be invoced by call with substitute this by newContext -function sink (p, q) { - var g = x => { - // Check if arrow function store context - if (this != newContext || this.id != newContext.id) - throw 'Wrong context of arrow function #1'; - - return x; - }; - if (p) { if (q) g.inner = 42; return g; } - return x => { - // Check if arrow function store context - if (this != newContext || this.id != newContext.id) - throw 'Wrong context of arrow function #2'; - - return x; - }; -} -noInline(sink); - -for (var i = 0; i < 10000; ++i) { - var f = sink.call(newContext, true, true);// use call to substitute context - var result = f(42); - if (result != 42) - throw "Error: expected 42 but got " + result; -} - -// At this point, the arrow function should be compiled down to the FTL - -// Test the allocation on the implicit inner else branch -var f = sink.call(newContext, true, false); -var result = f(12); -if (result != 12) - // This shouldn't matter as it should be either correct or completely crash - throw "Error: expected 12 but got " + result; - -// Check that the allocation did not sink beyond the property assignment -var f = sink.call(newContext, true, true); -var result = f.inner; -if (result != 42) - throw "Error: inner should be 42 but is " + result; diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-name.js b/implementation-contributed/javascriptcore/stress/arrowfunction-name.js deleted file mode 100644 index f4adfddcb9..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-name.js +++ /dev/null @@ -1,15 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} - -// Anonymous -assert((()=>{}).name === ""); - -// Inferred name with global variable. -f = () => {}; -assert(f.name === "f"); - -// Inferred name with variable declaration. -let lf = () => {}; -assert(lf.name === "lf"); diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-others.js b/implementation-contributed/javascriptcore/stress/arrowfunction-others.js deleted file mode 100644 index 59e7d9b015..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-others.js +++ /dev/null @@ -1,27 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var simpleArrowFunction = () => {}; - -noInline(simpleArrowFunction); - -function truthy() { return true; } -function falsey() { return false; } -noInline(truthy); -noInline(falsey); - -for (var i=0;i<10000;i++) { - testCase(Object.getPrototypeOf(simpleArrowFunction), Function.prototype, "Error: Not correct getPrototypeOf value for arrow function"); - - testCase(simpleArrowFunction instanceof Function, true, "Error: Not correct result for instanceof method for arrow function"); - - testCase(simpleArrowFunction.constructor == Function, true, "Error: Not correct result for constructor method of arrow functio n"); - - let a1 = truthy() ? ()=>1 : ()=>2; - let a2 = falsey() ? ()=>2 : ()=>1; - testCase(a1(), 1, "Should be 1"); - testCase(a2(), 1, "should be 1"); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-prototype.js b/implementation-contributed/javascriptcore/stress/arrowfunction-prototype.js deleted file mode 100644 index d56437e33c..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-prototype.js +++ /dev/null @@ -1,22 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var af1 = () => {}; -var af2 = (a) => {a + 1}; -var af3 = (x) => x + 1; - -noInline(af1); -noInline(af2); -noInline(af3); - -for (var i = 0; i < 10000; ++i) { - testCase(typeof af1.prototype, 'undefined', "Error: Not correct result for prototype of arrow function #1"); - testCase(typeof af2.prototype, 'undefined', "Error: Not correct result for prototype of arrow function #2"); - testCase(typeof af3.prototype, 'undefined', "Error: Not correct result for prototype of arrow function #5"); - testCase(af1.hasOwnProperty("prototype"), false, "Error: Not correct result for prototype of arrow function #3"); - testCase(af2.hasOwnProperty("prototype"), false, "Error: Not correct result for prototype of arrow function #4"); - testCase(af3.hasOwnProperty("prototype"), false, "Error: Not correct result for prototype of arrow function #6"); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-run-10-1.js b/implementation-contributed/javascriptcore/stress/arrowfunction-run-10-1.js deleted file mode 100644 index 07a1f0a49c..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-run-10-1.js +++ /dev/null @@ -1,24 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -function run(count) { - var result = true; - for(var i=0; i<count; i++) { - var Obj = function (name) { - this.name = name; - this.getName = () => this.name; - }; - - var obj = new Obj("Item" + i); - if (obj.name !== obj.getName()) { - result = false; - } - } - return result; -} - -testCase(run(1), true, "Error: Error: during execution of arrow function one time"); -testCase(run(10), true, "Error: Error: during execution of arrow function 10 times"); diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-run-10-2.js b/implementation-contributed/javascriptcore/stress/arrowfunction-run-10-2.js deleted file mode 100644 index 5ddcdb3c70..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-run-10-2.js +++ /dev/null @@ -1,25 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -function run(count) { - var result = true; - for(var i=0; i<count; i++) { - var Obj = function (name) { - this.name = name; - this.getName = () => eval("this.name");; - }; - - - var obj = new Obj("Item" + i); - if (obj.name !== obj.getName()) { - result = false; - } - } - return result; -} - -testCase(run(1), true, "Error: during execution of arrow function one time"); -testCase(run(10), true, "Error: during execution of arrow function 10 times"); diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-run-10000-1.js b/implementation-contributed/javascriptcore/stress/arrowfunction-run-10000-1.js deleted file mode 100644 index 0e5f6bc86b..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-run-10000-1.js +++ /dev/null @@ -1,23 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -function run(count) { - var result = true; - for(var i=0; i<count; i++) { - var Obj = function (name) { - this.name = name; - this.getName = () => this.name; - }; - - var obj = new Obj("Item" + i); - if (obj.name !== obj.getName()) { - result = false; - } - } - return result; -} - -testCase(run(10000), true, "Error: Error: during execution of arrow function 10000 times"); diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-run-10000-2.js b/implementation-contributed/javascriptcore/stress/arrowfunction-run-10000-2.js deleted file mode 100644 index dc4271f4a3..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-run-10000-2.js +++ /dev/null @@ -1,23 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -function run(count) { - var result = true; - for (var i=0; i<count; i++) { - var Obj = function (name) { - this.name = name; - this.getName = () => eval("this.name");; - }; - - var obj = new Obj("Item" + i); - if (obj.name !== obj.getName()) { - result = false; - } - } - return result; -} - -testCase(run(10000), true, "Error: Error: during execution of arrow function 10000 times"); diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-sinking-no-double-allocate.js b/implementation-contributed/javascriptcore/stress/arrowfunction-sinking-no-double-allocate.js deleted file mode 100644 index d2862c628e..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-sinking-no-double-allocate.js +++ /dev/null @@ -1,28 +0,0 @@ -function call(o) { o.x = 3; } -noInline(call); - -function sink (p, q) { - var f = () => { }; - if (p) { - call(f); // Force allocation of f - if (q) { - OSRExit(); - } - return f; - } - return { 'x': 2 }; -} -noInline(sink); - -for (var i = 0; i < 100000; ++i) { - var o = sink(true, false); - if (o.x != 3) - throw "Error: expected o.x to be 2 but is " + result; -} - -// At this point, the function should be compiled down to the FTL - -// Check that the function is properly allocated on OSR exit -var f = sink(true, true); -if (f.x != 3) - throw "Error: expected o.x to be 3 but is " + result; diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-sinking-osrexit.js b/implementation-contributed/javascriptcore/stress/arrowfunction-sinking-osrexit.js deleted file mode 100644 index 727f3ca3bd..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-sinking-osrexit.js +++ /dev/null @@ -1,21 +0,0 @@ -function sink (p, q) { - var g = x => x; - if (p) { if (q) OSRExit(); return g; } - return x => x; -} -noInline(sink); - -for (var i = 0; i < 10000; ++i) { - var f = sink(true, false); - var result = f(42); - if (result != 42) - throw "Error: expected 42 but got " + result; -} - -// At this point, the function should be compiled down to the FTL - -// Check that the function is properly allocated on OSR exit -var f = sink(true, true); -var result = f(42); -if (result != 42) - throw "Error: expected 42 but got " + result; diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-sinking-put.js b/implementation-contributed/javascriptcore/stress/arrowfunction-sinking-put.js deleted file mode 100644 index 8db70bb9ab..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-sinking-put.js +++ /dev/null @@ -1,28 +0,0 @@ -function sink (p, q) { - var g = x => x; - if (p) { if (q) g.inner = 42; return g; } - return x => x; -} -noInline(sink); - -for (var i = 0; i < 10000; ++i) { - var f = sink(true, true); - var result = f(42); - if (result != 42) - throw "Error: expected 42 but got " + result; -} - -// At this point, the function should be compiled down to the FTL - -// Test the allocation on the implicit inner else branch -var f = sink(true, false); -var result = f(12); -if (result != 12) - // This shouldn't matter as it should be either correct or completely crash - throw "Error: expected 12 but got " + result; - -// Check that the allocation did not sink beyond the property assignment -var f = sink(true, true); -var result = f.inner; -if (result != 42) - throw "Error: inner should be 42 but is " + result; diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-tdz-1.js b/implementation-contributed/javascriptcore/stress/arrowfunction-tdz-1.js deleted file mode 100644 index 8d4d9d439b..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-tdz-1.js +++ /dev/null @@ -1,31 +0,0 @@ -var A = class A { }; -var B = class B extends A { - constructor(beforeSuper, returnThis) { - var f = () => returnThis ? this : {}; - if (beforeSuper) { - let val = f(); - super(); - } else { - super(); - let val = f(); - } - } -}; - -var exception = null; -for (var i=0; i < 10000; i++) { - try { - new B(true, true); - } catch (e) { - exception = e; - if (!(e instanceof ReferenceError)) - throw "Exception thrown was not a reference error"; - } - - if (!exception) - throw "Exception not thrown for an unitialized this at iteration"; - - var a = new B(false, true); - var b = new B(false, false); - var c = new B(true, false); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-tdz-2.js b/implementation-contributed/javascriptcore/stress/arrowfunction-tdz-2.js deleted file mode 100644 index 7afccafcb6..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-tdz-2.js +++ /dev/null @@ -1,32 +0,0 @@ -var A = class A { }; -var B = class B extends A { - constructor(beforeSuper, returnThis) { - var f = () => returnThis ? (() => this ) : (()=>{}); - let af = f(); - if (beforeSuper) { - let result = af(); - super(); - } else { - super(); - let result = af(); - } - } -}; - -var exception = null; -for (var i = 0; i < 10000; i++) { - try { - new B(true, true); - } catch (e) { - exception = e; - if (!(e instanceof ReferenceError)) - throw "Exception thrown was not a reference error"; - } - - if (!exception) - throw "Exception not thrown for an unitialized this at iteration"; - - var a = new B(false, true); - var b = new B(false, false); - var c = new B(true, false); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-tdz-3.js b/implementation-contributed/javascriptcore/stress/arrowfunction-tdz-3.js deleted file mode 100644 index ab98309f1e..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-tdz-3.js +++ /dev/null @@ -1,177 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var A = class A { - constructor() { - this.id = 'A' - } -}; - -var B = class B extends A { - constructor(beforeSuper) { - var f = () => { - if (this.id === 'A') { - return 'ok'; - } - return 'ok'; - }; - let val; - if (beforeSuper) { - val = f(); - super(); - } else { - super(); - val = f(); - } - this.res = val; - } -}; - -var C = class C extends A { - constructor(beforeSuper) { - var f = () => { - if (this > 5) { - return 'ok'; - } - return 'ok'; - }; - let val; - if (beforeSuper) { - val = f(); - super(); - } else { - super(); - val = f(); - } - this.res = val; - } -}; - -var D = class D extends A { - constructor(beforeSuper) { - var f = () => { - if (this < 5) { - return 'ok'; - } - return 'ok'; - }; - let val; - if (beforeSuper) { - val = f(); - super(); - } else { - super(); - val = f(); - } - this.res = val; - } -}; - -var E = class E extends A { - constructor(beforeSuper) { - var f = () => { - if (this !== 5) { - return 'ok'; - } - return 'ok'; - }; - let val; - if (beforeSuper) { - val = f(); - super(); - } else { - super(); - val = f(); - } - this.res = val; - } -}; - -var F = class F extends A { - constructor(beforeSuper) { - var f = () => { - if (this <= 5) { - return 'ok'; - } - return 'ok'; - }; - let val; - if (beforeSuper) { - val = f(); - super(); - } else { - super(); - val = f(); - } - this.res = val; - } -}; - -var G = class G extends A { - constructor(beforeSuper) { - var f = () => { - if (this >= 5) { - return 'ok'; - } - return 'ok'; - }; - let val; - if (beforeSuper) { - val = f(); - super(); - } else { - super(); - val = f(); - } - this.res = val; - } -}; - -var G = class G extends A { - constructor(beforeSuper) { - var f = () => { - if (this === 5) { - return 'ok'; - } - return 'ok'; - }; - let val; - if (beforeSuper) { - val = f(); - super(); - } else { - super(); - val = f(); - } - this.res = val; - } -}; - -var tryToCreate = function (classForCreate) { - var result = false; - try { - new classForCreate(true); - } catch (e) { - result = e instanceof ReferenceError; - } - - return result; -} - -var check = function (classForCheck) { - testCase(tryToCreate(classForCheck), true, 'Exception wasn\'t thrown or was not a reference error'); - var result = new classForCheck(false); - testCase(result.res, 'ok', 'Error in setting id '); -} - -for (var i = 0; i < 10000; i++) { - check(B); - check(C); - check(D); - check(E); - check(F); - check(G); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-tdz-4.js b/implementation-contributed/javascriptcore/stress/arrowfunction-tdz-4.js deleted file mode 100644 index 87c2927a1f..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-tdz-4.js +++ /dev/null @@ -1,46 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var testValue = 'test-value'; - -var A = class A { - constructor() { - this.idValue = testValue; - } -}; - -var B = class B extends A { - constructor (doRunSuper) { - var arrow = () => { - if (doRunSuper) { - super(); - testCase(this.idValue, testValue, "Error: super() should create this and put value into idValue property"); - } - } - - if (doRunSuper) { - arrow(); - testCase(this.idValue, testValue, "Error: arrow function should return this to constructor"); - } else { - var value = this.idValue;//force TDZ error - debug(value); - } - } -}; - -for (var i=0; i < 10000; i++) { - var exception; - try { - new B(false); - } catch (e) { - exception = e; - if (!(e instanceof ReferenceError)) - throw "Exception thrown was not a reference error"; - } - - if (!exception) - throw "Exception not thrown for an unitialized this at iteration #" + i; -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-tostring.js b/implementation-contributed/javascriptcore/stress/arrowfunction-tostring.js deleted file mode 100644 index 6e949848e6..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-tostring.js +++ /dev/null @@ -1,20 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var af1 = () => {}; -var af2 = (a) => { a + 1 }; -var af3 = x => x + 1; -var af4 = (x, y) => x + y; - -noInline(af1); -noInline(af2); - -for (var i = 0; i < 10000; ++i) { - testCase(af1.toString(), '() => {}', "Error: Not correct toString in arrow function #1"); - testCase(af2.toString(), '(a) => { a + 1 }', "Error: Not correct toString in arrow function #2"); - testCase(af3.toString(), 'x => x + 1', "Error: Not correct toString in arrow function #3"); - testCase(af4.toString(), '(x, y) => x + y', "Error: Not correct toString in arrow function #4"); -} diff --git a/implementation-contributed/javascriptcore/stress/arrowfunction-typeof.js b/implementation-contributed/javascriptcore/stress/arrowfunction-typeof.js deleted file mode 100644 index 14c03c77dd..0000000000 --- a/implementation-contributed/javascriptcore/stress/arrowfunction-typeof.js +++ /dev/null @@ -1,27 +0,0 @@ -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -var af1 = () => {}; -var af2 = (a) => {a + 1}; - -noInline(af1); -noInline(af2); - -for (var i = 0; i < 10000; ++i) { - testCase(typeof af1, "function", "Error: Not correct type of the arrow function #1"); - testCase(typeof af2, "function", "Error: Not correct type of the arrow function #2"); - -//Fixme: Some bug in inlining typeof with following run parameters ftl-no-cjit-no-inline-validate -// --useFTLJIT\=true --useFunctionDotArguments\=true --useConcurrentJIT=false --thresholdForJITAfterWarmUp=100 --validateGraph=true --maximumInliningDepth=1 -// -// for (var i = 0; i < 10000; ++i) { -// if (typeof (function () {}) !== 'function') -// throw 'Wrong type'; -// } -// testCase(typeof ()=>{}, "function", "Error: Not correct type of the arrow function #3-" + i); - -// testCase(typeof ((b) => {b + 1}), "function", "Error: Not correct type of the arrow function #4"); -} diff --git a/implementation-contributed/javascriptcore/stress/atomics-add-uint32.js b/implementation-contributed/javascriptcore/stress/atomics-add-uint32.js deleted file mode 100644 index 9b008e1543..0000000000 --- a/implementation-contributed/javascriptcore/stress/atomics-add-uint32.js +++ /dev/null @@ -1,14 +0,0 @@ -//@ skip -var sab = new SharedArrayBuffer(4); -var a = new Uint32Array(sab); -var result = Atomics.add(a, 0, 4000000000); -if (result != 0) - throw new Error("bad result: " + result); -if (a[0] != 4000000000) - throw new Error("bad value read back: " + a[0]); -result = Atomics.sub(a, 0, 4000000000); -if (result != 4000000000) - throw new Error("bad result: " + result); -if (a[0] != 0) - throw new Error("bad value read back: " + a[0]); - diff --git a/implementation-contributed/javascriptcore/stress/atomics-known-int-use.js b/implementation-contributed/javascriptcore/stress/atomics-known-int-use.js deleted file mode 100644 index 80731ea7c8..0000000000 --- a/implementation-contributed/javascriptcore/stress/atomics-known-int-use.js +++ /dev/null @@ -1,32 +0,0 @@ -//@ skip -// Break type inference. -var o = {f: 42.5}; - -function foo(a, i) { - return Atomics.exchange(a, i.f, 42); -} - -noInline(foo); - -var array = new Int32Array(new SharedArrayBuffer(4)); - -for (var i = 0; i < 10000; ++i) { - array[0] = 13; - var result = foo(array, {f: 0}); - if (result != 13) - throw "Error in loop: bad result: " + result; - if (array[0] != 42) - throw "Error in loop: bad value in array: " + array[0]; -} - -var success = false; -try { - array[0] = 14; - var result = foo(array, {f: 42.5}); - success = true; -} catch (e) { - if (e.name != "RangeError") - throw "Error: bad error type: " + e; -} -if (success) - throw "Error: expected to fail, but didn't." diff --git a/implementation-contributed/javascriptcore/stress/atomics-neg-zero.js b/implementation-contributed/javascriptcore/stress/atomics-neg-zero.js deleted file mode 100644 index 0a8e52c7bf..0000000000 --- a/implementation-contributed/javascriptcore/stress/atomics-neg-zero.js +++ /dev/null @@ -1,4 +0,0 @@ -//@ skip -var sab = new SharedArrayBuffer(4); -var a = new Int32Array(sab); -Atomics.add(a, -0, 1); // This should not throw. diff --git a/implementation-contributed/javascriptcore/stress/atomics-store-return.js b/implementation-contributed/javascriptcore/stress/atomics-store-return.js deleted file mode 100644 index 787a1fd243..0000000000 --- a/implementation-contributed/javascriptcore/stress/atomics-store-return.js +++ /dev/null @@ -1,27 +0,0 @@ -//@ skip -var sab = new SharedArrayBuffer(1); -var a = new Int8Array(sab); -var result = Atomics.store(a, 0, 1000); -if (result != 1000) - throw new Error("bad result: " + result); - -sab = new SharedArrayBuffer(4); -a = new Uint32Array(sab); -result = Atomics.store(a, 0, 4000000000); -if (result != 4000000000) - throw new Error("bad result: " + result); -if (a[0] != 4000000000) - throw new Error("bad value read back: " + a[0]); -result = Atomics.store(a, 0, -4000000000); -if (result != -4000000000) - throw new Error("bad result: " + result); -if (a[0] != 294967296) - throw new Error("bad value read back: " + a[0]); - -var count = 0; -result = Atomics.store(a, 0, { valueOf() { count++; return 42; } }); -if (result != 42) - throw new Error("bad result: " + result); -if (count != 1) - throw new Error("bad count: " + count); - diff --git a/implementation-contributed/javascriptcore/stress/b3-delete-orphans-should-neutralize-upsilons-with-dead-phis.js b/implementation-contributed/javascriptcore/stress/b3-delete-orphans-should-neutralize-upsilons-with-dead-phis.js deleted file mode 100644 index f3f6ea7771..0000000000 --- a/implementation-contributed/javascriptcore/stress/b3-delete-orphans-should-neutralize-upsilons-with-dead-phis.js +++ /dev/null @@ -1,9 +0,0 @@ -//@ runFTLNoCJIT - -(function () { - for (var i = 0; i < 1000000; ++i) { - const v = Array & 1 ? v : 1; - } -}()); - - diff --git a/implementation-contributed/javascriptcore/stress/baseline-osrentry-catch-is-reachable.js b/implementation-contributed/javascriptcore/stress/baseline-osrentry-catch-is-reachable.js deleted file mode 100644 index bef218819a..0000000000 --- a/implementation-contributed/javascriptcore/stress/baseline-osrentry-catch-is-reachable.js +++ /dev/null @@ -1,17 +0,0 @@ -// Regression test for bug 185281. This should terminate without throwing. - -// These values are added to increase bytecode count. -let foo = {}; -foo.x = null; -foo.y = null; -let z = null; -let z2 = {}; - -for (var i = 0; i <= 10; i++) { - for (var j = 0; j <= 100; j++) { - try { - xxx; - for (;;) {} - } catch (e) {} - } -} diff --git a/implementation-contributed/javascriptcore/stress/basic-eden-gc-test.js b/implementation-contributed/javascriptcore/stress/basic-eden-gc-test.js deleted file mode 100644 index 7d399e40f6..0000000000 --- a/implementation-contributed/javascriptcore/stress/basic-eden-gc-test.js +++ /dev/null @@ -1,4 +0,0 @@ -var o = {f:42}; -edenGC(); -var p = {f:42}; -edenGC(); diff --git a/implementation-contributed/javascriptcore/stress/basic-weakmap.js b/implementation-contributed/javascriptcore/stress/basic-weakmap.js deleted file mode 100644 index df55badab0..0000000000 --- a/implementation-contributed/javascriptcore/stress/basic-weakmap.js +++ /dev/null @@ -1,45 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var map = new WeakMap(); - var key1 = {}; - var key2 = {}; - var key3 = []; - - var res1 = map.get(key1); - map.set(key1, 42); - var res2 = map.get(key1); - - shouldBe(res1, undefined); - shouldBe(res2, 42); - - var res3 = map.get(key2); - map.set(key3, 43); - var res4 = map.get(key2); - - shouldBe(res3, undefined); - shouldBe(res4, undefined); - - shouldBe(map.get(key3), 43); - - map.delete(key3); - shouldBe(map.get(key3), undefined); - - shouldBe(map.get(key1), 42); - map.delete(key1); - shouldBe(map.get(key1), undefined); - shouldBe(map.has(key1), false); - - map.set(key1, 44); - shouldBe(map.get(key1), 44); - shouldBe(map.has(key1), true); -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) - test(); diff --git a/implementation-contributed/javascriptcore/stress/basic-weakset.js b/implementation-contributed/javascriptcore/stress/basic-weakset.js deleted file mode 100644 index 36280dab33..0000000000 --- a/implementation-contributed/javascriptcore/stress/basic-weakset.js +++ /dev/null @@ -1,43 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var set = new WeakSet(); - var key1 = {}; - var key2 = {}; - var key3 = []; - - var res1 = set.has(key1); - set.add(key1); - var res2 = set.has(key1); - - shouldBe(res1, false); - shouldBe(res2, true); - - var res3 = set.has(key2); - set.add(key3); - var res4 = set.has(key2); - - shouldBe(res3, false); - shouldBe(res4, false); - - shouldBe(set.has(key3), true); - - set.delete(key3); - shouldBe(set.has(key3), false); - - shouldBe(set.has(key1), true); - set.delete(key1); - shouldBe(set.has(key1), false); - - set.add(key1); - shouldBe(set.has(key1), true); -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) - test(); diff --git a/implementation-contributed/javascriptcore/stress/big-int-add-wrapped-value.js b/implementation-contributed/javascriptcore/stress/big-int-add-wrapped-value.js deleted file mode 100644 index 8a378bfbce..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-add-wrapped-value.js +++ /dev/null @@ -1,37 +0,0 @@ -//@ runBigIntEnabled - -assert = { - sameValue: function (input, expected, message) { - if (input !== expected) - throw new Error(message); - } -}; - -function testAdd(x, y, z, message) { - assert.sameValue(x + y, z, message); - assert.sameValue(y + x, z, message); -} - -testAdd(Object(2n), 1n, 3n, "ToPrimitive: unbox object with internal slot"); - -let o = { - [Symbol.toPrimitive]: function() { - return 2n; - } -}; -testAdd(o, 1n, 3n, "ToPrimitive: @@toPrimitive"); - -o = { - valueOf: function() { - return 2n; - } -}; -testAdd(o, 1n, 3n, "ToPrimitive: valueOf"); - -o = { - toString: function() { - return 2n; - } -} -testAdd(o, 1n, 3n, "ToPrimitive: toString"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-addition-basic.js b/implementation-contributed/javascriptcore/stress/big-int-addition-basic.js deleted file mode 100644 index d10f2a2b83..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-addition-basic.js +++ /dev/null @@ -1,170 +0,0 @@ -//@ runBigIntEnabled - -assert = { - sameValue: function (input, expected, message) { - if (input !== expected) - throw new Error(message); - } -}; - -function testAdd(x, y, z) { - assert.sameValue(x + y, z, x + " + " + y + " = " + z); - assert.sameValue(y + x, z, y + " + " + x + " = " + z); -} - -testAdd(10n, 239n, 249n); -testAdd(0xFEDCBA9876543210n, 0xFEDCBA9876543210n, 0x1FDB97530ECA86420n); -testAdd(0xFEDCBA9876543210n, 0xFEDCBA987654320Fn, 0x1FDB97530ECA8641Fn); -testAdd(0xFEDCBA9876543210n, 0xFEDCBA98n, 0xFEDCBA997530ECA8n); -testAdd(0xFEDCBA9876543210n, 0xFEDCBA97n, 0xFEDCBA997530ECA7n); -testAdd(0xFEDCBA9876543210n, 0x1234n, 0xFEDCBA9876544444n); -testAdd(0xFEDCBA9876543210n, 0x3n, 0xFEDCBA9876543213n); -testAdd(0xFEDCBA9876543210n, 0x2n, 0xFEDCBA9876543212n); -testAdd(0xFEDCBA9876543210n, 0x1n, 0xFEDCBA9876543211n); -testAdd(0xFEDCBA9876543210n, 0x0n, 0xFEDCBA9876543210n); -testAdd(0xFEDCBA9876543210n, -0x1n, 0xFEDCBA987654320Fn); -testAdd(0xFEDCBA9876543210n, -0x2n, 0xFEDCBA987654320En); -testAdd(0xFEDCBA9876543210n, -0x3n, 0xFEDCBA987654320Dn); -testAdd(0xFEDCBA9876543210n, -0x1234n, 0xFEDCBA9876541FDCn); -testAdd(0xFEDCBA9876543210n, -0xFEDCBA97n, 0xFEDCBA9777777779n); -testAdd(0xFEDCBA9876543210n, -0xFEDCBA98n, 0xFEDCBA9777777778n); -testAdd(0xFEDCBA9876543210n, -0xFEDCBA987654320Fn, 0x1n); -testAdd(0xFEDCBA9876543210n, -0xFEDCBA9876543210n, 0x0n); -testAdd(0xFEDCBA987654320Fn, 0xFEDCBA987654320Fn, 0x1FDB97530ECA8641En); -testAdd(0xFEDCBA987654320Fn, 0xFEDCBA98n, 0xFEDCBA997530ECA7n); -testAdd(0xFEDCBA987654320Fn, 0xFEDCBA97n, 0xFEDCBA997530ECA6n); -testAdd(0xFEDCBA987654320Fn, 0x1234n, 0xFEDCBA9876544443n); -testAdd(0xFEDCBA987654320Fn, 0x3n, 0xFEDCBA9876543212n); -testAdd(0xFEDCBA987654320Fn, 0x2n, 0xFEDCBA9876543211n); -testAdd(0xFEDCBA987654320Fn, 0x1n, 0xFEDCBA9876543210n); -testAdd(0xFEDCBA987654320Fn, 0x0n, 0xFEDCBA987654320Fn); -testAdd(0xFEDCBA987654320Fn, -0x1n, 0xFEDCBA987654320En); -testAdd(0xFEDCBA987654320Fn, -0x2n, 0xFEDCBA987654320Dn); -testAdd(0xFEDCBA987654320Fn, -0x3n, 0xFEDCBA987654320Cn); -testAdd(0xFEDCBA987654320Fn, -0x1234n, 0xFEDCBA9876541FDBn); -testAdd(0xFEDCBA987654320Fn, -0xFEDCBA97n, 0xFEDCBA9777777778n); -testAdd(0xFEDCBA987654320Fn, -0xFEDCBA98n, 0xFEDCBA9777777777n); -testAdd(0xFEDCBA987654320Fn, -0xFEDCBA987654320Fn, 0x0n); -testAdd(0xFEDCBA987654320Fn, -0xFEDCBA9876543210n, -0x1n); -testAdd(0xFEDCBA98n, 0xFEDCBA98n, 0x1FDB97530n); -testAdd(0xFEDCBA98n, 0xFEDCBA97n, 0x1FDB9752Fn); -testAdd(0xFEDCBA98n, 0x1234n, 0xFEDCCCCCn); -testAdd(0xFEDCBA98n, 0x3n, 0xFEDCBA9Bn); -testAdd(0xFEDCBA98n, 0x2n, 0xFEDCBA9An); -testAdd(0xFEDCBA98n, 0x1n, 0xFEDCBA99n); -testAdd(0xFEDCBA98n, 0x0n, 0xFEDCBA98n); -testAdd(0xFEDCBA98n, -0x1n, 0xFEDCBA97n); -testAdd(0xFEDCBA98n, -0x2n, 0xFEDCBA96n); -testAdd(0xFEDCBA98n, -0x3n, 0xFEDCBA95n); -testAdd(0xFEDCBA98n, -0x1234n, 0xFEDCA864n); -testAdd(0xFEDCBA98n, -0xFEDCBA97n, 0x1n); -testAdd(0xFEDCBA98n, -0xFEDCBA98n, 0x0n); -testAdd(0xFEDCBA98n, -0xFEDCBA987654320Fn, -0xFEDCBA9777777777n); -testAdd(0xFEDCBA98n, -0xFEDCBA9876543210n, -0xFEDCBA9777777778n); -testAdd(0xFEDCBA97n, 0xFEDCBA97n, 0x1FDB9752En); -testAdd(0xFEDCBA97n, 0x1234n, 0xFEDCCCCBn); -testAdd(0xFEDCBA97n, 0x3n, 0xFEDCBA9An); -testAdd(0xFEDCBA97n, 0x2n, 0xFEDCBA99n); -testAdd(0xFEDCBA97n, 0x1n, 0xFEDCBA98n); -testAdd(0xFEDCBA97n, 0x0n, 0xFEDCBA97n); -testAdd(0xFEDCBA97n, -0x1n, 0xFEDCBA96n); -testAdd(0xFEDCBA97n, -0x2n, 0xFEDCBA95n); -testAdd(0xFEDCBA97n, -0x3n, 0xFEDCBA94n); -testAdd(0xFEDCBA97n, -0x1234n, 0xFEDCA863n); -testAdd(0xFEDCBA97n, -0xFEDCBA97n, 0x0n); -testAdd(0xFEDCBA97n, -0xFEDCBA98n, -0x1n); -testAdd(0xFEDCBA97n, -0xFEDCBA987654320Fn, -0xFEDCBA9777777778n); -testAdd(0xFEDCBA97n, -0xFEDCBA9876543210n, -0xFEDCBA9777777779n); -testAdd(0x1234n, 0x1234n, 0x2468n); -testAdd(0x1234n, 0x3n, 0x1237n); -testAdd(0x1234n, 0x2n, 0x1236n); -testAdd(0x1234n, 0x1n, 0x1235n); -testAdd(0x1234n, 0x0n, 0x1234n); -testAdd(0x1234n, -0x1n, 0x1233n); -testAdd(0x1234n, -0x2n, 0x1232n); -testAdd(0x1234n, -0x3n, 0x1231n); -testAdd(0x1234n, -0x1234n, 0x0n); -testAdd(0x1234n, -0xFEDCBA97n, -0xFEDCA863n); -testAdd(0x1234n, -0xFEDCBA98n, -0xFEDCA864n); -testAdd(0x1234n, -0xFEDCBA987654320Fn, -0xFEDCBA9876541FDBn); -testAdd(0x1234n, -0xFEDCBA9876543210n, -0xFEDCBA9876541FDCn); -testAdd(0x3n, 0x3n, 0x6n); -testAdd(0x3n, 0x2n, 0x5n); -testAdd(0x3n, 0x1n, 0x4n); -testAdd(0x3n, 0x0n, 0x3n); -testAdd(0x3n, -0x1n, 0x2n); -testAdd(0x3n, -0x2n, 0x1n); -testAdd(0x3n, -0x3n, 0x0n); -testAdd(0x3n, -0x1234n, -0x1231n); -testAdd(0x3n, -0xFEDCBA97n, -0xFEDCBA94n); -testAdd(0x3n, -0xFEDCBA98n, -0xFEDCBA95n); -testAdd(0x3n, -0xFEDCBA987654320Fn, -0xFEDCBA987654320Cn); -testAdd(0x3n, -0xFEDCBA9876543210n, -0xFEDCBA987654320Dn); -testAdd(0x2n, 0x2n, 0x4n); -testAdd(0x2n, 0x1n, 0x3n); -testAdd(0x2n, 0x0n, 0x2n); -testAdd(0x2n, -0x1n, 0x1n); -testAdd(0x2n, -0x2n, 0x0n); -testAdd(0x2n, -0x3n, -0x1n); -testAdd(0x2n, -0x1234n, -0x1232n); -testAdd(0x2n, -0xFEDCBA97n, -0xFEDCBA95n); -testAdd(0x2n, -0xFEDCBA98n, -0xFEDCBA96n); -testAdd(0x2n, -0xFEDCBA987654320Fn, -0xFEDCBA987654320Dn); -testAdd(0x2n, -0xFEDCBA9876543210n, -0xFEDCBA987654320En); -testAdd(0x1n, 0x1n, 0x2n); -testAdd(0x1n, 0x0n, 0x1n); -testAdd(0x1n, -0x1n, 0x0n); -testAdd(0x1n, -0x2n, -0x1n); -testAdd(0x1n, -0x3n, -0x2n); -testAdd(0x1n, -0x1234n, -0x1233n); -testAdd(0x1n, -0xFEDCBA97n, -0xFEDCBA96n); -testAdd(0x1n, -0xFEDCBA98n, -0xFEDCBA97n); -testAdd(0x1n, -0xFEDCBA987654320Fn, -0xFEDCBA987654320En); -testAdd(0x1n, -0xFEDCBA9876543210n, -0xFEDCBA987654320Fn); -testAdd(0x0n, 0x0n, 0x0n); -testAdd(0x0n, -0x1n, -0x1n); -testAdd(0x0n, -0x2n, -0x2n); -testAdd(0x0n, -0x3n, -0x3n); -testAdd(0x0n, -0x1234n, -0x1234n); -testAdd(0x0n, -0xFEDCBA97n, -0xFEDCBA97n); -testAdd(0x0n, -0xFEDCBA98n, -0xFEDCBA98n); -testAdd(0x0n, -0xFEDCBA987654320Fn, -0xFEDCBA987654320Fn); -testAdd(0x0n, -0xFEDCBA9876543210n, -0xFEDCBA9876543210n); -testAdd(-0x1n, -0x1n, -0x2n); -testAdd(-0x1n, -0x2n, -0x3n); -testAdd(-0x1n, -0x3n, -0x4n); -testAdd(-0x1n, -0x1234n, -0x1235n); -testAdd(-0x1n, -0xFEDCBA97n, -0xFEDCBA98n); -testAdd(-0x1n, -0xFEDCBA98n, -0xFEDCBA99n); -testAdd(-0x1n, -0xFEDCBA987654320Fn, -0xFEDCBA9876543210n); -testAdd(-0x1n, -0xFEDCBA9876543210n, -0xFEDCBA9876543211n); -testAdd(-0x2n, -0x2n, -0x4n); -testAdd(-0x2n, -0x3n, -0x5n); -testAdd(-0x2n, -0x1234n, -0x1236n); -testAdd(-0x2n, -0xFEDCBA97n, -0xFEDCBA99n); -testAdd(-0x2n, -0xFEDCBA98n, -0xFEDCBA9An); -testAdd(-0x2n, -0xFEDCBA987654320Fn, -0xFEDCBA9876543211n); -testAdd(-0x2n, -0xFEDCBA9876543210n, -0xFEDCBA9876543212n); -testAdd(-0x3n, -0x3n, -0x6n); -testAdd(-0x3n, -0x1234n, -0x1237n); -testAdd(-0x3n, -0xFEDCBA97n, -0xFEDCBA9An); -testAdd(-0x3n, -0xFEDCBA98n, -0xFEDCBA9Bn); -testAdd(-0x3n, -0xFEDCBA987654320Fn, -0xFEDCBA9876543212n); -testAdd(-0x3n, -0xFEDCBA9876543210n, -0xFEDCBA9876543213n); -testAdd(-0x1234n, -0x1234n, -0x2468n); -testAdd(-0x1234n, -0xFEDCBA97n, -0xFEDCCCCBn); -testAdd(-0x1234n, -0xFEDCBA98n, -0xFEDCCCCCn); -testAdd(-0x1234n, -0xFEDCBA987654320Fn, -0xFEDCBA9876544443n); -testAdd(-0x1234n, -0xFEDCBA9876543210n, -0xFEDCBA9876544444n); -testAdd(-0xFEDCBA97n, -0xFEDCBA97n, -0x1FDB9752En); -testAdd(-0xFEDCBA97n, -0xFEDCBA98n, -0x1FDB9752Fn); -testAdd(-0xFEDCBA97n, -0xFEDCBA987654320Fn, -0xFEDCBA997530ECA6n); -testAdd(-0xFEDCBA97n, -0xFEDCBA9876543210n, -0xFEDCBA997530ECA7n); -testAdd(-0xFEDCBA98n, -0xFEDCBA98n, -0x1FDB97530n); -testAdd(-0xFEDCBA98n, -0xFEDCBA987654320Fn, -0xFEDCBA997530ECA7n); -testAdd(-0xFEDCBA98n, -0xFEDCBA9876543210n, -0xFEDCBA997530ECA8n); -testAdd(-0xFEDCBA987654320Fn, -0xFEDCBA987654320Fn, -0x1FDB97530ECA8641En); -testAdd(-0xFEDCBA987654320Fn, -0xFEDCBA9876543210n, -0x1FDB97530ECA8641Fn); -testAdd(-0xFEDCBA9876543210n, -0xFEDCBA9876543210n, -0x1FDB97530ECA86420n); -testAdd(18446744073709551617n, -18446744073709551616n, 1n); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-addition-jit.js b/implementation-contributed/javascriptcore/stress/big-int-addition-jit.js deleted file mode 100644 index 1158e0a0c1..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-addition-jit.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runBigIntEnabled - -let assert = { - sameValue: function(i, e, m) { - if (i !== e) - throw new Error(m); - } -} - -function bigIntAddition(x, y) { - return x + y; -} -noInline(bigIntAddition); - -for (let i = 0; i < 10000; i++) { - let r = bigIntAddition(3n, 10n); - assert.sameValue(r, 13n, 3n + " + " + 10n + " = " + r); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-addition-memory-stress.js b/implementation-contributed/javascriptcore/stress/big-int-addition-memory-stress.js deleted file mode 100644 index 8b1aeb1975..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-addition-memory-stress.js +++ /dev/null @@ -1,14 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -let a = 0n; -for (let i = 0; i < 1000000; i++) { - a += 30n; -} - -assert(a === 30000000n); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-addition-string-coercion.js b/implementation-contributed/javascriptcore/stress/big-int-addition-string-coercion.js deleted file mode 100644 index bbde05a346..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-addition-string-coercion.js +++ /dev/null @@ -1,25 +0,0 @@ -//@ runBigIntEnabled - -function assert(input, expected) { - if (input !== expected) - throw new Error("Bad!"); -} - -assert(-1n + "", "-1"); -assert("" + -1n, "-1"); -assert(0n + "", "0"); -assert("" + 0n, "0"); -assert(1n + "", "1"); -assert("" + 1n, "1"); -assert(123456789000000000000000n + "", "123456789000000000000000"); -assert("" + 123456789000000000000000n, "123456789000000000000000"); -assert(-123456789000000000000000n + "", "-123456789000000000000000"); -assert("" + -123456789000000000000000n, "-123456789000000000000000"); - -assert([] + -123456789000000000000000n, "-123456789000000000000000"); -assert(-123456789000000000000000n + [], "-123456789000000000000000"); - -let a = {}; -assert(a + 3n, "[object Object]3"); -assert(3n + a, "3[object Object]"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-addition-to-primitive-precedence.js b/implementation-contributed/javascriptcore/stress/big-int-addition-to-primitive-precedence.js deleted file mode 100644 index cdedc142fc..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-addition-to-primitive-precedence.js +++ /dev/null @@ -1,39 +0,0 @@ -//@ runBigIntEnabled - -assert = { - sameValue: function (input, expected, message) { - if (input !== expected) - throw new Error(message); - } -}; - -function testAdd(x, y, z, message) { - assert.sameValue(x + y, z, message); - assert.sameValue(y + x, z, message); -} - -testAdd(Object(2n), 1n, 3n, "ToPrimitive: unbox object with internal slot"); - -let o = { - [Symbol.toPrimitive]: function() { - return 2n; - }, - valueOf: function () { - throw new Error("Should never execute it"); - }, - toString: function () { - throw new Error("Should never execute it"); - } -}; -testAdd(o, 1n, 3n, "ToPrimitive: @@toPrimitive"); - -o = { - valueOf: function() { - return 2n; - }, - toString: function () { - throw new Error("Should never execute it"); - } -}; -testAdd(o, 1n, 3n, "ToPrimitive: valueOf"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-addition-to-primitive.js b/implementation-contributed/javascriptcore/stress/big-int-addition-to-primitive.js deleted file mode 100644 index 2f65f9c539..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-addition-to-primitive.js +++ /dev/null @@ -1,39 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -assert.sameValue = function (input, expected, message) { - if (input !== expected) - throw new Error(message); -} - -function testAdd(x, y, z) { - assert.sameValue(x + y, z, x + " + " + y + " = " + z); - assert.sameValue(y + x, z, y + " + " + x + " = " + z); -} - -let o = { - [Symbol.toPrimitive]: function () { return 300000000000000n; } -} - -testAdd(500000000000438n, o, 800000000000438n); - -o.valueOf = function () { - throw new Error("Should never execute it"); -}; - -testAdd(700000000000438n, o, 1000000000000438n); - -o.toString = function () { - throw new Error("Should never execute it"); -}; - -testAdd(700000000000438n, o, 1000000000000438n); - -delete o.valueOf; - -testAdd(700000000000438n, o, 1000000000000438n); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-addition-type-error.js b/implementation-contributed/javascriptcore/stress/big-int-addition-type-error.js deleted file mode 100644 index e2f824c0d9..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-addition-type-error.js +++ /dev/null @@ -1,104 +0,0 @@ -//@ runBigIntEnabled - -function assert(a, message) { - if (!a) - throw new Error(message); -} - -function assertThrowTypeError(a, b, message) { - try { - let n = a + b; - assert(false, message + ": Should throw TypeError, but executed without exception"); - } catch (e) { - assert(e instanceof TypeError, message + ": expected TypeError, got: " + e); - } -} - -assertThrowTypeError(30n, Symbol("foo"), "BigInt + Symbol"); -assertThrowTypeError(Symbol("bar"), 18757382984821n, "Symbol + BigInt"); -assertThrowTypeError(30n, 3320, "BigInt + Int32"); -assertThrowTypeError(33256, 18757382984821n, "Int32 + BigInt"); -assertThrowTypeError(30n, 0.543, "BigInt + Double"); -assertThrowTypeError(230.19293, 18757382984821n, "Double + BigInt"); -assertThrowTypeError(30n, NaN, "BigInt + NaN"); -assertThrowTypeError(NaN, 18757382984821n, "NaN + BigInt"); -assertThrowTypeError(30n, NaN, "BigInt + NaN"); -assertThrowTypeError(NaN, 18757382984821n, "NaN + BigInt"); -assertThrowTypeError(30n, +Infinity, "BigInt + NaN"); -assertThrowTypeError(+Infinity, 18757382984821n, "NaN + BigInt"); -assertThrowTypeError(30n, -Infinity, "BigInt + -Infinity"); -assertThrowTypeError(-Infinity, 18757382984821n, "-Infinity + BigInt"); -assertThrowTypeError(30n, null, "BigInt + null"); -assertThrowTypeError(null, 18757382984821n, "null + BigInt"); -assertThrowTypeError(30n, undefined, "BigInt + undefined"); -assertThrowTypeError(undefined, 18757382984821n, "undefined + BigInt"); -assertThrowTypeError(30n, true, "BigInt + true"); -assertThrowTypeError(true, 18757382984821n, "true + BigInt"); -assertThrowTypeError(30n, false, "BigInt + false"); -assertThrowTypeError(false, 18757382984821n, "false + BigInt"); - -// Error when returning from object - -let o = { - valueOf: function () { return Symbol("Foo"); } -}; - -assertThrowTypeError(30n, o, "BigInt + Object.valueOf returning Symbol"); -assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Symbol + BigInt"); - -o = { - valueOf: function () { return 33256; } -}; - -assertThrowTypeError(30n, o, "BigInt + Object.valueOf returning Int32"); -assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Int32 + BigInt"); - -o = { - valueOf: function () { return 0.453; } -}; - -assertThrowTypeError(30n, o, "BigInt + Object.valueOf returning Double"); -assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Double + BigInt"); - -o = { - toString: function () { return Symbol("Foo"); } -}; - -assertThrowTypeError(30n, o, "BigInt + Object.toString returning Symbol"); -assertThrowTypeError(o, 18757382984821n, "Object.toString returning Symbol + BigInt"); - -o = { - toString: function () { return 33256; } -}; - -assertThrowTypeError(30n, o, "BigInt + Object.toString returning Int32"); -assertThrowTypeError(o, 18757382984821n, "Object.toString returning Int32 + BigInt"); - -o = { - toString: function () { return 0.453; } -}; - -assertThrowTypeError(30n, o, "BigInt + Object.toString returning Double"); -assertThrowTypeError(o, 18757382984821n, "Object.toString returning Double + BigInt"); - -o = { - [Symbol.toPrimitive]: function () { return Symbol("Foo"); } -}; - -assertThrowTypeError(30n, o, "BigInt + Object.@@toPrimitive returning Symbol"); -assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Symbol + BigInt"); - -o = { - [Symbol.toPrimitive]: function () { return 33256; } -}; - -assertThrowTypeError(30n, o, "BigInt + Object.@@toPrimitive returning Int32"); -assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Int32 + BigInt"); - -o = { - [Symbol.toPrimitive]: function () { return 0.453; } -}; - -assertThrowTypeError(30n, o, "BigInt + Object.@@toPrimitive returning Double"); -assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Double + BigInt"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-as-key.js b/implementation-contributed/javascriptcore/stress/big-int-as-key.js deleted file mode 100644 index eeae472f70..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-as-key.js +++ /dev/null @@ -1,14 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -let o = {}; -let n = BigInt(0); - -o[n] = "foo"; -assert(o[n] === "foo"); -assert(o["0"] === "foo"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-constructor-gc.js b/implementation-contributed/javascriptcore/stress/big-int-constructor-gc.js deleted file mode 100644 index 2fd2777099..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-constructor-gc.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runBigIntEnabled - -function assert(expected, value) { - if (expected !== value) - throw new Error("Bad assertion. Expected: " + expected + " and value was: " + value); -} - -let arr = []; - -for (let i = 0; i < 1000000; i++) { - arr[i] = BigInt(i.toString()); -} - -gc(); - -for (let i = 0; i < 1000000; i++) { - assert(i.toString(), arr[i].toString()); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-constructor-oom.js b/implementation-contributed/javascriptcore/stress/big-int-constructor-oom.js deleted file mode 100644 index 1afa8108f1..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-constructor-oom.js +++ /dev/null @@ -1,21 +0,0 @@ -//@ if $buildType == "debug" or $memoryLimited then skip else runBigIntEnabled end - -function assert(a) { - if (!a) - throw new Error("Bad"); -} - -var longStr = "f"; -for (var i = 0; i < 30; ++i) - longStr = longStr + longStr; - -let sub = longStr.substring(0, longStr.length - 4) -let sNumber = "0x" + longStr + sub + "f"; - -try { - BigInt(sNumber); - assert(false); -} catch(e) { - assert(e.message == "Out of memory") -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-constructor-properties.js b/implementation-contributed/javascriptcore/stress/big-int-constructor-properties.js deleted file mode 100644 index 11f1fcdc23..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-constructor-properties.js +++ /dev/null @@ -1,23 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -(() => { - let p = Object.getOwnPropertyDescriptor(BigInt, "asUintN"); - - assert(p.enumerable === false); - assert(p.configurable === true); - assert(p.writable === true); -})(); - -(() => { - let p = Object.getOwnPropertyDescriptor(BigInt, "asIntN"); - - assert(p.enumerable === false); - assert(p.configurable === true); - assert(p.writable === true); -})(); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-constructor-prototype-prop-descriptor.js b/implementation-contributed/javascriptcore/stress/big-int-constructor-prototype-prop-descriptor.js deleted file mode 100644 index c8102d9761..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-constructor-prototype-prop-descriptor.js +++ /dev/null @@ -1,13 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -let p = Object.getOwnPropertyDescriptor(BigInt, "prototype"); - -assert(p.writable === false); -assert(p.enumerable === false); -assert(p.configurable === false); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-constructor-prototype.js b/implementation-contributed/javascriptcore/stress/big-int-constructor-prototype.js deleted file mode 100644 index 9cd3dcdd44..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-constructor-prototype.js +++ /dev/null @@ -1,10 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -let proto = Object.getPrototypeOf(BigInt); -assert(proto === Function.prototype); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-constructor.js b/implementation-contributed/javascriptcore/stress/big-int-constructor.js deleted file mode 100644 index c76843bf82..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-constructor.js +++ /dev/null @@ -1,276 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function assertThrowSyntaxError(input) { - try { - let n = BigInt(input); - assert(false); - } catch (e) { - assert(e instanceof SyntaxError); - } -} - -function assertThrowRangeError(input) { - try { - let n = BigInt(input); - assert(false); - } catch (e) { - assert(e instanceof RangeError); - } -} - -function assertThrowTypeError(input) { - try { - let n = BigInt(input); - assert(false); - } catch (e) { - assert(e instanceof TypeError); - } -} - -// Test 0 conversions -let n = BigInt(""); -assert(n.toString() === "0"); - -n = BigInt(" "); -assert(n.toString() === "0"); - -n = BigInt("0"); -assert(n.toString() === "0"); - -n = BigInt("+0"); -assert(n.toString() === "0"); - -n = BigInt("-0"); -assert(n.toString() === "0"); - -n = BigInt(" 0"); -assert(n.toString() === "0"); - -n = BigInt("0 "); -assert(n.toString() === "0"); - -n = BigInt(" 0 "); -assert(n.toString() === "0"); - -n = BigInt("00000"); -assert(n.toString() === "0"); - -let giantTrailingString = "0"; -for (let i = 0; i < 10000; i++) - giantTrailingString += " "; - -n = BigInt(giantTrailingString); -assert(n.toString() === "0"); - -// Binary representation - -n = BigInt("0b1111"); -assert(n.toString() === "15"); - -n = BigInt("0b10"); -assert(n.toString() === "2"); - -n = BigInt("0b10"); -assert(n.toString() === "2"); - -let binaryString = "0b1"; -for (let i = 0; i < 128; i++) - binaryString += "0"; - -n = BigInt(binaryString); -assert(n.toString() === "340282366920938463463374607431768211456"); - -n = BigInt("0B1111"); -assert(n.toString() === "15"); - -n = BigInt("0B10"); -assert(n.toString() === "2"); - -n = BigInt("0B10"); -assert(n.toString() === "2"); - -binaryString = "0B1"; -for (let i = 0; i < 128; i++) - binaryString += "0"; - -n = BigInt(binaryString); -assert(n.toString() === "340282366920938463463374607431768211456"); - -// Octal representation - -n = BigInt("0o7"); -assert(n.toString() === "7"); - -n = BigInt("0o10"); -assert(n.toString() === "8"); - -n = BigInt("0o20"); -assert(n.toString() === "16"); - -n = BigInt(" 0o20"); -assert(n.toString() === "16"); - -n = BigInt(" 0o20 "); -assert(n.toString() === "16"); - -n = BigInt("0O7"); -assert(n.toString() === "7"); - -n = BigInt("0O10"); -assert(n.toString() === "8"); - -n = BigInt("0O20"); -assert(n.toString() === "16"); - -n = BigInt(" 0O20"); -assert(n.toString() === "16"); - -n = BigInt(" 0O20 "); -assert(n.toString() === "16"); - -// Hexadecimal representation - -n = BigInt("0xa"); -assert(n.toString() === "10"); - -n = BigInt("0xff"); -assert(n.toString() === "255"); - -n = BigInt(" 0xff "); -assert(n.toString() === "255"); - -n = BigInt(" 0xfabc "); -assert(n.toString() === "64188"); - -// Number conversion - -n = BigInt(3245); -assert(n.toString() === "3245"); - -n = BigInt(-2147483648) -assert(n.toString() === "-2147483648"); - -n = BigInt(0); -assert(n.toString() === "0"); - -n = BigInt(-46781); -assert(n.toString() === "-46781"); - -// Int53 -n = BigInt(4503599627370490); -assert(n.toString() === "4503599627370490"); - -n = BigInt(-4503599627370490); -assert(n.toString() === "-4503599627370490"); - -n = BigInt(-4503599627370496); -assert(n.toString() === "-4503599627370496"); - -// Boolean conversion -n = BigInt(true); -assert(n.toString() === "1"); - -n = BigInt(false); -assert(n.toString() === "0"); - -// Objects -let o = { - valueOf: function () { - return 3; - } -} - -n = BigInt(o); -assert(n.toString() === "3"); - -o = { - valueOf: function () { - return "54"; - } -} - -n = BigInt(o); -assert(n.toString() === "54"); - -o = { - toString: function () { - return "5489543"; - } -} - -n = BigInt(o); -assert(n.toString() === "5489543"); - -o = { - toString: function () { - return 135489543; - } -} - -n = BigInt(o); -assert(n.toString() === "135489543"); - -o = { - valueOf: function () { - return 3256; - }, - - toString: function () { - return "563737"; - } -} - -n = BigInt(o); -assert(n.toString() === "3256"); - -// Assertion thows - -assertThrowSyntaxError("aba"); -assertThrowSyntaxError("-0x1"); -assertThrowSyntaxError("-0XFFab"); -assertThrowSyntaxError("0o78"); -assertThrowSyntaxError("0oa"); -assertThrowSyntaxError("000 12"); -assertThrowSyntaxError("0o"); -assertThrowSyntaxError("0b"); -assertThrowSyntaxError("0x"); -assertThrowSyntaxError("00o"); -assertThrowSyntaxError("00b"); -assertThrowSyntaxError("00x"); -assertThrowTypeError(null); -assertThrowTypeError(undefined); -assertThrowTypeError(Symbol("a")); -assertThrowRangeError(0.5); -assertThrowRangeError(-.5); -assertThrowRangeError(9007199254740992); -assertThrowRangeError(Infinity); -assertThrowRangeError(-Infinity); -assertThrowRangeError(NaN); - -// Object throwing error - -o = { - valueOf: function () { - throw new Error("MyError"); - } -} - -try { - n = BigInt(o); - assert(false); -} catch(e) { - assert(e.message === "MyError"); -} - -try { - n = BigInt(); - assert(false); -} catch(e) { - assert(e instanceof TypeError); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-div-jit.js b/implementation-contributed/javascriptcore/stress/big-int-div-jit.js deleted file mode 100644 index 0e217e8307..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-div-jit.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runBigIntEnabled - -let assert = { - sameValue: function(i, e, m) { - if (i !== e) - throw new Error(m); - } -} - -function bigIntDiv(x, y) { - return x / y; -} -noInline(bigIntDiv); - -for (let i = 0; i < 10000; i++) { - let r = bigIntDiv(30n, 10n); - assert.sameValue(r, 3n, 30n + " / " + 10n + " = " + r); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-div-memory-stress.js b/implementation-contributed/javascriptcore/stress/big-int-div-memory-stress.js deleted file mode 100644 index 0cf0b9b6fa..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-div-memory-stress.js +++ /dev/null @@ -1,15 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -let a = 0n; -let b = 30n; -for (let i = 0; i < 1000000; i++) { - a = b / 2n; -} - -assert(a === 15n); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-div-to-primitive.js b/implementation-contributed/javascriptcore/stress/big-int-div-to-primitive.js deleted file mode 100644 index a2973447ea..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-div-to-primitive.js +++ /dev/null @@ -1,34 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -assert.sameValue = function (input, expected, message) { - if (input !== expected) - throw new Error(message); -} - -function testDiv(x, y, z) { - assert.sameValue(x / y, z, x + " / " + y + " = " + z); -} - -let o = { - [Symbol.toPrimitive]: function () { return 300000000000n; } -} - -testDiv(500000000000438n, o, 1666n); - -o.valueOf = function () { - throw new Error("Should never execute it"); -}; - -testDiv(700000000000438n, o, 2333n); - -o.toString = function () { - throw new Error("Should never execute it"); -}; - -testDiv(700000000000438n, o, 2333n); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-div-type-error.js b/implementation-contributed/javascriptcore/stress/big-int-div-type-error.js deleted file mode 100644 index 27982cd78e..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-div-type-error.js +++ /dev/null @@ -1,106 +0,0 @@ -//@ runBigIntEnabled - -function assert(a, message) { - if (!a) - throw new Error(message); -} - -function assertThrowTypeError(a, b, message) { - try { - let n = a / b; - assert(false, message + ": Should throw TypeError, but executed without exception"); - } catch (e) { - assert(e instanceof TypeError, message + ": expected TypeError, got: " + e); - } -} - -assertThrowTypeError(30n, "foo", "BigInt / String"); -assertThrowTypeError("bar", 18757382984821n, "String / BigInt"); -assertThrowTypeError(30n, Symbol("foo"), "BigInt / Symbol"); -assertThrowTypeError(Symbol("bar"), 18757382984821n, "Symbol / BigInt"); -assertThrowTypeError(30n, 3320, "BigInt / Int32"); -assertThrowTypeError(33256, 18757382984821n, "Int32 / BigInt"); -assertThrowTypeError(30n, 0.543, "BigInt / Double"); -assertThrowTypeError(230.19293, 18757382984821n, "Double / BigInt"); -assertThrowTypeError(30n, NaN, "BigInt / NaN"); -assertThrowTypeError(NaN, 18757382984821n, "NaN / BigInt"); -assertThrowTypeError(30n, NaN, "BigInt / NaN"); -assertThrowTypeError(NaN, 18757382984821n, "NaN / BigInt"); -assertThrowTypeError(30n, +Infinity, "BigInt / NaN"); -assertThrowTypeError(+Infinity, 18757382984821n, "NaN / BigInt"); -assertThrowTypeError(30n, -Infinity, "BigInt / -Infinity"); -assertThrowTypeError(-Infinity, 18757382984821n, "-Infinity / BigInt"); -assertThrowTypeError(30n, null, "BigInt / null"); -assertThrowTypeError(null, 18757382984821n, "null / BigInt"); -assertThrowTypeError(30n, undefined, "BigInt / undefined"); -assertThrowTypeError(undefined, 18757382984821n, "undefined / BigInt"); -assertThrowTypeError(30n, true, "BigInt * true"); -assertThrowTypeError(true, 18757382984821n, "true / BigInt"); -assertThrowTypeError(30n, false, "BigInt / false"); -assertThrowTypeError(false, 18757382984821n, "false / BigInt"); - -// Error when returning from object - -let o = { - valueOf: function () { return Symbol("Foo"); } -}; - -assertThrowTypeError(30n, o, "BigInt / Object.valueOf returning Symbol"); -assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Symbol / BigInt"); - -o = { - valueOf: function () { return 33256; } -}; - -assertThrowTypeError(30n, o, "BigInt / Object.valueOf returning Int32"); -assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Int32 / BigInt"); - -o = { - valueOf: function () { return 0.453; } -}; - -assertThrowTypeError(30n, o, "BigInt / Object.valueOf returning Double"); -assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Double / BigInt"); - -o = { - toString: function () { return Symbol("Foo"); } -}; - -assertThrowTypeError(30n, o, "BigInt / Object.toString returning Symbol"); -assertThrowTypeError(o, 18757382984821n, "Object.toString returning Symbol / BigInt"); - -o = { - toString: function () { return 33256; } -}; - -assertThrowTypeError(30n, o, "BigInt / Object.toString returning Int32"); -assertThrowTypeError(o, 18757382984821n, "Object.toString returning Int32 / BigInt"); - -o = { - toString: function () { return 0.453; } -}; - -assertThrowTypeError(30n, o, "BigInt / Object.toString returning Double"); -assertThrowTypeError(o, 18757382984821n, "Object.toString returning Double / BigInt"); - -o = { - [Symbol.toPrimitive]: function () { return Symbol("Foo"); } -}; - -assertThrowTypeError(30n, o, "BigInt / Object.@@toPrimitive returning Symbol"); -assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Symbol / BigInt"); - -o = { - [Symbol.toPrimitive]: function () { return 33256; } -}; - -assertThrowTypeError(30n, o, "BigInt / Object.@@toPrimitive returning Int32"); -assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Int32 / BigInt"); - -o = { - [Symbol.toPrimitive]: function () { return 0.453; } -}; - -assertThrowTypeError(30n, o, "BigInt / Object.@@toPrimitive returning Double"); -assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Double / BigInt"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-div-wrapped-value.js b/implementation-contributed/javascriptcore/stress/big-int-div-wrapped-value.js deleted file mode 100644 index 9bb9aee983..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-div-wrapped-value.js +++ /dev/null @@ -1,46 +0,0 @@ -//@ runBigIntEnabled - -assert = { - sameValue: function (input, expected, message) { - if (input !== expected) - throw new Error(message); - } -}; - -function testDiv(x, y, z, message) { - assert.sameValue(x / y, z, message); -} - -testDiv(Object(2n), 1n, 2n, "ToPrimitive: unbox object with internal slot"); - -let o = { - [Symbol.toPrimitive]: function() { - return 2n; - } -}; -testDiv(o, 1n, 2n, "ToPrimitive: @@toPrimitive"); - -o = { - valueOf: function() { - return 2n; - } -}; -testDiv(o, 1n, 2n, "ToPrimitive: valueOf"); - -o = { - toString: function() { - return 2n; - } -} -testDiv(o, 1n, 2n, "ToPrimitive: toString"); - -o = { - valueOf: function() { - return 2n; - }, - toString: function () { - throw new Error("Should never execute it"); - } -}; -testDiv(o, 1n, 2n, "ToPrimitive: valueOf"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-division.js b/implementation-contributed/javascriptcore/stress/big-int-division.js deleted file mode 100644 index 401890ad63..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-division.js +++ /dev/null @@ -1,131 +0,0 @@ -//@ runBigIntEnabled - -// Copyright (C) 2017 Robin Templeton. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -assert.sameValue = function (input, expected, message) { - if (input !== expected) - throw new Error(message); -} - -function testDiv(x, y, z) { - assert.sameValue(x / y, z, x + " / " + y + " = " + z); -} - -testDiv(0xFEDCBA9876543210n, 0xFEDCBA9876543210n, 0x1n); -testDiv(0xFEDCBA9876543210n, 0xFEDCBA987654320Fn, 0x1n); -testDiv(0xFEDCBA9876543210n, 0xFEDCBA98n, 0x100000000n); -testDiv(0xFEDCBA9876543210n, 0xFEDCBA97n, 0x100000001n); -testDiv(0xFEDCBA9876543210n, 0x1234n, 0xE0042813BE5DCn); -testDiv(0xFEDCBA9876543210n, 0x3n, 0x54F43E32D21C10B0n); -testDiv(0xFEDCBA9876543210n, 0x2n, 0x7F6E5D4C3B2A1908n); -testDiv(0xFEDCBA9876543210n, 0x1n, 0xFEDCBA9876543210n); -testDiv(0xFEDCBA9876543210n, BigInt("-1"), BigInt("-18364758544493064720")); -testDiv(0xFEDCBA9876543210n, BigInt("-2"), BigInt("-9182379272246532360")); -testDiv(0xFEDCBA9876543210n, BigInt("-3"), BigInt("-6121586181497688240")); -testDiv(0xFEDCBA9876543210n, BigInt("-4275878551"), BigInt("-4294967297")); -testDiv(0xFEDCBA9876543210n, BigInt("-18364758544493064719"), BigInt("-1")); -testDiv(0xFEDCBA987654320Fn, 0xFEDCBA9876543210n, 0x0n); -testDiv(0xFEDCBA987654320Fn, 0xFEDCBA987654320Fn, 0x1n); -testDiv(0xFEDCBA987654320Fn, 0xFEDCBA98n, 0x100000000n); -testDiv(0xFEDCBA987654320Fn, 0xFEDCBA97n, 0x100000001n); -testDiv(0xFEDCBA987654320Fn, 0x1234n, 0xE0042813BE5DCn); -testDiv(0xFEDCBA987654320Fn, 0x3n, 0x54F43E32D21C10AFn); -testDiv(0xFEDCBA987654320Fn, 0x2n, 0x7F6E5D4C3B2A1907n); -testDiv(0xFEDCBA987654320Fn, 0x1n, 0xFEDCBA987654320Fn); -testDiv(0xFEDCBA98n, 0xFEDCBA9876543210n, 0x0n); -testDiv(0xFEDCBA98n, 0xFEDCBA987654320Fn, 0x0n); -testDiv(0xFEDCBA98n, 0xFEDCBA98n, 0x1n); -testDiv(0xFEDCBA98n, 0xFEDCBA97n, 0x1n); -testDiv(0xFEDCBA98n, 0x1234n, 0xE0042n); -testDiv(0xFEDCBA98n, 0x3n, 0x54F43E32n); -testDiv(0xFEDCBA98n, 0x2n, 0x7F6E5D4Cn); -testDiv(0xFEDCBA98n, 0x1n, 0xFEDCBA98n); -testDiv(0xFEDCBA98n, BigInt("-1"), BigInt("-4275878552")); -testDiv(0xFEDCBA98n, BigInt("-2"), BigInt("-2137939276")); -testDiv(0xFEDCBA98n, BigInt("-3"), BigInt("-1425292850")); -testDiv(0xFEDCBA98n, BigInt("-4275878551"), BigInt("-1")); -testDiv(0xFEDCBA98n, BigInt("-18364758544493064719"), 0x0n); -testDiv(0xFEDCBA97n, 0xFEDCBA9876543210n, 0x0n); -testDiv(0xFEDCBA97n, 0xFEDCBA987654320Fn, 0x0n); -testDiv(0xFEDCBA97n, 0xFEDCBA98n, 0x0n); -testDiv(0xFEDCBA97n, 0xFEDCBA97n, 0x1n); -testDiv(0xFEDCBA97n, 0x1234n, 0xE0042n); -testDiv(0xFEDCBA97n, 0x3n, 0x54F43E32n); -testDiv(0xFEDCBA97n, 0x2n, 0x7F6E5D4Bn); -testDiv(0xFEDCBA97n, 0x1n, 0xFEDCBA97n); -testDiv(0x3n, 0xFEDCBA9876543210n, 0x0n); -testDiv(0x3n, 0xFEDCBA98n, 0x0n); -testDiv(0x3n, 0x1234n, 0x0n); -testDiv(0x3n, 0x3n, 0x1n); -testDiv(0x3n, 0x2n, 0x1n); -testDiv(0x3n, 0x1n, 0x3n); -testDiv(0x3n, BigInt("-2"), BigInt("-1")); -testDiv(0x3n, BigInt("-3"), BigInt("-1")); -testDiv(0x3n, BigInt("-4275878551"), 0x0n); -testDiv(0x3n, BigInt("-18364758544493064719"), 0x0n); -testDiv(0x2n, 0xFEDCBA98n, 0x0n); -testDiv(0x2n, 0xFEDCBA97n, 0x0n); -testDiv(0x2n, 0x3n, 0x0n); -testDiv(0x2n, 0x1n, 0x2n); -testDiv(0x2n, BigInt("-1"), BigInt("-2")); -testDiv(0x2n, BigInt("-2"), BigInt("-1")); -testDiv(0x2n, BigInt("-3"), 0x0n); -testDiv(0x1n, 0x1234n, 0x0n); -testDiv(0x1n, 0x3n, 0x0n); -testDiv(0x1n, 0x2n, 0x0n); -testDiv(0x1n, 0x1n, 0x1n); -testDiv(0x1n, BigInt("-1"), BigInt("-1")); -testDiv(0x1n, BigInt("-3"), 0x0n); -testDiv(0x1n, BigInt("-4660"), 0x0n); -testDiv(0x1n, BigInt("-18364758544493064719"), 0x0n); -testDiv(BigInt("-1"), 0xFEDCBA9876543210n, 0x0n); -testDiv(BigInt("-1"), 0xFEDCBA987654320Fn, 0x0n); -testDiv(BigInt("-1"), 0xFEDCBA98n, 0x0n); -testDiv(BigInt("-1"), 0xFEDCBA97n, 0x0n); -testDiv(BigInt("-1"), 0x3n, 0x0n); -testDiv(BigInt("-1"), 0x1n, BigInt("-1")); -testDiv(BigInt("-1"), BigInt("-3"), 0x0n); -testDiv(BigInt("-1"), BigInt("-4660"), 0x0n); -testDiv(BigInt("-1"), BigInt("-18364758544493064719"), 0x0n); -testDiv(BigInt("-2"), 0xFEDCBA9876543210n, 0x0n); -testDiv(BigInt("-3"), 0x3n, BigInt("-1")); -testDiv(BigInt("-3"), 0x2n, BigInt("-1")); -testDiv(BigInt("-3"), BigInt("-1"), 0x3n); -testDiv(BigInt("-3"), BigInt("-3"), 0x1n); -testDiv(BigInt("-3"), BigInt("-4660"), 0x0n); -testDiv(BigInt("-3"), BigInt("-4275878551"), 0x0n); -testDiv(BigInt("-3"), BigInt("-4275878552"), 0x0n); -testDiv(BigInt("-3"), BigInt("-18364758544493064720"), 0x0n); -testDiv(BigInt("-18364758544493064719"), 0xFEDCBA97n, BigInt("-4294967297")); -testDiv(BigInt("-18364758544493064719"), 0x1234n, BigInt("-3940935309977052")); -testDiv(BigInt("-18364758544493064719"), 0x3n, BigInt("-6121586181497688239")); -testDiv(BigInt("-18364758544493064719"), 0x2n, BigInt("-9182379272246532359")); -testDiv(BigInt("-18364758544493064719"), 0x1n, BigInt("-18364758544493064719")); -testDiv(BigInt("-18364758544493064719"), BigInt("-1"), 0xFEDCBA987654320Fn); -testDiv(BigInt("-18364758544493064719"), BigInt("-4275878551"), 0x100000001n); -testDiv(BigInt("-18364758544493064719"), BigInt("-18364758544493064719"), 0x1n); -testDiv(BigInt("-18364758544493064720"), 0xFEDCBA9876543210n, BigInt("-1")); -testDiv(BigInt("-18364758544493064720"), 0x1234n, BigInt("-3940935309977052")); -testDiv(BigInt("-18364758544493064720"), 0x3n, BigInt("-6121586181497688240")); -testDiv(BigInt("-18364758544493064720"), 0x2n, BigInt("-9182379272246532360")); -testDiv(BigInt("-18364758544493064720"), 0x1n, BigInt("-18364758544493064720")); -testDiv(BigInt("-18364758544493064720"), BigInt("-1"), 0xFEDCBA9876543210n); -testDiv(BigInt("-18364758544493064720"), BigInt("-3"), 0x54F43E32D21C10B0n); -testDiv(BigInt("-18364758544493064720"), BigInt("-4660"), 0xE0042813BE5DCn); -testDiv(BigInt("-18364758544493064720"), BigInt("-4275878552"), 0x100000000n); -testDiv(BigInt("-18364758544493064720"), BigInt("-18364758544493064720"), 0x1n); - -// Test division by 0 -try { - let a = 102122311n / 0n; -} catch (e) { - assert(e instanceof RangeError); - assert(e.message == "0 is an invalid divisor value."); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-equals-basic.js b/implementation-contributed/javascriptcore/stress/big-int-equals-basic.js deleted file mode 100644 index 59ba0286f8..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-equals-basic.js +++ /dev/null @@ -1,124 +0,0 @@ -//@ runBigIntEnabled - -function assert(a, e, m) { - if (a !== e) - throw new Error(m); -} - -function testEquals(a, b, e) { - assert(a == b, e, a + " == " + b + " should be " + e); - assert(b == a, e, b + " == " + a + " should be " + e); -} - -function testEqualsWithMessage(a, b, e, m) { - assert(a == b, e, m); - assert(b == a, e, m); -} - -// BigInt - BigInt -testEquals(1n, 1n, true); -testEquals(1928392129312n, 1n, false); -testEquals(0n, 1n, false); -testEquals(0n, 0n, true); -testEquals(817283912931n, 817283912931n, true); -testEquals(0xFFD817283AF9129E31n, 0xFFD817283AF9129E31n, true); -testEquals(0xAFFD817283AF9129E31n, 0xFFD817283AF9129E31n, false); -testEquals(4719490697266344402481n, BigInt("-4719490697266344402481"), false); -testEquals(BigInt("-4719490697266344402481"), BigInt("4719490697266344402481"), false); -testEquals(BigInt("-4719490697266344402481"), BigInt("-4719490697266344402481"), true); -testEquals(BigInt("-17"), BigInt("-17"), true); - -// BigInt - String - -testEquals(1n, "1", true); -testEquals(1928392129312n, "1", false); -testEquals(0n, "1", false); -testEquals(0n, "0", true); -testEquals(817283912931n, "817283912931", true); -testEquals(0xFFD817283AF9129E31n, "4719490697266344402481", true); -testEquals(0xAFFD817283AF9129E31n, "4719490697266344402481", false); - -// BigInt - Number - -testEquals(0n, 0, true); -testEquals(0n, -0, true); -testEquals(-0, 0n, true); -testEquals(0n, 0.000000000001, false); -testEquals(0n, 1, false); -testEquals(1, 0n, false); -testEquals(1n, 0.999999999999, false); -testEquals(1n, 1, true); -testEquals(0n, Number.MIN_VALUE, false); -testEquals(0n, -Number.MIN_VALUE, false); -testEquals(BigInt("-10"), Number.MIN_VALUE, false); -testEquals(1n, Number.MAX_VALUE, false); -testEquals(1n, -Number.MAX_VALUE, false); -testEquals(0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn, Number.MAX_VALUE, false); -testEquals(0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000n, Number.MAX_VALUE, true); -testEquals(0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n, Number.MAX_VALUE, false); -testEquals(230000000000000000000, 230000000000000000000n, true); -testEquals(10n, NaN, false); -testEquals(10n, undefined, false); -testEquals(10n, null, false); -testEquals(10n, Infinity, false); -testEquals(10n, -Infinity, false); -testEquals(BigInt("-2147483648"), -2147483648, true); // Testing INT32_MIN -testEquals(BigInt("-2147483647"), -2147483648, false); -testEquals(BigInt("2147483647"), -2147483648, false); -testEquals(BigInt("2147483648"), -2147483648, false); -testEquals(BigInt("2147483647"), 2147483647, true); -testEquals(BigInt("2147483648"), 2147483647, false); - -// BigInt - Boolean - -testEquals(BigInt("-1"), false, false); -testEquals(BigInt("-1"), true, false); -testEquals(0n, false, true); -testEquals(0n, true, false); -testEquals(1n, false, false); -testEquals(1n, true, true); -testEquals(2n, false, false); -testEquals(2n, true, false); - -// BigInt - Object - -testEquals(0n, Object(0n), true); -testEquals(0n, Object(1n), false); -testEquals(1n, Object(0n), false); -testEquals(1n, Object(1n), true); -testEquals(2n, Object(0n), false); -testEquals(2n, Object(1n), false); -testEquals(2n, Object(2n), true); -testEquals(0n, {}, false); -testEquals(0n, {valueOf: function() { return 0n; }}, true); -testEquals(0n, {valueOf: function() { return 1n; }}, false); -testEquals(0n, {toString: function() { return "0"; }}, true); -testEquals(0n, {toString: function() { return "1"; }}, false); -testEquals(900719925474099101n, {valueOf: function() { return 900719925474099101n; }}, true); -testEquals(900719925474099101n, {valueOf: function() { return 900719925474099102n; }}, false); -testEquals(900719925474099101n, {toString: function() { return "900719925474099101"; }}, true); -testEquals(900719925474099101n, {toString: function() { return "900719925474099102"; }}, false); - -try { - let o = {valueOf: function() { throw new Error("my error"); }}; - o == 1n; - throw new Error("Exception in ToPrimitive not catched"); -} catch(e) { - assert(e.message, "my error", "Wrong exception in ToPrimitive"); -} - -try { - let o = {toString: function() { throw new Error("my error"); }}; - o == 1n; - throw new Error("Exception in ToString not catched"); -} catch(e) { - assert(e.message, "my error", "Wrong exception in ToString"); -} - -// BigInt - Symbol - -testEqualsWithMessage(0n, Symbol("1"), false, "0n == Symbol(1)"); -testEqualsWithMessage(Symbol("1"), 0n, false, "Symbol(1) == 0n"); -testEqualsWithMessage(1n, Symbol("1"), false, "1n == Symbol(1)"); -testEqualsWithMessage(Symbol("1"), 1n, false, "Symbol(1) == 1n"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-equals-to-primitive-precedence.js b/implementation-contributed/javascriptcore/stress/big-int-equals-to-primitive-precedence.js deleted file mode 100644 index f5ed564dd7..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-equals-to-primitive-precedence.js +++ /dev/null @@ -1,39 +0,0 @@ -//@ runBigIntEnabled - -assert = { - sameValue: function (input, expected, message) { - if (input !== expected) - throw new Error(message); - } -}; - -function testEquals(x, y, z, message) { - assert.sameValue(x == y, z, message); - assert.sameValue(y == x, z, message); -} - -testEquals(Object(2n), 1n, false, "ToPrimitive: unbox object with internal slot"); - -let o = { - [Symbol.toPrimitive]: function() { - return 2n; - }, - valueOf: function () { - throw new Error("Should never execute it"); - }, - toString: function () { - throw new Error("Should never execute it"); - } -}; -testEquals(o, 2n, true, "ToPrimitive: @@toPrimitive"); - -o = { - valueOf: function() { - return 2n; - }, - toString: function () { - throw new Error("Should never execute it"); - } -}; -testEquals(o, 1n, false, "ToPrimitive: valueOf"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-equals-wrapped-value.js b/implementation-contributed/javascriptcore/stress/big-int-equals-wrapped-value.js deleted file mode 100644 index 6ed89be135..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-equals-wrapped-value.js +++ /dev/null @@ -1,37 +0,0 @@ -//@ runBigIntEnabled - -assert = { - sameValue: function (input, expected, message) { - if (input !== expected) - throw new Error(message); - } -}; - -function testEquals(x, y, z, message) { - assert.sameValue(x == y, z, message); - assert.sameValue(y == x, z, message); -} - -testEquals(Object(2n), 1n, false, "ToPrimitive: unbox object with internal slot"); - -let o = { - [Symbol.toPrimitive]: function() { - return 1n; - } -}; -testEquals(o, 1n, true, "ToPrimitive: @@toPrimitive"); - -o = { - valueOf: function() { - return 2n; - } -}; -testEquals(o, 2n, true, "ToPrimitive: valueOf"); - -o = { - toString: function() { - return 2n; - } -} -testEquals(o, 1n, false, "ToPrimitive: toString"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-function-apply.js b/implementation-contributed/javascriptcore/stress/big-int-function-apply.js deleted file mode 100644 index 1e875ce8b9..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-function-apply.js +++ /dev/null @@ -1,18 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function foo() { - return 0; -} - -try { - foo.apply({}, 2n); - assert(false); -} catch(e) { - assert(e.message == "second argument to Function.prototype.apply must be an Array-like object (evaluating 'foo.apply({}, 2n)')") -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-greater-than-general.js b/implementation-contributed/javascriptcore/stress/big-int-greater-than-general.js deleted file mode 100644 index 0979dbe36f..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-greater-than-general.js +++ /dev/null @@ -1,140 +0,0 @@ -//@ runBigIntEnabled - -// Copyright (C) 2017 Josh Wolfe. All rights reserved. -// Copyright (C) 2018 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -function assert(v, e, m) { - if (v !== e) - throw new Error(m); -} - -assert(0n > 0n, false, "0n > 0n"); -assert(1n > 1n, false, "1n > 1n"); -assert(BigInt("-1") > BigInt("-1"), false, "-1n > -1n"); -assert(0n > BigInt("-0"), false, "0n > -0n"); -assert(BigInt("-0") > 0n, false, "-0n > 0n"); -assert(0n > 1n, false, "0n > 1n"); -assert(1n > 0n, true, "1n > 0n"); -assert(0n > BigInt("-1"), true, "0n > -1n"); -assert(BigInt("-1") > 0n, false, "-1n > 0n"); -assert(1n > BigInt("-1"), true, "1n > -1n"); -assert(BigInt("-1") > 1n, false, "-1n > 1n"); -assert(0x1fffffffffffff01n > 0x1fffffffffffff02n, false, "0x1fffffffffffff01n > 0x1fffffffffffff02n"); -assert(0x1fffffffffffff02n > 0x1fffffffffffff01n, true, "0x1fffffffffffff02n > 0x1fffffffffffff01n"); -assert(BigInt("-2305843009213693697") > BigInt("-2305843009213693698"), true, "-2305843009213693697n > -2305843009213693698n"); -assert(BigInt("-2305843009213693698") > BigInt("-2305843009213693697"), false, "-2305843009213693698n > -2305843009213693697n"); -assert(0x10000000000000000n > 0n, true, "0x10000000000000000n > 0n"); -assert(0n > 0x10000000000000000n, false, "0n > 0x10000000000000000n"); -assert(0x10000000000000000n > 1n, true, "0x10000000000000000n > 1n"); -assert(1n > 0x10000000000000000n, false, "1n > 0x10000000000000000n"); -assert(0x10000000000000000n > BigInt("-1"), true, "0x10000000000000000n > -1n"); -assert(BigInt("-1") > 0x10000000000000000n, false, "-1n > 0x10000000000000000n"); -assert(0x10000000000000001n > 0n, true, "0x10000000000000001n > 0n"); -assert(0n > 0x10000000000000001n, false, "0n > 0x10000000000000001n"); -assert(BigInt("-18446744073709551616") > 0n, false, "-18446744073709551616n > 0n"); -assert(0n > BigInt("-18446744073709551616"), true, "0n > -18446744073709551616n"); -assert(BigInt("-18446744073709551616") > 1n, false, "-18446744073709551616n > 1n"); -assert(1n > BigInt("-18446744073709551616"), true, "1n > -18446744073709551616n"); -assert(BigInt("-18446744073709551616") > BigInt("-1"), false, "-18446744073709551616n > -1n"); -assert(BigInt("-1") > BigInt("-18446744073709551616"), true, "-1n > -18446744073709551616n"); -assert(BigInt("-18446744073709551617") > 0n, false, "-18446744073709551617n > 0n"); -assert(0n > BigInt("-18446744073709551617"), true, "0n > -18446744073709551617n"); -assert(0x10000000000000000n > 0x100000000n, true, "0x10000000000000000n > 0x100000000n"); -assert(0x100000000n > 0x10000000000000000n, false, "0x100000000n > 0x10000000000000000n"); - -// BigInt - String - -assert(0n > "0", false, "0n > '0'"); -assert("0" > 0n, false, "'0' > 0n"); -assert(0n > "1", false, "0n > '1'"); -assert("0" > 1n, false, "'0' > 1n"); -assert(1n > "0", true, "1n > '0'"); -assert("1" > 0n, true, "'1' > 0n"); -assert(0n > "", false, "0n > ''"); -assert("" > 0n, false, "'' > 0n"); -assert(0n > "1", false, "0n > '1'"); -assert("" > 1n, false, "'' > 1n"); -assert(1n > "", true, "1n > ''"); -assert(1n > "1", false, "1n > '1'"); -assert("1" > 1n, false, "'1' > 1n"); -assert(1n > "-1", true, "1n > '-1'"); -assert("1" > BigInt("-1"), true, "'1' > -1n"); -assert(BigInt("-1") > "1", false, "-1n > '1'"); -assert("-1" > 1n, false, "'-1' > 1n"); -assert(BigInt("-1") > "-1", false, "-1n > '-1'"); -assert("-1" > BigInt("-1"), false, "'-1' > -1n"); -assert(9007199254740993n > "9007199254740992", true, "9007199254740993n > '9007199254740992'"); -assert("9007199254740993" > 9007199254740992n, true, "'9007199254740993' > 9007199254740992n"); -assert(BigInt("-9007199254740992") > "-9007199254740993", true, "-9007199254740992n > '-9007199254740993'"); -assert("-9007199254740992" > BigInt("-9007199254740993"), true, "'-9007199254740992' > -9007199254740993n"); -assert("0x10" > 14n, true, "'0x10' > 3n"); -assert("0b10" > 2n, false, "'0b10' > 2n"); -assert("0b10" > 1n, true, "'0x10' > 1n"); - -// Invalid String - -assert("b10" > 2n, false, "'b10' > 2n"); -assert("bbb10" > 2n, false, "'bbb10' > 2n"); - -// BigInt - Number - -assert(0n > 0, false, "0n > 0"); -assert(0 > 0n, false, "0 > 0n"); -assert(0n > -0, false, "0n > -0"); -assert(-0 > 0n, false, "-0 > 0n"); -assert(0n > 0.000000000001, false, "0n > 0.000000000001"); -assert(0.000000000001 > 0n, true, "0.000000000001 > 0n"); -assert(0n > 1, false, "0n > 1"); -assert(1 > 0n, true, "1 > 0n"); -assert(1n > 0, true, "1n > 0"); -assert(0 > 1n, false, "0 > 1n"); -assert(1n > 0.999999999999, true, "1n > 0.999999999999"); -assert(0.999999999999 > 1n, false, "0.999999999999 > 1n"); -assert(1n > 1, false, "1n > 1"); -assert(1 > 1n, false, "1 > 1n"); -assert(0n > Number.MIN_VALUE, false, "0n > Number.MIN_VALUE"); -assert(Number.MIN_VALUE > 0n, true, "Number.MIN_VALUE > 0n"); -assert(0n > -Number.MIN_VALUE, true, "0n > -Number.MIN_VALUE"); -assert(-Number.MIN_VALUE > 0n, false, "-Number.MIN_VALUE > 0n"); -assert(BigInt("-10") > Number.MIN_VALUE, false, "-10n > Number.MIN_VALUE"); -assert(Number.MIN_VALUE > BigInt("-10"), true, "Number.MIN_VALUE > -10n"); -assert(1n > Number.MAX_VALUE, false, "1n > Number.MAX_VALUE"); -assert(Number.MAX_VALUE > 1n, true, "Number.MAX_VALUE > 1n"); -assert(1n > -Number.MAX_VALUE, true, "1n > -Number.MAX_VALUE"); -assert(-Number.MAX_VALUE > 1n, false, "-Number.MAX_VALUE > 1n"); -assert(0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn > Number.MAX_VALUE, false, "0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn > Number.MAX_VALUE"); -assert(Number.MAX_VALUE > 0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn, true, "Number.MAX_VALUE > 0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn"); -assert(0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n > Number.MAX_VALUE, true, "0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n > Number.MAX_VALUE"); -assert(Number.MAX_VALUE > 0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n, false, "Number.MAX_VALUE > 0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n"); -assert(1n > Infinity, false, "1n > Infinity"); -assert(Infinity > 1n, true, "Infinity > 1n"); -assert(BigInt("-1") > Infinity, false, "-1n > Infinity"); -assert(Infinity > BigInt("-1"), true, "Infinity > -1n"); -assert(1n > -Infinity, true, "1n > -Infinity"); -assert(-Infinity > 1n, false, "-Infinity > 1n"); -assert(BigInt("-1") > -Infinity, true, "-1n > -Infinity"); -assert(-Infinity > BigInt("-1"), false, "-Infinity > -1n"); -assert(0n > NaN, false, "0n > NaN"); -assert(NaN > 0n, false, "NaN > 0n"); - -// BigInt - Boolean - -assert(false > 1n, false, "false > 1n"); -assert(1n > false, true, "1n > false"); -assert(false > 0n, false, "false > 0n"); -assert(0n > false, false, "0n > false"); -assert(true > 1n, false, "true > 1n"); -assert(1n > true, false, "1n > true"); -assert(true > 2n, false, "true > 2n"); -assert(2n > true, true, "2n > true"); - -// BigInt - Symbol - -try { - 1n > Symbol("1"); - assert(false, true, "Comparison with Symbol shoud throw TypeError, but executed without exception"); -} catch(e) { - assert(e instanceof TypeError, true, "Comparison with Symbol shoud throw TypeError, but throwed something else"); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-greater-than-jit.js b/implementation-contributed/javascriptcore/stress/big-int-greater-than-jit.js deleted file mode 100644 index f03ada2bd9..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-greater-than-jit.js +++ /dev/null @@ -1,24 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function greaterThanTest(a, b) { - return a > b; -} -noInline(greaterThanTest); - -for (let i = 0; i < 100000; i++) { - assert(greaterThanTest(3n, 4) === false); -} - -for (let i = 0; i < 100000; i++) { - assert(greaterThanTest(3n, 4n) === false); -} - -for (let i = 0; i < 100000; i++) { - assert(greaterThanTest(3n, "4") === false); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-greater-than-or-equal-jit.js b/implementation-contributed/javascriptcore/stress/big-int-greater-than-or-equal-jit.js deleted file mode 100644 index d37fe517aa..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-greater-than-or-equal-jit.js +++ /dev/null @@ -1,24 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function greaterThanOrEqualTest(a, b) { - return a >= b; -} -noInline(greaterThanOrEqualTest); - -for (let i = 0; i < 100000; i++) { - assert(greaterThanOrEqualTest(3n, 4) === false); -} - -for (let i = 0; i < 100000; i++) { - assert(greaterThanOrEqualTest(3n, 4n) === false); -} - -for (let i = 0; i < 100000; i++) { - assert(greaterThanOrEqualTest(3n, "4") === false); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-greater-than-or-equal-order-of-evaluation.js b/implementation-contributed/javascriptcore/stress/big-int-greater-than-or-equal-order-of-evaluation.js deleted file mode 100644 index 0e8ac85af7..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-greater-than-or-equal-order-of-evaluation.js +++ /dev/null @@ -1,55 +0,0 @@ -//@ runBigIntEnabled - -function assert(v, e, m) { - if (v !== e) - throw new Error(m); -} - -let o = { - [Symbol.toPrimitive]: function() { - throw new Error("Calling @toPrimitive"); - } -} - -try { - o >= Symbol(2); - assert(true, false, "") -} catch(e) { - assert(e.message, "Calling @toPrimitive", "Bad Exception when object is left operand"); -} - -try { - Symbol(2) >= o; - assert(true, false, "") -} catch(e) { - assert(e instanceof TypeError, true, "Bad Exception when Symbol is left operand"); -} - -o = { - [Symbol.toPrimitive]: function() { - return 2n; - }, - - toString: function() { - throw new Error("Should never call toString"); - }, - - valueOf: function() { - throw new Error("Should never call valueOf"); - } -} - -assert(o >= 3n, false, "ToPrimitive(2n) > 3n"); - -o = { - toString: function() { - throw new Error("Should never call toString"); - }, - - valueOf: function() { - return 2n; - } -} - -assert(o >= 3n, false, "valueOf(2n) > 3n"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-greater-than-or-equal-wrapped-values.js b/implementation-contributed/javascriptcore/stress/big-int-greater-than-or-equal-wrapped-values.js deleted file mode 100644 index 597b2cfd6e..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-greater-than-or-equal-wrapped-values.js +++ /dev/null @@ -1,63 +0,0 @@ -//@ runBigIntEnabled - -function assert(v, e, m) { - if (v !== e) - throw new Error(m); -} - -assert(Object(2n) >= 1n, true, "Object(2n) >= 1n"); -assert(1n >= Object(2n), false, "1n >= Object(2n)"); -assert(Object(2n) >= Object(1n), true, "Object(2n) >= Object(1n)"); -assert(Object(1n) >= Object(2n), false, "Object(1n) >= Object(2n)"); - -let o = { - [Symbol.toPrimitive]: function() { - return 2n; - } -} - -let o2 = { - [Symbol.toPrimitive]: function() { - return 1n; - } -} - -assert(o >= 1n, true, "ToPrimitive(2n) >= 1n"); -assert(1n >= o, false, "1n >= ToPrimitive(2n)"); -assert(o >= o2, true, "ToPrimitive(2n) >= ToPrimitive(1n)"); -assert(o2 >= o, false, "ToPrimitive(1n) >= ToPrimitive(2n)"); - -o = { - valueOf: function() { - return 2n; - } -} - -o2 = { - valueOf: function() { - return 1n; - } -} - -assert(o >= 1n, true, "valueOf(2n) >= 1n"); -assert(1n >= o, false, "1n >= valueOf(2n)"); -assert(o >= o2, true, "valueOf(2n) >= valueOf(1n)"); -assert(o2 >= o, false, "valueOf(1n) >= valueOf(2n)"); - -o = { - toString: function() { - return 2n; - } -} - -o2 = { - toString: function() { - return 1n; - } -} - -assert(o >= 1n, true, "toString(2n) >= 1n"); -assert(1n >= o, false, "1n >= ToPrimitive(2n)"); -assert(o >= o2, true, "toString(2n) < toString(1n)"); -assert(o2 >= o, false, "toString(1n) < toString(2n)"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-greater-than-or-equal.js b/implementation-contributed/javascriptcore/stress/big-int-greater-than-or-equal.js deleted file mode 100644 index 7fb523ae2c..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-greater-than-or-equal.js +++ /dev/null @@ -1,140 +0,0 @@ -//@ runBigIntEnabled - -// Copyright (C) 2017 Josh Wolfe. All rights reserved. -// Copyright (C) 2018 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -function assert(v, e, m) { - if (v !== e) - throw new Error(m); -} - -assert(0n >= 0n, true, "0n >= 0n"); -assert(1n >= 1n, true, "1n >= 1n"); -assert(BigInt("-1") >= BigInt("-1"), true, "-1n >= -1n"); -assert(0n >= BigInt("-0"), true, "0n >= -0n"); -assert(BigInt("-0") >= 0n, true, "-0n >= 0n"); -assert(0n >= 1n, false, "0n >= 1n"); -assert(1n >= 0n, true, "1n >= 0n"); -assert(0n >= BigInt("-1"), true, "0n >= -1n"); -assert(BigInt("-1") >= 0n, false, "-1n >= 0n"); -assert(1n >= BigInt("-1"), true, "1n >= -1n"); -assert(BigInt("-1") >= 1n, false, "-1n >= 1n"); -assert(0x1fffffffffffff01n >= 0x1fffffffffffff02n, false, "0x1fffffffffffff01n >= 0x1fffffffffffff02n"); -assert(0x1fffffffffffff02n >= 0x1fffffffffffff01n, true, "0x1fffffffffffff02n >= 0x1fffffffffffff01n"); -assert(BigInt("-2305843009213693697") >= BigInt("-2305843009213693698"), true, "-2305843009213693697n >= -2305843009213693698n"); -assert(BigInt("-2305843009213693698") >= BigInt("-2305843009213693697"), false, "-2305843009213693698n >= -2305843009213693697n"); -assert(0x10000000000000000n >= 0n, true, "0x10000000000000000n >= 0n"); -assert(0n >= 0x10000000000000000n, false, "0n >= 0x10000000000000000n"); -assert(0x10000000000000000n >= 1n, true, "0x10000000000000000n >= 1n"); -assert(1n >= 0x10000000000000000n, false, "1n >= 0x10000000000000000n"); -assert(0x10000000000000000n >= BigInt("-1"), true, "0x10000000000000000n >= -1n"); -assert(BigInt("-1") >= 0x10000000000000000n, false, "-1n >= 0x10000000000000000n"); -assert(0x10000000000000001n >= 0n, true, "0x10000000000000001n >= 0n"); -assert(0n >= 0x10000000000000001n, false, "0n >= 0x10000000000000001n"); -assert(BigInt("-18446744073709551616") >= 0n, false, "-18446744073709551616n >= 0n"); -assert(0n >= BigInt("-18446744073709551616"), true, "0n >= -18446744073709551616n"); -assert(BigInt("-18446744073709551616") >= 1n, false, "-18446744073709551616n >= 1n"); -assert(1n >= BigInt("-18446744073709551616"), true, "1n >= -18446744073709551616n"); -assert(BigInt("-18446744073709551616") >= BigInt("-1"), false, "-18446744073709551616n >= -1n"); -assert(BigInt("-1") >= BigInt("-18446744073709551616"), true, "-1n >= -18446744073709551616n"); -assert(BigInt("-18446744073709551617") >= 0n, false, "-18446744073709551617n >= 0n"); -assert(0n >= BigInt("-18446744073709551617"), true, "0n >= -18446744073709551617n"); -assert(0x10000000000000000n >= 0x100000000n, true, "0x10000000000000000n >= 0x100000000n"); -assert(0x100000000n >= 0x10000000000000000n, false, "0x100000000n >= 0x10000000000000000n"); - -// BigInt - String - -assert(0n >= "0", true, "0n >= '0'"); -assert("0" >= 0n, true, "'0' >= 0n"); -assert(0n >= "1", false, "0n >= '1'"); -assert("0" >= 1n, false, "'0' >= 1n"); -assert(1n >= "0", true, "1n >= '0'"); -assert("1" >= 0n, true, "'1' >= 0n"); -assert(0n >= "", true, "0n >= ''"); -assert("" >= 0n, true, "'' >= 0n"); -assert(0n >= "1", false, "0n >= '1'"); -assert("" >= 1n, false, "'' >= 1n"); -assert(1n >= "", true, "1n >= ''"); -assert(1n >= "1", true, "1n >= '1'"); -assert("1" >= 1n, true, "'1' >= 1n"); -assert(1n >= "-1", true, "1n >= '-1'"); -assert("1" >= BigInt("-1"), true, "'1' >= -1n"); -assert(BigInt("-1") >= "1", false, "-1n >= '1'"); -assert("-1" >= 1n, false, "'-1' >= 1n"); -assert(BigInt("-1") >= "-1", true, "-1n >= '-1'"); -assert("-1" >= BigInt("-1"), true, "'-1' >= -1n"); -assert(9007199254740993n >= "9007199254740992", true, "9007199254740993n >= '9007199254740992'"); -assert("9007199254740993" >= 9007199254740992n, true, "'9007199254740993' >= 9007199254740992n"); -assert(BigInt("-9007199254740992") >= "-9007199254740993", true, "-9007199254740992n >= '-9007199254740993'"); -assert("-9007199254740992" >= BigInt("-9007199254740993"), true, "'-9007199254740992' >= -9007199254740993n"); -assert("0x10" >= 14n, true, "'0x10' >= 3n"); -assert("0b10" >= 2n, true, "'0b10' >= 2n"); -assert("0b10" >= 1n, true, "'0b10' >= 1n"); - -// Invalid String - -assert("b10" >= 2n, false, "'b10' >= 2n"); -assert("bbb10" >= 2n, false, "'bbb10' >= 2n"); - -// BigInt - Number - -assert(0n >= 0, true, "0n >= 0"); -assert(0 >= 0n, true, "0 >= 0n"); -assert(0n >= -0, true, "0n >= -0"); -assert(-0 >= 0n, true, "-0 >= 0n"); -assert(0n >= 0.000000000001, false, "0n >= 0.000000000001"); -assert(0.000000000001 >= 0n, true, "0.000000000001 >= 0n"); -assert(0n >= 1, false, "0n >= 1"); -assert(1 >= 0n, true, "1 >= 0n"); -assert(1n >= 0, true, "1n >= 0"); -assert(0 >= 1n, false, "0 >= 1n"); -assert(1n >= 0.999999999999, true, "1n >= 0.999999999999"); -assert(0.999999999999 >= 1n, false, "0.999999999999 >= 1n"); -assert(1n >= 1, true, "1n >= 1"); -assert(1 >= 1n, true, "1 >= 1n"); -assert(0n >= Number.MIN_VALUE, false, "0n >= Number.MIN_VALUE"); -assert(Number.MIN_VALUE >= 0n, true, "Number.MIN_VALUE >= 0n"); -assert(0n >= -Number.MIN_VALUE, true, "0n >= -Number.MIN_VALUE"); -assert(-Number.MIN_VALUE >= 0n, false, "-Number.MIN_VALUE >= 0n"); -assert(BigInt("-10") >= Number.MIN_VALUE, false, "-10n >= Number.MIN_VALUE"); -assert(Number.MIN_VALUE >= BigInt("-10"), true, "Number.MIN_VALUE >= -10n"); -assert(1n >= Number.MAX_VALUE, false, "1n >= Number.MAX_VALUE"); -assert(Number.MAX_VALUE >= 1n, true, "Number.MAX_VALUE >= 1n"); -assert(1n >= -Number.MAX_VALUE, true, "1n >= -Number.MAX_VALUE"); -assert(-Number.MAX_VALUE >= 1n, false, "-Number.MAX_VALUE >= 1n"); -assert(0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn >= Number.MAX_VALUE, false, "0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn >= Number.MAX_VALUE"); -assert(Number.MAX_VALUE >= 0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn, true, "Number.MAX_VALUE >= 0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn"); -assert(0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n >= Number.MAX_VALUE, true, "0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n >= Number.MAX_VALUE"); -assert(Number.MAX_VALUE >= 0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n, false, "Number.MAX_VALUE >= 0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n"); -assert(1n >= Infinity, false, "1n >= Infinity"); -assert(Infinity >= 1n, true, "Infinity >= 1n"); -assert(BigInt("-1") >= Infinity, false, "-1n >= Infinity"); -assert(Infinity >= BigInt("-1"), true, "Infinity >= -1n"); -assert(1n >= -Infinity, true, "1n >= -Infinity"); -assert(-Infinity >= 1n, false, "-Infinity >= 1n"); -assert(BigInt("-1") >= -Infinity, true, "-1n >= -Infinity"); -assert(-Infinity >= BigInt("-1"), false, "-Infinity >= -1n"); -assert(0n >= NaN, false, "0n >= NaN"); -assert(NaN >= 0n, false, "NaN >= 0n"); - -// BigInt - Boolean - -assert(false >= 1n, false, "false >= 1n"); -assert(1n >= false, true, "1n >= false"); -assert(false >= 0n, true, "false >= 0n"); -assert(0n >= false, true, "0n >= false"); -assert(true >= 1n, true, "true >= 1n"); -assert(1n >= true, true, "1n >= true"); -assert(true >= 2n, false, "true >= 2n"); -assert(2n >= true, true, "2n >= true"); - -// BigInt - Symbol - -try { - 1n >= Symbol("1"); - assert(false, true, "Comparison with Symbol shoud throw TypeError, but executed without exception"); -} catch(e) { - assert(e instanceof TypeError, true, "Comparison with Symbol shoud throw TypeError, but throwed something else"); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-greater-than-order-of-evaluation.js b/implementation-contributed/javascriptcore/stress/big-int-greater-than-order-of-evaluation.js deleted file mode 100644 index b961ba5c45..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-greater-than-order-of-evaluation.js +++ /dev/null @@ -1,55 +0,0 @@ -//@ runBigIntEnabled - -function assert(v, e, m) { - if (v !== e) - throw new Error(m); -} - -let o = { - [Symbol.toPrimitive]: function() { - throw new Error("Calling @toPrimitive"); - } -} - -try { - o > Symbol(2); - assert(true, false, "") -} catch(e) { - assert(e.message, "Calling @toPrimitive", "Bad Exception when object is left operand"); -} - -try { - Symbol(2) > o; - assert(true, false, "") -} catch(e) { - assert(e instanceof TypeError, true, "Bad Exception when Symbol is left operand"); -} - -o = { - [Symbol.toPrimitive]: function() { - return 2n; - }, - - toString: function() { - throw new Error("Should never call toString"); - }, - - valueOf: function() { - throw new Error("Should never call valueOf"); - } -} - -assert(o > 3n, false, "ToPrimitive(2n) > 3n"); - -o = { - toString: function() { - throw new Error("Should never call toString"); - }, - - valueOf: function() { - return 2n; - } -} - -assert(o > 3n, false, "valueOf(2n) > 3n"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-greater-than-wrapped-values.js b/implementation-contributed/javascriptcore/stress/big-int-greater-than-wrapped-values.js deleted file mode 100644 index 4f45f1f229..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-greater-than-wrapped-values.js +++ /dev/null @@ -1,63 +0,0 @@ -//@ runBigIntEnabled - -function assert(v, e, m) { - if (v !== e) - throw new Error(m); -} - -assert(Object(2n) > 1n, true, "Object(2n) > 1n"); -assert(1n > Object(2n), false, "1n > Object(2n)"); -assert(Object(2n) > Object(1n), true, "Object(2n) > Object(1n)"); -assert(Object(1n) > Object(2n), false, "Object(1n) > Object(2n)"); - -let o = { - [Symbol.toPrimitive]: function() { - return 2n; - } -} - -let o2 = { - [Symbol.toPrimitive]: function() { - return 1n; - } -} - -assert(o > 1n, true, "ToPrimitive(2n) > 1n"); -assert(1n > o, false, "1n > ToPrimitive(2n)"); -assert(o > o2, true, "ToPrimitive(2n) > ToPrimitive(1n)"); -assert(o2 > o, false, "ToPrimitive(1n) > ToPrimitive(2n)"); - -o = { - valueOf: function() { - return 2n; - } -} - -o2 = { - valueOf: function() { - return 1n; - } -} - -assert(o > 1n, true, "valueOf(2n) > 1n"); -assert(1n > o, false, "1n > valueOf(2n)"); -assert(o > o2, true, "valueOf(2n) > valueOf(1n)"); -assert(o2 > o, false, "valueOf(1n) > valueOf(2n)"); - -o = { - toString: function() { - return 2n; - } -} - -o2 = { - toString: function() { - return 1n; - } -} - -assert(o > 1n, true, "toString(2n) > 1n"); -assert(1n > o, false, "1n > ToPrimitive(2n)"); -assert(o > o2, true, "toString(2n) < toString(1n)"); -assert(o2 > o, false, "toString(1n) < toString(2n)"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-length.js b/implementation-contributed/javascriptcore/stress/big-int-length.js deleted file mode 100644 index f004383bfb..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-length.js +++ /dev/null @@ -1,13 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -let p = Object.getOwnPropertyDescriptor(BigInt, "length"); -assert(p.enumerable === false); -assert(p.writable === false); -assert(p.configurable === true); -assert(p.value === 1); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-less-than-general.js b/implementation-contributed/javascriptcore/stress/big-int-less-than-general.js deleted file mode 100644 index afa191c92e..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-less-than-general.js +++ /dev/null @@ -1,148 +0,0 @@ -//@ runBigIntEnabled - -// Copyright (C) 2017 Josh Wolfe. All rights reserved. -// Copyright (C) 2017 Robin Templeton. All rights reserved. -// Copyright (C) 2018 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -function assert(v, e, m) { - if (v !== e) - throw new Error(m); -} - -assert(0n < 0n, false, "0n < 0n"); -assert(1n < 1n, false, "1n < 1n"); -assert(BigInt("-1") < BigInt("-1"), false, "-1n < -1n"); -assert(0n < BigInt("-0"), false, "0n < -0n"); -assert(BigInt("-0") < 0n, false, "-0n < 0n"); -assert(0n < 1n, true, "0n < 1n"); -assert(1n < 0n, false, "1n < 0n"); -assert(0n < BigInt("-1"), false, "0n < -1n"); -assert(BigInt("-1") < 0n, true, "-1n < 0n"); -assert(1n < BigInt("-1"), false, "1n < -1n"); -assert(BigInt("-1") < 1n, true, "-1n < 1n"); -assert(0x1fffffffffffff01n < 0x1fffffffffffff02n, true, "0x1fffffffffffff01n < 0x1fffffffffffff02n"); -assert(0x1fffffffffffff02n < 0x1fffffffffffff01n, false, "0x1fffffffffffff02n < 0x1fffffffffffff01n"); -assert(BigInt("-2305843009213693697") < BigInt("-2305843009213693698"), false, "-2305843009213693697n < -2305843009213693698n"); -assert(BigInt("-2305843009213693698") < BigInt("-2305843009213693697"), true, "-2305843009213693698n < -2305843009213693697n"); -assert(0x10000000000000000n < 0n, false, "0x10000000000000000n < 0n"); -assert(0n < 0x10000000000000000n, true, "0n < 0x10000000000000000n"); -assert(0x10000000000000000n < 1n, false, "0x10000000000000000n < 1n"); -assert(1n < 0x10000000000000000n, true, "1n < 0x10000000000000000n"); -assert(0x10000000000000000n < BigInt("-1"), false, "0x10000000000000000n < -1n"); -assert(BigInt("-1") < 0x10000000000000000n, true, "-1n < 0x10000000000000000n"); -assert(0x10000000000000001n < 0n, false, "0x10000000000000001n < 0n"); -assert(0n < 0x10000000000000001n, true, "0n < 0x10000000000000001n"); -assert(BigInt("-18446744073709551616") < 0n, true, "-18446744073709551616n < 0n"); -assert(0n < BigInt("-18446744073709551616"), false, "0n < -18446744073709551616n"); -assert(BigInt("-18446744073709551616") < 1n, true, "-18446744073709551616n < 1n"); -assert(1n < BigInt("-18446744073709551616"), false, "1n < -18446744073709551616n"); -assert(BigInt("-18446744073709551616") < BigInt("-1"), true, "-18446744073709551616n < -1n"); -assert(BigInt("-1") < BigInt("-18446744073709551616"), false, "-1n < -18446744073709551616n"); -assert(BigInt("-18446744073709551617") < 0n, true, "-18446744073709551617n < 0n"); -assert(0n < BigInt("-18446744073709551617"), false, "0n < -18446744073709551617n"); -assert(0x10000000000000000n < 0x100000000n, false, "0x10000000000000000n < 0x100000000n"); -assert(0x100000000n < 0x10000000000000000n, true, "0x100000000n < 0x10000000000000000n"); - -// BigInt - String - -assert(0n < "0", false, "0n < '0'"); -assert("0" < 0n, false, "'0' < 0n"); -assert(0n < "1", true, "0n < '1'"); -assert("0" < 1n, true, "'0' < 1n"); -assert(1n < "0", false, "1n < '0'"); -assert("1" < 0n, false, "'1' < 0n"); -assert(0n < "", false, "0n < ''"); -assert("" < 0n, false, "'' < 0n"); -assert(0n < "1", true, "0n < '1'"); -assert("" < 1n, true, "'' < 1n"); -assert(1n < "", false, "1n < ''"); -assert("1" < 0n, false, "'1' < 0n"); -assert(1n < "1", false, "1n < '1'"); -assert("1" < 1n, false, "'1' < 1n"); -assert(1n < "-1", false, "1n < '-1'"); -assert("1" < BigInt("-1"), false, "'1' < -1n"); -assert(BigInt("-1") < "1", true, "-1n < '1'"); -assert("-1" < 1n, true, "'-1' < 1n"); -assert(BigInt("-1") < "-1", false, "-1n < '-1'"); -assert("-1" < BigInt("-1"), false, "'-1' < -1n"); -assert(9007199254740993n < "9007199254740992", false, "9007199254740993n < '9007199254740992'"); -assert("9007199254740993" < 9007199254740992n, false, "'9007199254740993' < 9007199254740992n"); -assert(BigInt("-9007199254740992") < "-9007199254740993", false, "-9007199254740992n < '-9007199254740993'"); -assert("-9007199254740992" < BigInt("-9007199254740993"), false, "'-9007199254740992' < -9007199254740993n"); -assert("0x10" < 3n, false, "'0x10' < 3n"); -assert("0x10" < 2n, false, "'0x10' < 2n"); -assert("0x10" < 1n, false, "'0x10' < 1n"); -assert("0o10" < 9n, true, "'0o10' < 9n"); -assert("0o10" < 8n, false, "'0o10' < 8n"); -assert("0o10" < 7n, false, "'0o10' < 7n"); -assert("0b10" < 3n, true, "'0o10' < 3n"); -assert("0b10" < 2n, false, "'0o10' < 2n"); -assert("0b10" < 1n, false, "'0o10' < 1n"); - -// Invalid String - -assert("b10" < 2n, false, "'b10' > 2n"); -assert("bbb10" < 2n, false, "'bbb10' > 2n"); - -// BigInt - Number - -assert(0n < 0, false, "0n < 0"); -assert(0 < 0n, false, "0 < 0n"); -assert(0n < -0, false, "0n < -0"); -assert(-0 < 0n, false, "-0 < 0n"); -assert(0n < 0.000000000001, true, "0n < 0.000000000001"); -assert(0.000000000001 < 0n, false, "0.000000000001 < 0n"); -assert(0n < 1, true, "0n < 1"); -assert(1 < 0n, false, "1 < 0n"); -assert(1n < 0, false, "1n < 0"); -assert(0 < 1n, true, "0 < 1n"); -assert(1n < 0.999999999999, false, "1n < 0.999999999999"); -assert(0.999999999999 < 1n, true, "0.999999999999 < 1n"); -assert(1n < 1, false, "1n < 1"); -assert(1 < 1n, false, "1 < 1n"); -assert(0n < Number.MIN_VALUE, true, "0n < Number.MIN_VALUE"); -assert(Number.MIN_VALUE < 0n, false, "Number.MIN_VALUE < 0n"); -assert(0n < -Number.MIN_VALUE, false, "0n < -Number.MIN_VALUE"); -assert(-Number.MIN_VALUE < 0n, true, "-Number.MIN_VALUE < 0n"); -assert(BigInt("-10") < Number.MIN_VALUE, true, "-10n < Number.MIN_VALUE"); -assert(Number.MIN_VALUE < BigInt("-10"), false, "Number.MIN_VALUE < -10n"); -assert(1n < Number.MAX_VALUE, true, "1n < Number.MAX_VALUE"); -assert(Number.MAX_VALUE < 1n, false, "Number.MAX_VALUE < 1n"); -assert(1n < -Number.MAX_VALUE, false, "1n < -Number.MAX_VALUE"); -assert(-Number.MAX_VALUE < 1n, true, "-Number.MAX_VALUE < 1n"); -assert(0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn < Number.MAX_VALUE, true, "0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn < Number.MAX_VALUE"); -assert(Number.MAX_VALUE < 0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn, false, "Number.MAX_VALUE < 0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn"); -assert(0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n < Number.MAX_VALUE, false, "0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n < Number.MAX_VALUE"); -assert(Number.MAX_VALUE < 0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n, true, "Number.MAX_VALUE < 0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n"); -assert(1n < Infinity, true, "1n < Infinity"); -assert(Infinity < 1n, false, "Infinity < 1n"); -assert(BigInt("-1") < Infinity, true, "-1n < Infinity"); -assert(Infinity < BigInt("-1"), false, "Infinity < -1n"); -assert(1n < -Infinity, false, "1n < -Infinity"); -assert(-Infinity < 1n, true, "-Infinity < 1n"); -assert(BigInt("-1") < -Infinity, false, "-1n < -Infinity"); -assert(-Infinity < BigInt("-1"), true, "-Infinity < -1n"); -assert(0n < NaN, false, "0n < NaN"); -assert(NaN < 0n, false, "NaN < 0n"); - -// BigInt - Boolean - -assert(false < 1n, true, "false < 1n"); -assert(1n < false, false, "1n < false"); -assert(false < 0n, false, "false < 0n"); -assert(0n < false, false, "0n < false"); -assert(true < 1n, false, "true < 1n"); -assert(1n < true, false, "1n < true"); -assert(true < 2n, true, "true < 2n"); -assert(2n < true, false, "2n < true"); - -// BigInt - Symbol - -try { - 1n < Symbol("1"); - assert(false, true, "Comparison with Symbol shoud throw TypeError, but executed without exception"); -} catch(e) { - assert(e instanceof TypeError, true, "Comparison with Symbol shoud throw TypeError, but throwed something else"); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-less-than-jit.js b/implementation-contributed/javascriptcore/stress/big-int-less-than-jit.js deleted file mode 100644 index 0e80addc11..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-less-than-jit.js +++ /dev/null @@ -1,24 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function lessThanTest(a, b) { - return a < b; -} -noInline(lessThanTest); - -for (let i = 0; i < 100000; i++) { - assert(lessThanTest(3n, 4) === true); -} - -for (let i = 0; i < 100000; i++) { - assert(lessThanTest(3n, 4n) === true); -} - -for (let i = 0; i < 100000; i++) { - assert(lessThanTest(3n, "4") === true); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-less-than-or-equal-general.js b/implementation-contributed/javascriptcore/stress/big-int-less-than-or-equal-general.js deleted file mode 100644 index 44ffa577b6..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-less-than-or-equal-general.js +++ /dev/null @@ -1,148 +0,0 @@ -//@ runBigIntEnabled - -// Copyright (C) 2017 Josh Wolfe. All rights reserved. -// Copyright (C) 2017 Robin Templeton. All rights reserved. -// Copyright (C) 2018 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -function assert(v, e, m) { - if (v !== e) - throw new Error(m); -} - -assert(0n <= 0n, true, "0n <= 0n"); -assert(1n <= 1n, true, "1n <= 1n"); -assert(BigInt("-1") <= BigInt("-1"), true, "-1n <= -1n"); -assert(0n <= BigInt("-0"), true, "0n <= -0n"); -assert(BigInt("-0") <= 0n, true, "-0n <= 0n"); -assert(0n <= 1n, true, "0n <= 1n"); -assert(1n <= 0n, false, "1n <= 0n"); -assert(0n <= BigInt("-1"), false, "0n <= -1n"); -assert(BigInt("-1") <= 0n, true, "-1n <= 0n"); -assert(1n <= BigInt("-1"), false, "1n <= -1n"); -assert(BigInt("-1") <= 1n, true, "-1n <= 1n"); -assert(0x1fffffffffffff01n <= 0x1fffffffffffff02n, true, "0x1fffffffffffff01n <= 0x1fffffffffffff02n"); -assert(0x1fffffffffffff02n <= 0x1fffffffffffff01n, false, "0x1fffffffffffff02n <= 0x1fffffffffffff01n"); -assert(BigInt("-2305843009213693697") <= BigInt("-2305843009213693698"), false, "-2305843009213693697n <= -2305843009213693698n"); -assert(BigInt("-2305843009213693698") <= BigInt("-2305843009213693697"), true, "-2305843009213693698n <= -2305843009213693697n"); -assert(0x10000000000000000n <= 0n, false, "0x10000000000000000n <= 0n"); -assert(0n <= 0x10000000000000000n, true, "0n <= 0x10000000000000000n"); -assert(0x10000000000000000n <= 1n, false, "0x10000000000000000n <= 1n"); -assert(1n <= 0x10000000000000000n, true, "1n <= 0x10000000000000000n"); -assert(0x10000000000000000n <= BigInt("-1"), false, "0x10000000000000000n <= -1n"); -assert(BigInt("-1") <= 0x10000000000000000n, true, "-1n <= 0x10000000000000000n"); -assert(0x10000000000000001n <= 0n, false, "0x10000000000000001n <= 0n"); -assert(0n <= 0x10000000000000001n, true, "0n <= 0x10000000000000001n"); -assert(BigInt("-18446744073709551616") <= 0n, true, "-18446744073709551616n <= 0n"); -assert(0n <= BigInt("-18446744073709551616"), false, "0n <= -18446744073709551616n"); -assert(BigInt("-18446744073709551616") <= 1n, true, "-18446744073709551616n <= 1n"); -assert(1n <= BigInt("-18446744073709551616"), false, "1n <= -18446744073709551616n"); -assert(BigInt("-18446744073709551616") <= BigInt("-1"), true, "-18446744073709551616n <= -1n"); -assert(BigInt("-1") <= BigInt("-18446744073709551616"), false, "-1n <= -18446744073709551616n"); -assert(BigInt("-18446744073709551617") <= 0n, true, "-18446744073709551617n <= 0n"); -assert(0n <= BigInt("-18446744073709551617"), false, "0n <= -18446744073709551617n"); -assert(0x10000000000000000n <= 0x100000000n, false, "0x10000000000000000n <= 0x100000000n"); -assert(0x100000000n <= 0x10000000000000000n, true, "0x100000000n <= 0x10000000000000000n"); - -// BigInt - String - -assert(0n <= "0", true, "0n <= '0'"); -assert("0" <= 0n, true, "'0' <= 0n"); -assert(0n <= "1", true, "0n <= '1'"); -assert("0" <= 1n, true, "'0' <= 1n"); -assert(1n <= "0", false, "1n <= '0'"); -assert("1" <= 0n, false, "'1' <= 0n"); -assert(0n <= "", true, "0n <= ''"); -assert("" <= 0n, true, "'' <= 0n"); -assert(0n <= "1", true, "0n <= '1'"); -assert("" <= 1n, true, "'' <= 1n"); -assert(1n <= "", false, "1n <= ''"); -assert("1" <= 0n, false, "'1' <= 0n"); -assert(1n <= "1", true, "1n <= '1'"); -assert("1" <= 1n, true, "'1' <= 1n"); -assert(1n <= "-1", false, "1n <= '-1'"); -assert("1" <= BigInt("-1"), false, "'1' <= -1n"); -assert(BigInt("-1") <= "1", true, "-1n <= '1'"); -assert("-1" <= 1n, true, "'-1' <= 1n"); -assert(BigInt("-1") <= "-1", true, "-1n <= '-1'"); -assert("-1" <= BigInt("-1"), true, "'-1' <= -1n"); -assert(9007199254740993n <= "9007199254740992", false, "9007199254740993n <= '9007199254740992'"); -assert("9007199254740993" <= 9007199254740992n, false, "'9007199254740993' <= 9007199254740992n"); -assert(BigInt("-9007199254740992") <= "-9007199254740993", false, "-9007199254740992n <= '-9007199254740993'"); -assert("-9007199254740992" <= BigInt("-9007199254740993"), false, "'-9007199254740992' <= -9007199254740993n"); -assert("0x10" <= 3n, false, "'0x10' <= 3n"); -assert("0x10" <= 2n, false, "'0x10' <= 2n"); -assert("0x10" <= 1n, false, "'0x10' <= 1n"); -assert("0o10" <= 7n, false, "'0o10' <= 7n"); -assert("0o10" <= 8n, true, "'0o10' <= 8n"); -assert("0o10" <= 9n, true, "'0o10' <= 9n"); -assert("0b10" <= 3n, true, "'0b10' <= 3n"); -assert("0b10" <= 2n, true, "'0b10' <= 2n"); -assert("0b10" <= 1n, false, "'0b10' <= 1n"); - -// Invalid String - -assert("b10" <= 2n, false, "'b10' > 2n"); -assert("bbb10" <= 2n, false, "'bbb10' > 2n"); - -// BigInt - Number - -assert(0n <= 0, true, "0n <= 0"); -assert(0 <= 0n, true, "0 <= 0n"); -assert(0n <= -0, true, "0n <= -0"); -assert(-0 <= 0n, true, "-0 <= 0n"); -assert(0n <= 0.000000000001, true, "0n <= 0.000000000001"); -assert(0.000000000001 <= 0n, false, "0.000000000001 <= 0n"); -assert(0n <= 1, true, "0n <= 1"); -assert(1 <= 0n, false, "1 <= 0n"); -assert(1n <= 0, false, "1n <= 0"); -assert(0 <= 1n, true, "0 <= 1n"); -assert(1n <= 0.999999999999, false, "1n <= 0.999999999999"); -assert(0.999999999999 <= 1n, true, "0.999999999999 <= 1n"); -assert(1n <= 1, true, "1n <= 1"); -assert(1 <= 1n, true, "1 <= 1n"); -assert(0n <= Number.MIN_VALUE, true, "0n <= Number.MIN_VALUE"); -assert(Number.MIN_VALUE <= 0n, false, "Number.MIN_VALUE <= 0n"); -assert(0n <= -Number.MIN_VALUE, false, "0n <= -Number.MIN_VALUE"); -assert(-Number.MIN_VALUE <= 0n, true, "-Number.MIN_VALUE <= 0n"); -assert(BigInt("-10") <= Number.MIN_VALUE, true, "-10n <= Number.MIN_VALUE"); -assert(Number.MIN_VALUE <= BigInt("-10"), false, "Number.MIN_VALUE <= -10n"); -assert(1n <= Number.MAX_VALUE, true, "1n <= Number.MAX_VALUE"); -assert(Number.MAX_VALUE <= 1n, false, "Number.MAX_VALUE <= 1n"); -assert(1n <= -Number.MAX_VALUE, false, "1n <= -Number.MAX_VALUE"); -assert(-Number.MAX_VALUE <= 1n, true, "-Number.MAX_VALUE <= 1n"); -assert(0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn <= Number.MAX_VALUE, true, "0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn <= Number.MAX_VALUE"); -assert(Number.MAX_VALUE <= 0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn, false, "Number.MAX_VALUE <= 0xfffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn"); -assert(0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n <= Number.MAX_VALUE, false, "0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n <= Number.MAX_VALUE"); -assert(Number.MAX_VALUE <= 0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n, true, "Number.MAX_VALUE <= 0xfffffffffffff800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001n"); -assert(1n <= Infinity, true, "1n <= Infinity"); -assert(Infinity <= 1n, false, "Infinity <= 1n"); -assert(BigInt("-1") <= Infinity, true, "-1n <= Infinity"); -assert(Infinity <= BigInt("-1"), false, "Infinity <= -1n"); -assert(1n <= -Infinity, false, "1n <= -Infinity"); -assert(-Infinity <= 1n, true, "-Infinity <= 1n"); -assert(BigInt("-1") <= -Infinity, false, "-1n <= -Infinity"); -assert(-Infinity <= BigInt("-1"), true, "-Infinity <= -1n"); -assert(0n <= NaN, false, "0n <= NaN"); -assert(NaN <= 0n, false, "NaN <= 0n"); - -// BigInt - Boolean - -assert(false <= 1n, true, "false <= 1n"); -assert(1n <= false, false, "1n <= false"); -assert(false <= 0n, true, "false <= 0n"); -assert(0n <= false, true, "0n <= false"); -assert(true <= 1n, true, "true <= 1n"); -assert(1n <= true, true, "1n <= true"); -assert(true <= 2n, true, "true <= 2n"); -assert(2n <= true, false, "2n <= true"); - -// BigInt - Symbol - -try { - 1n <= Symbol("1"); - assert(false, true, "Comparison with Symbol shoud throw TypeError, but executed without exception"); -} catch(e) { - assert(e instanceof TypeError, true, "Comparison with Symbol shoud throw TypeError, but throwed something else"); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-less-than-or-equal-jit.js b/implementation-contributed/javascriptcore/stress/big-int-less-than-or-equal-jit.js deleted file mode 100644 index f356844050..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-less-than-or-equal-jit.js +++ /dev/null @@ -1,24 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function lessThanOrEqualTest(a, b) { - return a <= b; -} -noInline(lessThanOrEqualTest); - -for (let i = 0; i < 100000; i++) { - assert(lessThanOrEqualTest(3n, 4) === true); -} - -for (let i = 0; i < 100000; i++) { - assert(lessThanOrEqualTest(3n, 4n) === true); -} - -for (let i = 0; i < 100000; i++) { - assert(lessThanOrEqualTest(3n, "4") === true); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-less-than-or-equal-order-of-evaluation.js b/implementation-contributed/javascriptcore/stress/big-int-less-than-or-equal-order-of-evaluation.js deleted file mode 100644 index 64ea754110..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-less-than-or-equal-order-of-evaluation.js +++ /dev/null @@ -1,55 +0,0 @@ -//@ runBigIntEnabled - -function assert(v, e, m) { - if (v !== e) - throw new Error(m); -} - -let o = { - [Symbol.toPrimitive]: function() { - throw new Error("Calling @toPrimitive"); - } -} - -try { - o <= Symbol(2); - assert(true, false, "") -} catch(e) { - assert(e.message, "Calling @toPrimitive", "Bad Exception when object is left operand"); -} - -try { - Symbol(2) <= o; - assert(true, false, "") -} catch(e) { - assert(e instanceof TypeError, true, "Bad Exception when Symbol is left operand"); -} - -o = { - [Symbol.toPrimitive]: function() { - return 2n; - }, - - toString: function() { - throw new Error("Should never call toString"); - }, - - valueOf: function() { - throw new Error("Should never call valueOf"); - } -} - -assert(o <= 3n, true, "ToPrimitive(2n) <= 3n"); - -o = { - toString: function() { - throw new Error("Should never call toString"); - }, - - valueOf: function() { - return 2n; - } -} - -assert(o <= 3n, true, "valueOf(2n) <= 3n"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-less-than-or-equal-wrapped-values.js b/implementation-contributed/javascriptcore/stress/big-int-less-than-or-equal-wrapped-values.js deleted file mode 100644 index 237c56a46b..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-less-than-or-equal-wrapped-values.js +++ /dev/null @@ -1,63 +0,0 @@ -//@ runBigIntEnabled - -function assert(v, e, m) { - if (v !== e) - throw new Error(m); -} - -assert(Object(2n) <= 1n, false, "Object(2n) <= 1n"); -assert(1n <= Object(2n), true, "1n <= Object(2n)"); -assert(Object(2n) <= Object(1n), false, "Object(2n) <= Object(1n)"); -assert(Object(1n) <= Object(2n), true, "Object(1n) <= Object(2n)"); - -let o = { - [Symbol.toPrimitive]: function() { - return 2n; - } -} - -let o2 = { - [Symbol.toPrimitive]: function() { - return 1n; - } -} - -assert(o <= 1n, false, "ToPrimitive(2n) <= 1n"); -assert(1n <= o, true, "1n <= ToPrimitive(2n)"); -assert(o <= o2, false, "ToPrimitive(2n) <= ToPrimitive(1n)"); -assert(o2 <= o, true, "ToPrimitive(1n) <= ToPrimitive(2n)"); - -o = { - valueOf: function() { - return 2n; - } -} - -o2 = { - valueOf: function() { - return 1n; - } -} - -assert(o <= 1n, false, "ToPrimitive(2n) <= 1n"); -assert(1n <= o, true, "1n <= ToPrimitive(2n)"); -assert(o <= o2, false, "ToPrimitive(2n) <= ToPrimitive(1n)"); -assert(o2 <= o, true, "ToPrimitive(1n) <= ToPrimitive(2n)"); - -o = { - toString: function() { - return 2n; - } -} - -o2 = { - toString: function() { - return 1n; - } -} - -assert(o <= 1n, false, "ToPrimitive(2n) <= 1n"); -assert(1n <= o, true, "1n <= ToPrimitive(2n)"); -assert(o <= o2, false, "ToPrimitive(2n) <= ToPrimitive(1n)"); -assert(o2 <= o, true, "ToPrimitive(1n) <= ToPrimitive(2n)"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-less-than-order-of-evaluation.js b/implementation-contributed/javascriptcore/stress/big-int-less-than-order-of-evaluation.js deleted file mode 100644 index b7efe433ef..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-less-than-order-of-evaluation.js +++ /dev/null @@ -1,55 +0,0 @@ -//@ runBigIntEnabled - -function assert(v, e, m) { - if (v !== e) - throw new Error(m); -} - -let o = { - [Symbol.toPrimitive]: function() { - throw new Error("Calling @toPrimitive"); - } -} - -try { - o < Symbol(2); - assert(true, false, "") -} catch(e) { - assert(e.message, "Calling @toPrimitive", "Bad Exception when object is left operand"); -} - -try { - Symbol(2) < o; - assert(true, false, "") -} catch(e) { - assert(e instanceof TypeError, true, "Bad Exception when Symbol is left operand"); -} - -o = { - [Symbol.toPrimitive]: function() { - return 2n; - }, - - toString: function() { - throw new Error("Should never call toString"); - }, - - valueOf: function() { - throw new Error("Should never call valueOf"); - } -} - -assert(o < 3n, true, "ToPrimitive(2n) < 3n"); - -o = { - toString: function() { - throw new Error("Should never call toString"); - }, - - valueOf: function() { - return 2n; - } -} - -assert(o < 3n, true, "valueOf(2n) < 3n"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-less-than-wrapped-values.js b/implementation-contributed/javascriptcore/stress/big-int-less-than-wrapped-values.js deleted file mode 100644 index 67a2e0ba87..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-less-than-wrapped-values.js +++ /dev/null @@ -1,63 +0,0 @@ -//@ runBigIntEnabled - -function assert(v, e, m) { - if (v !== e) - throw new Error(m); -} - -assert(Object(2n) < 1n, false, "Object(2n) < 1n"); -assert(1n < Object(2n), true, "1n < Object(2n)"); -assert(Object(2n) < Object(1n), false, "Object(2n) < Object(1n)"); -assert(Object(1n) < Object(2n), true, "Object(1n) < Object(2n)"); - -let o = { - [Symbol.toPrimitive]: function() { - return 2n; - } -} - -let o2 = { - [Symbol.toPrimitive]: function() { - return 1n; - } -} - -assert(o < 1n, false, "ToPrimitive(2n) < 1n"); -assert(1n < o, true, "1n < ToPrimitive(2n)"); -assert(o < o2, false, "ToPrimitive(2n) < ToPrimitive(1n)"); -assert(o2 < o, true, "ToPrimitive(1n) < ToPrimitive(2n)"); - -o = { - valueOf: function() { - return 2n; - } -} - -o2 = { - valueOf: function() { - return 1n; - } -} - -assert(o < 1n, false, "ToPrimitive(2n) < 1n"); -assert(1n < o, true, "1n < ToPrimitive(2n)"); -assert(o < o2, false, "ToPrimitive(2n) < ToPrimitive(1n)"); -assert(o2 < o, true, "ToPrimitive(1n) < ToPrimitive(2n)"); - -o = { - toString: function() { - return 2n; - } -} - -o2 = { - toString: function() { - return 1n; - } -} - -assert(o < 1n, false, "ToPrimitive(2n) < 1n"); -assert(1n < o, true, "1n < ToPrimitive(2n)"); -assert(o < o2, false, "ToPrimitive(2n) < ToPrimitive(1n)"); -assert(o2 < o, true, "ToPrimitive(1n) < ToPrimitive(2n)"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-literal-line-terminator.js b/implementation-contributed/javascriptcore/stress/big-int-literal-line-terminator.js deleted file mode 100644 index dafb4999ee..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-literal-line-terminator.js +++ /dev/null @@ -1,33 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -var d; - -assert(eval("d=5n\u000A") === 5n); -assert(d === 5n); - -assert(eval("d=15n\u000D") === 15n); -assert(d === 15n); - -assert(eval("d=19n\u2028;") === 19n); -assert(d === 19n); - -assert(eval("d=95n\u2029;") === 95n); -assert(d === 95n); - -assert(eval("d=\u000A5n") === 5n); -assert(d === 5n); - -assert(eval("d=\u000D15n") === 15n); -assert(d === 15n); - -assert(eval("d=\u202819n;") === 19n); -assert(d === 19n); - -assert(eval("d=\u202995n;") === 95n); -assert(d === 95n); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-literals.js b/implementation-contributed/javascriptcore/stress/big-int-literals.js deleted file mode 100644 index 6c48090bec..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-literals.js +++ /dev/null @@ -1,113 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function assertThrowSyntaxError(input) { - try { - eval(input); - assert(false); - } catch (e) { - assert(e instanceof SyntaxError); - } -} - -// Test 0 conversions -let n = 0n; -assert(n === 0n); - -n = 00n; -assert(n === 0n); - -// Binary representation - -n = 0b1111n; -assert(n === 15n); - -n = 0b10n; -assert(n === 2n); - -n = 0b010n; -assert(n === 2n); - -let binaryString = "0b1"; -for (let i = 0; i < 128; i++) - binaryString += "0"; - -n = eval(binaryString + "n"); -assert(n === 340282366920938463463374607431768211456n); - -n = 0B1111n; -assert(n === 15n); - -n = 0B10n; -assert(n === 2n); - -binaryString = "0B1"; -for (let i = 0; i < 128; i++) - binaryString += "0"; - -n = eval(binaryString + "n"); -assert(n === 340282366920938463463374607431768211456n); - -// Octal representation - -n = 0o7n; -assert(n === 7n); - -n = 0o10n; -assert(n === 8n); - -n = 0o20n; -assert(n === 16n); - -n = 0o00020n; -assert(n === 16n); - -n = 0O7n; -assert(n === 7n); - -n = 0O10n; -assert(n === 8n); - -n = 0O20n; -assert(n === 16n); - -n = 0O20n; -assert(n === 16n); - -// Hexadecimal representation - -n = 0xan; -assert(n === 10n); - -n = 0xffn; -assert(n === 255n); - -n = 0x000ffn; -assert(n === 255n); - -n = 0xfabcn; -assert(n === 64188n); - -assertThrowSyntaxError("0b2n"); -assertThrowSyntaxError("0b02n"); -assertThrowSyntaxError("0b1nn"); -assertThrowSyntaxError("0o89n"); -assertThrowSyntaxError("0o08n"); -assertThrowSyntaxError("0o7nn"); -assertThrowSyntaxError("0xgn"); -assertThrowSyntaxError("0x0gn"); -assertThrowSyntaxError("0xfnn"); -assertThrowSyntaxError("100nn"); -assertThrowSyntaxError("1a0nn"); -assertThrowSyntaxError("10E20n"); - -try { - eval("--10n"); - assert(false); -} catch(e) { - assert(e instanceof ReferenceError); -} diff --git a/implementation-contributed/javascriptcore/stress/big-int-mod-jit.js b/implementation-contributed/javascriptcore/stress/big-int-mod-jit.js deleted file mode 100644 index 81c5da7c5b..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-mod-jit.js +++ /dev/null @@ -1,33 +0,0 @@ -//@ runBigIntEnabled - -let assert = { - sameValue: function(i, e, m) { - if (i !== e) - throw new Error(m); - } -} - -function bigIntMod(x, y) { - return x % y; -} -noInline(bigIntMod); - -for (let i = 0; i < 10000; i++) { - let r = bigIntMod(30n, 10n); - assert.sameValue(r, 0n, 30n + " % " + 10n + " = " + r); -} - -function bigIntModFolding(x, y) { - let r = x % y; - return -r; -} -noInline(bigIntModFolding); - -for (let i = 0; i < 10000; i++) { - let r = bigIntModFolding(10, 30); - assert.sameValue(r, -10, "-(" + 10 + " % " + 30 + ") = " + r); -} - -let r = bigIntModFolding(10n, 30n); -assert.sameValue(r, -10n, "-(" + 10n + " % " + 30n + ") = " + r); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-mod-memory-stress.js b/implementation-contributed/javascriptcore/stress/big-int-mod-memory-stress.js deleted file mode 100644 index 9b67d718f7..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-mod-memory-stress.js +++ /dev/null @@ -1,15 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -let a = 0n; -let b = 30n; -for (let i = 0; i < 1000000; i++) { - a = b % 2n; -} - -assert(a === 0n); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-mod-to-primitive-precedence.js b/implementation-contributed/javascriptcore/stress/big-int-mod-to-primitive-precedence.js deleted file mode 100644 index 9a36a62d3b..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-mod-to-primitive-precedence.js +++ /dev/null @@ -1,38 +0,0 @@ -//@ runBigIntEnabled - -assert = { - sameValue: function (input, expected, message) { - if (input !== expected) - throw new Error(message); - } -}; - -function testMod(x, y, z, message) { - assert.sameValue(x % y, z, message); -} - -testMod(Object(33n), 10n, 3n, "ToPrimitive: unbox object with internal slot"); - -let o = { - [Symbol.toPrimitive]: function() { - return 33n; - }, - valueOf: function () { - throw new Error("Should never execute it"); - }, - toString: function () { - throw new Error("Should never execute it"); - } -}; -testMod(o, 10n, 3n, "ToPrimitive: @@toPrimitive"); - -o = { - valueOf: function() { - return 33n; - }, - toString: function () { - throw new Error("Should never execute it"); - } -}; -testMod(o, 10n, 3n, "ToPrimitive: valueOf"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-mod-to-primitive.js b/implementation-contributed/javascriptcore/stress/big-int-mod-to-primitive.js deleted file mode 100644 index 95d36f30eb..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-mod-to-primitive.js +++ /dev/null @@ -1,34 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -assert.sameValue = function (input, expected, message) { - if (input !== expected) - throw new Error(message); -} - -function testMod(x, y, z) { - assert.sameValue(x % y, z, x + " % " + y + " = " + z); -} - -let o = { - [Symbol.toPrimitive]: function () { return 3000n; } -} - -testMod(500000000000438n, o, 2438n); - -o.valueOf = function () { - throw new Error("Should never execute it"); -}; - -testMod(700000000000438n, o, 1438n); - -o.toString = function () { - throw new Error("Should never execute it"); -}; - -testMod(700000000000438n, o, 1438n); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-mod-type-error.js b/implementation-contributed/javascriptcore/stress/big-int-mod-type-error.js deleted file mode 100644 index 75079cc2b3..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-mod-type-error.js +++ /dev/null @@ -1,117 +0,0 @@ -//@ runBigIntEnabled - -function assert(a, message) { - if (!a) - throw new Error(message); -} - -function assertThrowTypeError(a, b, message) { - try { - let n = a % b; - assert(false, message + ": Should throw TypeError, but executed without exception"); - } catch (e) { - assert(e instanceof TypeError, message + ": expected TypeError, got: " + e); - } -} - -assertThrowTypeError(30n, "foo", "BigInt % String"); -assertThrowTypeError("bar", 18757382984821n, "String % BigInt"); -assertThrowTypeError(30n, Symbol("foo"), "BigInt % Symbol"); -assertThrowTypeError(Symbol("bar"), 18757382984821n, "Symbol % BigInt"); -assertThrowTypeError(30n, 3320, "BigInt % Int32"); -assertThrowTypeError(33256, 18757382984821n, "Int32 % BigInt"); -assertThrowTypeError(30n, 0.543, "BigInt % Double"); -assertThrowTypeError(230.19293, 18757382984821n, "Double % BigInt"); -assertThrowTypeError(30n, NaN, "BigInt % NaN"); -assertThrowTypeError(NaN, 18757382984821n, "NaN % BigInt"); -assertThrowTypeError(30n, NaN, "BigInt % NaN"); -assertThrowTypeError(NaN, 18757382984821n, "NaN % BigInt"); -assertThrowTypeError(30n, +Infinity, "BigInt % NaN"); -assertThrowTypeError(+Infinity, 18757382984821n, "NaN % BigInt"); -assertThrowTypeError(30n, -Infinity, "BigInt % -Infinity"); -assertThrowTypeError(-Infinity, 18757382984821n, "-Infinity % BigInt"); -assertThrowTypeError(30n, null, "BigInt % null"); -assertThrowTypeError(null, 18757382984821n, "null % BigInt"); -assertThrowTypeError(30n, undefined, "BigInt % undefined"); -assertThrowTypeError(undefined, 18757382984821n, "undefined % BigInt"); -assertThrowTypeError(30n, true, "BigInt * true"); -assertThrowTypeError(true, 18757382984821n, "true % BigInt"); -assertThrowTypeError(30n, false, "BigInt % false"); -assertThrowTypeError(false, 18757382984821n, "false % BigInt"); - -// Error when returning from object - -let o = { - valueOf: function () { return Symbol("Foo"); } -}; - -assertThrowTypeError(30n, o, "BigInt % Object.valueOf returning Symbol"); -assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Symbol % BigInt"); - -o = { - valueOf: function () { return 33256; } -}; - -assertThrowTypeError(30n, o, "BigInt % Object.valueOf returning Int32"); -assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Int32 % BigInt"); - -o = { - valueOf: function () { return 0.453; } -}; - -assertThrowTypeError(30n, o, "BigInt % Object.valueOf returning Double"); -assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Double % BigInt"); - -o = { - toString: function () { return Symbol("Foo"); } -}; - -assertThrowTypeError(30n, o, "BigInt % Object.toString returning Symbol"); -assertThrowTypeError(o, 18757382984821n, "Object.toString returning Symbol % BigInt"); - -o = { - toString: function () { return 33256; } -}; - -assertThrowTypeError(30n, o, "BigInt % Object.toString returning Int32"); -assertThrowTypeError(o, 18757382984821n, "Object.toString returning Int32 % BigInt"); - -o = { - toString: function () { return 0.453; } -}; - -assertThrowTypeError(30n, o, "BigInt % Object.toString returning Double"); -assertThrowTypeError(o, 18757382984821n, "Object.toString returning Double % BigInt"); - -o = { - [Symbol.toPrimitive]: function () { return Symbol("Foo"); } -}; - -assertThrowTypeError(30n, o, "BigInt % Object.@@toPrimitive returning Symbol"); -assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Symbol % BigInt"); - -o = { - [Symbol.toPrimitive]: function () { return 33256; } -}; - -assertThrowTypeError(30n, o, "BigInt % Object.@@toPrimitive returning Int32"); -assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Int32 % BigInt"); - -o = { - [Symbol.toPrimitive]: function () { return 0.453; } -}; - -assertThrowTypeError(30n, o, "BigInt % Object.@@toPrimitive returning Double"); -assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Double % BigInt"); - -o = { - [Symbol.toPrimitive]: function () { throw new Error("Bad"); } -}; - -assertThrowTypeError(Symbol("30"), o, "Symbol % object should result in TypeError"); -try { - o % Symbol("30"); -} catch (e) { - assert(e.message === "Bad", "Erro message expected is 'Bad'"); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-mod-wrapped-value.js b/implementation-contributed/javascriptcore/stress/big-int-mod-wrapped-value.js deleted file mode 100644 index 849194ba08..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-mod-wrapped-value.js +++ /dev/null @@ -1,36 +0,0 @@ -//@ runBigIntEnabled - -assert = { - sameValue: function (input, expected, message) { - if (input !== expected) - throw new Error(message); - } -}; - -function testDiv(x, y, z, message) { - assert.sameValue(x % y, z, message); -} - -testDiv(Object(33n), 10n, 3n, "ToPrimitive: unbox object with internal slot"); - -let o = { - [Symbol.toPrimitive]: function() { - return 33n; - } -}; -testDiv(o, 10n, 3n, "ToPrimitive: @@toPrimitive"); - -o = { - valueOf: function() { - return 33n; - } -}; -testDiv(o, 10n, 3n, "ToPrimitive: valueOf"); - -o = { - toString: function() { - return 33n; - } -} -testDiv(o, 10n, 3n, "ToPrimitive: toString"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-mod.js b/implementation-contributed/javascriptcore/stress/big-int-mod.js deleted file mode 100644 index fc9c72468c..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-mod.js +++ /dev/null @@ -1,276 +0,0 @@ -//@ runBigIntEnabled - -// Copyright (C) 2017 Robin Templeton. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -assert.sameValue = function (input, expected, message) { - if (input !== expected) - throw new Error(message); -} - -function testMod(x, y, z) { - assert.sameValue(x % y, z, x + " % " + y + " = " + z); -} - -testMod(0xFEDCBA9876543210n, 0xFEDCBA9876543210n, 0x0n); -testMod(0xFEDCBA9876543210n, 0xFEDCBA987654320Fn, 0x1n); -testMod(0xFEDCBA9876543210n, 0xFEDCBA98n, 0x76543210n); -testMod(0xFEDCBA9876543210n, 0xFEDCBA97n, 0x77777779n); -testMod(0xFEDCBA9876543210n, 0x1234n, 0x960n); -testMod(0xFEDCBA9876543210n, 0x3n, 0x0n); -testMod(0xFEDCBA9876543210n, 0x2n, 0x0n); -testMod(0xFEDCBA9876543210n, 0x1n, 0x0n); -testMod(0xFEDCBA9876543210n, BigInt("-1"), 0x0n); -testMod(0xFEDCBA9876543210n, BigInt("-2"), 0x0n); -testMod(0xFEDCBA9876543210n, BigInt("-3"), 0x0n); -testMod(0xFEDCBA9876543210n, BigInt("-4660"), 0x960n); -testMod(0xFEDCBA9876543210n, BigInt("-4275878551"), 0x77777779n); -testMod(0xFEDCBA9876543210n, BigInt("-4275878552"), 0x76543210n); -testMod(0xFEDCBA9876543210n, BigInt("-18364758544493064719"), 0x1n); -testMod(0xFEDCBA987654320Fn, 0xFEDCBA9876543210n, 0xFEDCBA987654320Fn); -testMod(0xFEDCBA987654320Fn, 0xFEDCBA987654320Fn, 0x0n); -testMod(0xFEDCBA987654320Fn, 0xFEDCBA98n, 0x7654320Fn); -testMod(0xFEDCBA987654320Fn, 0xFEDCBA97n, 0x77777778n); -testMod(0xFEDCBA987654320Fn, 0x1234n, 0x95Fn); -testMod(0xFEDCBA987654320Fn, 0x3n, 0x2n); -testMod(0xFEDCBA987654320Fn, 0x2n, 0x1n); -testMod(0xFEDCBA987654320Fn, 0x1n, 0x0n); -testMod(0xFEDCBA987654320Fn, BigInt("-1"), 0x0n); -testMod(0xFEDCBA987654320Fn, BigInt("-3"), 0x2n); -testMod(0xFEDCBA987654320Fn, BigInt("-4660"), 0x95Fn); -testMod(0xFEDCBA987654320Fn, BigInt("-4275878551"), 0x77777778n); -testMod(0xFEDCBA987654320Fn, BigInt("-18364758544493064720"), 0xFEDCBA987654320Fn); -testMod(0xFEDCBA98n, 0xFEDCBA9876543210n, 0xFEDCBA98n); -testMod(0xFEDCBA98n, 0xFEDCBA987654320Fn, 0xFEDCBA98n); -testMod(0xFEDCBA98n, 0xFEDCBA98n, 0x0n); -testMod(0xFEDCBA98n, 0xFEDCBA97n, 0x1n); -testMod(0xFEDCBA98n, 0x1234n, 0x930n); -testMod(0xFEDCBA98n, 0x3n, 0x2n); -testMod(0xFEDCBA98n, 0x2n, 0x0n); -testMod(0xFEDCBA98n, 0x1n, 0x0n); -testMod(0xFEDCBA98n, BigInt("-1"), 0x0n); -testMod(0xFEDCBA98n, BigInt("-2"), 0x0n); -testMod(0xFEDCBA98n, BigInt("-3"), 0x2n); -testMod(0xFEDCBA98n, BigInt("-4660"), 0x930n); -testMod(0xFEDCBA98n, BigInt("-4275878551"), 0x1n); -testMod(0xFEDCBA98n, BigInt("-4275878552"), 0x0n); -testMod(0xFEDCBA98n, BigInt("-18364758544493064719"), 0xFEDCBA98n); -testMod(0xFEDCBA98n, BigInt("-18364758544493064720"), 0xFEDCBA98n); -testMod(0xFEDCBA97n, 0xFEDCBA9876543210n, 0xFEDCBA97n); -testMod(0xFEDCBA97n, 0xFEDCBA987654320Fn, 0xFEDCBA97n); -testMod(0xFEDCBA97n, 0xFEDCBA98n, 0xFEDCBA97n); -testMod(0xFEDCBA97n, 0xFEDCBA97n, 0x0n); -testMod(0xFEDCBA97n, 0x1234n, 0x92Fn); -testMod(0xFEDCBA97n, 0x3n, 0x1n); -testMod(0xFEDCBA97n, 0x2n, 0x1n); -testMod(0xFEDCBA97n, 0x1n, 0x0n); -testMod(0xFEDCBA97n, BigInt("-1"), 0x0n); -testMod(0xFEDCBA97n, BigInt("-2"), 0x1n); -testMod(0xFEDCBA97n, BigInt("-3"), 0x1n); -testMod(0xFEDCBA97n, BigInt("-4660"), 0x92Fn); -testMod(0xFEDCBA97n, BigInt("-4275878551"), 0x0n); -testMod(0xFEDCBA97n, BigInt("-4275878552"), 0xFEDCBA97n); -testMod(0xFEDCBA97n, BigInt("-18364758544493064719"), 0xFEDCBA97n); -testMod(0xFEDCBA97n, BigInt("-18364758544493064720"), 0xFEDCBA97n); -testMod(0x1234n, 0xFEDCBA9876543210n, 0x1234n); -testMod(0x1234n, 0xFEDCBA987654320Fn, 0x1234n); -testMod(0x1234n, 0xFEDCBA98n, 0x1234n); -testMod(0x1234n, 0xFEDCBA97n, 0x1234n); -testMod(0x1234n, 0x1234n, 0x0n); -testMod(0x1234n, 0x3n, 0x1n); -testMod(0x1234n, 0x2n, 0x0n); -testMod(0x1234n, 0x1n, 0x0n); -testMod(0x1234n, BigInt("-1"), 0x0n); -testMod(0x1234n, BigInt("-2"), 0x0n); -testMod(0x1234n, BigInt("-3"), 0x1n); -testMod(0x1234n, BigInt("-4660"), 0x0n); -testMod(0x1234n, BigInt("-4275878551"), 0x1234n); -testMod(0x1234n, BigInt("-4275878552"), 0x1234n); -testMod(0x1234n, BigInt("-18364758544493064719"), 0x1234n); -testMod(0x1234n, BigInt("-18364758544493064720"), 0x1234n); -testMod(0x3n, 0xFEDCBA9876543210n, 0x3n); -testMod(0x3n, 0xFEDCBA987654320Fn, 0x3n); -testMod(0x3n, 0xFEDCBA98n, 0x3n); -testMod(0x3n, 0xFEDCBA97n, 0x3n); -testMod(0x3n, 0x1234n, 0x3n); -testMod(0x3n, 0x3n, 0x0n); -testMod(0x3n, 0x2n, 0x1n); -testMod(0x3n, 0x1n, 0x0n); -testMod(0x3n, BigInt("-1"), 0x0n); -testMod(0x3n, BigInt("-2"), 0x1n); -testMod(0x3n, BigInt("-3"), 0x0n); -testMod(0x3n, BigInt("-4660"), 0x3n); -testMod(0x3n, BigInt("-4275878551"), 0x3n); -testMod(0x3n, BigInt("-4275878552"), 0x3n); -testMod(0x3n, BigInt("-18364758544493064719"), 0x3n); -testMod(0x3n, BigInt("-18364758544493064720"), 0x3n); -testMod(0x2n, 0xFEDCBA9876543210n, 0x2n); -testMod(0x2n, 0xFEDCBA987654320Fn, 0x2n); -testMod(0x2n, 0xFEDCBA98n, 0x2n); -testMod(0x2n, 0xFEDCBA97n, 0x2n); -testMod(0x2n, 0x1234n, 0x2n); -testMod(0x2n, 0x3n, 0x2n); -testMod(0x2n, 0x2n, 0x0n); -testMod(0x2n, 0x1n, 0x0n); -testMod(0x2n, BigInt("-1"), 0x0n); -testMod(0x2n, BigInt("-2"), 0x0n); -testMod(0x2n, BigInt("-3"), 0x2n); -testMod(0x2n, BigInt("-4660"), 0x2n); -testMod(0x2n, BigInt("-4275878551"), 0x2n); -testMod(0x2n, BigInt("-4275878552"), 0x2n); -testMod(0x2n, BigInt("-18364758544493064719"), 0x2n); -testMod(0x2n, BigInt("-18364758544493064720"), 0x2n); -testMod(0x1n, 0xFEDCBA9876543210n, 0x1n); -testMod(0x1n, 0xFEDCBA987654320Fn, 0x1n); -testMod(0x1n, 0xFEDCBA98n, 0x1n); -testMod(0x1n, 0xFEDCBA97n, 0x1n); -testMod(0x1n, 0x1234n, 0x1n); -testMod(0x1n, 0x3n, 0x1n); -testMod(0x1n, 0x2n, 0x1n); -testMod(0x1n, 0x1n, 0x0n); -testMod(0x1n, BigInt("-1"), 0x0n); -testMod(0x1n, BigInt("-2"), 0x1n); -testMod(0x1n, BigInt("-3"), 0x1n); -testMod(0x1n, BigInt("-4660"), 0x1n); -testMod(0x1n, BigInt("-4275878551"), 0x1n); -testMod(0x1n, BigInt("-4275878552"), 0x1n); -testMod(0x1n, BigInt("-18364758544493064719"), 0x1n); -testMod(0x1n, BigInt("-18364758544493064720"), 0x1n); -testMod(BigInt("-1"), 0xFEDCBA9876543210n, BigInt("-1")); -testMod(BigInt("-1"), 0xFEDCBA987654320Fn, BigInt("-1")); -testMod(BigInt("-1"), 0xFEDCBA98n, BigInt("-1")); -testMod(BigInt("-1"), 0xFEDCBA97n, BigInt("-1")); -testMod(BigInt("-1"), 0x1234n, BigInt("-1")); -testMod(BigInt("-1"), 0x3n, BigInt("-1")); -testMod(BigInt("-1"), 0x2n, BigInt("-1")); -testMod(BigInt("-1"), 0x1n, 0x0n); -testMod(BigInt("-1"), BigInt("-1"), 0x0n); -testMod(BigInt("-1"), BigInt("-2"), BigInt("-1")); -testMod(BigInt("-1"), BigInt("-3"), BigInt("-1")); -testMod(BigInt("-1"), BigInt("-4660"), BigInt("-1")); -testMod(BigInt("-1"), BigInt("-4275878551"), BigInt("-1")); -testMod(BigInt("-1"), BigInt("-4275878552"), BigInt("-1")); -testMod(BigInt("-1"), BigInt("-18364758544493064719"), BigInt("-1")); -testMod(BigInt("-1"), BigInt("-18364758544493064720"), BigInt("-1")); -testMod(BigInt("-2"), 0xFEDCBA9876543210n, BigInt("-2")); -testMod(BigInt("-2"), 0xFEDCBA987654320Fn, BigInt("-2")); -testMod(BigInt("-2"), 0xFEDCBA98n, BigInt("-2")); -testMod(BigInt("-2"), 0xFEDCBA97n, BigInt("-2")); -testMod(BigInt("-2"), 0x1234n, BigInt("-2")); -testMod(BigInt("-2"), 0x3n, BigInt("-2")); -testMod(BigInt("-2"), 0x2n, 0x0n); -testMod(BigInt("-2"), 0x1n, 0x0n); -testMod(BigInt("-2"), BigInt("-1"), 0x0n); -testMod(BigInt("-2"), BigInt("-2"), 0x0n); -testMod(BigInt("-2"), BigInt("-3"), BigInt("-2")); -testMod(BigInt("-2"), BigInt("-4660"), BigInt("-2")); -testMod(BigInt("-2"), BigInt("-4275878551"), BigInt("-2")); -testMod(BigInt("-2"), BigInt("-4275878552"), BigInt("-2")); -testMod(BigInt("-2"), BigInt("-18364758544493064719"), BigInt("-2")); -testMod(BigInt("-2"), BigInt("-18364758544493064720"), BigInt("-2")); -testMod(BigInt("-3"), 0xFEDCBA9876543210n, BigInt("-3")); -testMod(BigInt("-3"), 0xFEDCBA987654320Fn, BigInt("-3")); -testMod(BigInt("-3"), 0xFEDCBA98n, BigInt("-3")); -testMod(BigInt("-3"), 0xFEDCBA97n, BigInt("-3")); -testMod(BigInt("-3"), 0x1234n, BigInt("-3")); -testMod(BigInt("-3"), 0x3n, 0x0n); -testMod(BigInt("-3"), 0x2n, BigInt("-1")); -testMod(BigInt("-3"), 0x1n, 0x0n); -testMod(BigInt("-3"), BigInt("-1"), 0x0n); -testMod(BigInt("-3"), BigInt("-2"), BigInt("-1")); -testMod(BigInt("-3"), BigInt("-3"), 0x0n); -testMod(BigInt("-3"), BigInt("-4660"), BigInt("-3")); -testMod(BigInt("-3"), BigInt("-4275878551"), BigInt("-3")); -testMod(BigInt("-3"), BigInt("-4275878552"), BigInt("-3")); -testMod(BigInt("-3"), BigInt("-18364758544493064719"), BigInt("-3")); -testMod(BigInt("-3"), BigInt("-18364758544493064720"), BigInt("-3")); -testMod(BigInt("-4660"), 0xFEDCBA9876543210n, BigInt("-4660")); -testMod(BigInt("-4660"), 0xFEDCBA987654320Fn, BigInt("-4660")); -testMod(BigInt("-4660"), 0xFEDCBA98n, BigInt("-4660")); -testMod(BigInt("-4660"), 0xFEDCBA97n, BigInt("-4660")); -testMod(BigInt("-4660"), 0x1234n, 0x0n); -testMod(BigInt("-4660"), 0x3n, BigInt("-1")); -testMod(BigInt("-4660"), 0x2n, 0x0n); -testMod(BigInt("-4660"), 0x1n, 0x0n); -testMod(BigInt("-4660"), BigInt("-1"), 0x0n); -testMod(BigInt("-4660"), BigInt("-2"), 0x0n); -testMod(BigInt("-4660"), BigInt("-3"), BigInt("-1")); -testMod(BigInt("-4660"), BigInt("-4660"), 0x0n); -testMod(BigInt("-4660"), BigInt("-4275878551"), BigInt("-4660")); -testMod(BigInt("-4660"), BigInt("-4275878552"), BigInt("-4660")); -testMod(BigInt("-4660"), BigInt("-18364758544493064719"), BigInt("-4660")); -testMod(BigInt("-4660"), BigInt("-18364758544493064720"), BigInt("-4660")); -testMod(BigInt("-4275878551"), 0xFEDCBA9876543210n, BigInt("-4275878551")); -testMod(BigInt("-4275878551"), 0xFEDCBA987654320Fn, BigInt("-4275878551")); -testMod(BigInt("-4275878551"), 0xFEDCBA98n, BigInt("-4275878551")); -testMod(BigInt("-4275878551"), 0xFEDCBA97n, 0x0n); -testMod(BigInt("-4275878551"), 0x1234n, BigInt("-2351")); -testMod(BigInt("-4275878551"), 0x3n, BigInt("-1")); -testMod(BigInt("-4275878551"), 0x2n, BigInt("-1")); -testMod(BigInt("-4275878551"), 0x1n, 0x0n); -testMod(BigInt("-4275878551"), BigInt("-1"), 0x0n); -testMod(BigInt("-4275878551"), BigInt("-2"), BigInt("-1")); -testMod(BigInt("-4275878551"), BigInt("-3"), BigInt("-1")); -testMod(BigInt("-4275878551"), BigInt("-4660"), BigInt("-2351")); -testMod(BigInt("-4275878551"), BigInt("-4275878551"), 0x0n); -testMod(BigInt("-4275878551"), BigInt("-4275878552"), BigInt("-4275878551")); -testMod(BigInt("-4275878551"), BigInt("-18364758544493064719"), BigInt("-4275878551")); -testMod(BigInt("-4275878551"), BigInt("-18364758544493064720"), BigInt("-4275878551")); -testMod(BigInt("-4275878552"), 0xFEDCBA9876543210n, BigInt("-4275878552")); -testMod(BigInt("-4275878552"), 0xFEDCBA987654320Fn, BigInt("-4275878552")); -testMod(BigInt("-4275878552"), 0xFEDCBA98n, 0x0n); -testMod(BigInt("-4275878552"), 0xFEDCBA97n, BigInt("-1")); -testMod(BigInt("-4275878552"), 0x1234n, BigInt("-2352")); -testMod(BigInt("-4275878552"), 0x3n, BigInt("-2")); -testMod(BigInt("-4275878552"), 0x2n, 0x0n); -testMod(BigInt("-4275878552"), 0x1n, 0x0n); -testMod(BigInt("-4275878552"), BigInt("-1"), 0x0n); -testMod(BigInt("-4275878552"), BigInt("-2"), 0x0n); -testMod(BigInt("-4275878552"), BigInt("-3"), BigInt("-2")); -testMod(BigInt("-4275878552"), BigInt("-4660"), BigInt("-2352")); -testMod(BigInt("-4275878552"), BigInt("-4275878551"), BigInt("-1")); -testMod(BigInt("-4275878552"), BigInt("-4275878552"), 0x0n); -testMod(BigInt("-4275878552"), BigInt("-18364758544493064719"), BigInt("-4275878552")); -testMod(BigInt("-4275878552"), BigInt("-18364758544493064720"), BigInt("-4275878552")); -testMod(BigInt("-18364758544493064719"), 0xFEDCBA9876543210n, BigInt("-18364758544493064719")); -testMod(BigInt("-18364758544493064719"), 0xFEDCBA987654320Fn, 0x0n); -testMod(BigInt("-18364758544493064719"), 0xFEDCBA97n, BigInt("-2004318072")); -testMod(BigInt("-18364758544493064719"), 0x1234n, BigInt("-2399")); -testMod(BigInt("-18364758544493064719"), 0x3n, BigInt("-2")); -testMod(BigInt("-18364758544493064719"), 0x2n, BigInt("-1")); -testMod(BigInt("-18364758544493064719"), 0x1n, 0x0n); -testMod(BigInt("-18364758544493064719"), BigInt("-1"), 0x0n); -testMod(BigInt("-18364758544493064719"), BigInt("-2"), BigInt("-1")); -testMod(BigInt("-18364758544493064719"), BigInt("-3"), BigInt("-2")); -testMod(BigInt("-18364758544493064719"), BigInt("-4660"), BigInt("-2399")); -testMod(BigInt("-18364758544493064719"), BigInt("-4275878551"), BigInt("-2004318072")); -testMod(BigInt("-18364758544493064719"), BigInt("-4275878552"), BigInt("-1985229327")); -testMod(BigInt("-18364758544493064719"), BigInt("-18364758544493064719"), 0x0n); -testMod(BigInt("-18364758544493064719"), BigInt("-18364758544493064720"), BigInt("-18364758544493064719")); -testMod(BigInt("-18364758544493064720"), 0xFEDCBA9876543210n, 0x0n); -testMod(BigInt("-18364758544493064720"), 0xFEDCBA987654320Fn, BigInt("-1")); -testMod(BigInt("-18364758544493064720"), 0xFEDCBA98n, BigInt("-1985229328")); -testMod(BigInt("-18364758544493064720"), 0xFEDCBA97n, BigInt("-2004318073")); -testMod(BigInt("-18364758544493064720"), 0x1234n, BigInt("-2400")); -testMod(BigInt("-18364758544493064720"), 0x3n, 0x0n); -testMod(BigInt("-18364758544493064720"), 0x2n, 0x0n); -testMod(BigInt("-18364758544493064720"), 0x1n, 0x0n); -testMod(BigInt("-18364758544493064720"), BigInt("-1"), 0x0n); -testMod(BigInt("-18364758544493064720"), BigInt("-2"), 0x0n); -testMod(BigInt("-18364758544493064720"), BigInt("-3"), 0x0n); -testMod(BigInt("-18364758544493064720"), BigInt("-4660"), BigInt("-2400")); -testMod(BigInt("-18364758544493064720"), BigInt("-4275878551"), BigInt("-2004318073")); -testMod(BigInt("-18364758544493064720"), BigInt("-4275878552"), BigInt("-1985229328")); -testMod(BigInt("-18364758544493064720"), BigInt("-18364758544493064719"), BigInt("-1")); -testMod(BigInt("-18364758544493064720"), BigInt("-18364758544493064720"), 0x0n); - -// Test rightTrim when result is zero, but m_length and m_sign are not canonical -testMod(340282366920938463463374607431768211456n, 340282366920938463463374607431768211456n, 0n); -testMod(BigInt("-340282366920938463463374607431768211456"), 340282366920938463463374607431768211456n, 0n); -testMod(340282366920938463463374607431768211456n, BigInt("-340282366920938463463374607431768211456"), 0n); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-mul-jit.js b/implementation-contributed/javascriptcore/stress/big-int-mul-jit.js deleted file mode 100644 index 0cbede3187..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-mul-jit.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runBigIntEnabled - -let assert = { - sameValue: function(i, e, m) { - if (i !== e) - throw new Error(m); - } -} - -function bigIntMul(x, y) { - return x * y; -} -noInline(bigIntMul); - -for (let i = 0; i < 10000; i++) { - let r = bigIntMul(3n, 10n); - assert.sameValue(r, 30n, 3n + " * " + 10n + " = " + r); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-mul-to-primitive-precedence.js b/implementation-contributed/javascriptcore/stress/big-int-mul-to-primitive-precedence.js deleted file mode 100644 index 7149a19687..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-mul-to-primitive-precedence.js +++ /dev/null @@ -1,39 +0,0 @@ -//@ runBigIntEnabled - -assert = { - sameValue: function (input, expected, message) { - if (input !== expected) - throw new Error(message); - } -}; - -function testMul(x, y, z, message) { - assert.sameValue(x * y, z, message); - assert.sameValue(y * x, z, message); -} - -testMul(Object(2n), 1n, 2n, "ToPrimitive: unbox object with internal slot"); - -let o = { - [Symbol.toPrimitive]: function() { - return 2n; - }, - valueOf: function () { - throw new Error("Should never execute it"); - }, - toString: function () { - throw new Error("Should never execute it"); - } -}; -testMul(o, 1n, 2n, "ToPrimitive: @@toPrimitive"); - -o = { - valueOf: function() { - return 2n; - }, - toString: function () { - throw new Error("Should never execute it"); - } -}; -testMul(o, 1n, 2n, "ToPrimitive: valueOf"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-mul-to-primitive.js b/implementation-contributed/javascriptcore/stress/big-int-mul-to-primitive.js deleted file mode 100644 index 642e2e8e29..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-mul-to-primitive.js +++ /dev/null @@ -1,35 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -assert.sameValue = function (input, expected, message) { - if (input !== expected) - throw new Error(message); -} - -function testMul(x, y, z) { - assert.sameValue(x * y, z, x + " * " + y + " = " + z); - assert.sameValue(y * x, z, y + " * " + x + " = " + z); -} - -let o = { - [Symbol.toPrimitive]: function () { return 300000000000000n; } -} - -testMul(500000000000438n, o, 150000000000131400000000000000n); - -o.valueOf = function () { - throw new Error("Should never execute it"); -}; - -testMul(700000000000438n, o, 210000000000131400000000000000n); - -o.toString = function () { - throw new Error("Should never execute it"); -}; - -testMul(700000000000438n, o, 210000000000131400000000000000n); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-mul-type-error.js b/implementation-contributed/javascriptcore/stress/big-int-mul-type-error.js deleted file mode 100644 index b5178457fb..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-mul-type-error.js +++ /dev/null @@ -1,106 +0,0 @@ -//@ runBigIntEnabled - -function assert(a, message) { - if (!a) - throw new Error(message); -} - -function assertThrowTypeError(a, b, message) { - try { - let n = a * b; - assert(false, message + ": Should throw TypeError, but executed without exception"); - } catch (e) { - assert(e instanceof TypeError, message + ": expected TypeError, got: " + e); - } -} - -assertThrowTypeError(30n, "foo", "BigInt * String"); -assertThrowTypeError("bar", 18757382984821n, "String * BigInt"); -assertThrowTypeError(30n, Symbol("foo"), "BigInt * Symbol"); -assertThrowTypeError(Symbol("bar"), 18757382984821n, "Symbol * BigInt"); -assertThrowTypeError(30n, 3320, "BigInt * Int32"); -assertThrowTypeError(33256, 18757382984821n, "Int32 * BigInt"); -assertThrowTypeError(30n, 0.543, "BigInt * Double"); -assertThrowTypeError(230.19293, 18757382984821n, "Double * BigInt"); -assertThrowTypeError(30n, NaN, "BigInt * NaN"); -assertThrowTypeError(NaN, 18757382984821n, "NaN * BigInt"); -assertThrowTypeError(30n, NaN, "BigInt * NaN"); -assertThrowTypeError(NaN, 18757382984821n, "NaN * BigInt"); -assertThrowTypeError(30n, +Infinity, "BigInt * NaN"); -assertThrowTypeError(+Infinity, 18757382984821n, "NaN * BigInt"); -assertThrowTypeError(30n, -Infinity, "BigInt * -Infinity"); -assertThrowTypeError(-Infinity, 18757382984821n, "-Infinity * BigInt"); -assertThrowTypeError(30n, null, "BigInt * null"); -assertThrowTypeError(null, 18757382984821n, "null * BigInt"); -assertThrowTypeError(30n, undefined, "BigInt * undefined"); -assertThrowTypeError(undefined, 18757382984821n, "undefined * BigInt"); -assertThrowTypeError(30n, true, "BigInt * true"); -assertThrowTypeError(true, 18757382984821n, "true * BigInt"); -assertThrowTypeError(30n, false, "BigInt * false"); -assertThrowTypeError(false, 18757382984821n, "false * BigInt"); - -// Error when returning from object - -let o = { - valueOf: function () { return Symbol("Foo"); } -}; - -assertThrowTypeError(30n, o, "BigInt * Object.valueOf returning Symbol"); -assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Symbol * BigInt"); - -o = { - valueOf: function () { return 33256; } -}; - -assertThrowTypeError(30n, o, "BigInt * Object.valueOf returning Int32"); -assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Int32 * BigInt"); - -o = { - valueOf: function () { return 0.453; } -}; - -assertThrowTypeError(30n, o, "BigInt * Object.valueOf returning Double"); -assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Double * BigInt"); - -o = { - toString: function () { return Symbol("Foo"); } -}; - -assertThrowTypeError(30n, o, "BigInt * Object.toString returning Symbol"); -assertThrowTypeError(o, 18757382984821n, "Object.toString returning Symbol * BigInt"); - -o = { - toString: function () { return 33256; } -}; - -assertThrowTypeError(30n, o, "BigInt * Object.toString returning Int32"); -assertThrowTypeError(o, 18757382984821n, "Object.toString returning Int32 * BigInt"); - -o = { - toString: function () { return 0.453; } -}; - -assertThrowTypeError(30n, o, "BigInt * Object.toString returning Double"); -assertThrowTypeError(o, 18757382984821n, "Object.toString returning Double * BigInt"); - -o = { - [Symbol.toPrimitive]: function () { return Symbol("Foo"); } -}; - -assertThrowTypeError(30n, o, "BigInt * Object.@@toPrimitive returning Symbol"); -assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Symbol * BigInt"); - -o = { - [Symbol.toPrimitive]: function () { return 33256; } -}; - -assertThrowTypeError(30n, o, "BigInt * Object.@@toPrimitive returning Int32"); -assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Int32 * BigInt"); - -o = { - [Symbol.toPrimitive]: function () { return 0.453; } -}; - -assertThrowTypeError(30n, o, "BigInt * Object.@@toPrimitive returning Double"); -assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Double * BigInt"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-mul-wrapped-value.js b/implementation-contributed/javascriptcore/stress/big-int-mul-wrapped-value.js deleted file mode 100644 index b673d8a603..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-mul-wrapped-value.js +++ /dev/null @@ -1,37 +0,0 @@ -//@ runBigIntEnabled - -assert = { - sameValue: function (input, expected, message) { - if (input !== expected) - throw new Error(message); - } -}; - -function testMul(x, y, z, message) { - assert.sameValue(x * y, z, message); - assert.sameValue(y * x, z, message); -} - -testMul(Object(2n), 1n, 2n, "ToPrimitive: unbox object with internal slot"); - -let o = { - [Symbol.toPrimitive]: function() { - return 2n; - } -}; -testMul(o, 1n, 2n, "ToPrimitive: @@toPrimitive"); - -o = { - valueOf: function() { - return 2n; - } -}; -testMul(o, 1n, 2n, "ToPrimitive: valueOf"); - -o = { - toString: function() { - return 2n; - } -} -testMul(o, 1n, 2n, "ToPrimitive: toString"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-multiplication.js b/implementation-contributed/javascriptcore/stress/big-int-multiplication.js deleted file mode 100644 index 3ecd636d7f..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-multiplication.js +++ /dev/null @@ -1,83 +0,0 @@ -//@ runBigIntEnabled - -// Copyright (C) 2017 Robin Templeton. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -assert = { - sameValue: function (input, expected, message) { - if (input !== expected) - throw new Error(message); - } -}; - -function testMul(x, y, z) { - assert.sameValue(x * y, z, x + " * " + y + " = " + z); - assert.sameValue(y * x, z, y + " * " + x + " = " + z); -} - -testMul(0xFEDCBA9876543210n, 0xFEDCBA9876543210n, 0xFDBAC097C8DC5ACCDEEC6CD7A44A4100n); -testMul(0xFEDCBA9876543210n, 0xFEDCBA98n, 0xFDBAC097530ECA86541D5980n); -testMul(0xFEDCBA9876543210n, 0x1234n, 0x121F49F49F49F49F4B40n); -testMul(0xFEDCBA9876543210n, 0x3n, 0x2FC962FC962FC9630n); -testMul(0xFEDCBA9876543210n, 0x2n, 0x1FDB97530ECA86420n); -testMul(0xFEDCBA9876543210n, 0x1n, 0xFEDCBA9876543210n); -testMul(0xFEDCBA9876543210n, 0x0n, 0x0n); -testMul(0xFEDCBA9876543210n, BigInt("-1"), BigInt("-18364758544493064720")); -testMul(0xFEDCBA9876543210n, BigInt("-2"), BigInt("-36729517088986129440")); -testMul(0xFEDCBA9876543210n, BigInt("-3"), BigInt("-55094275633479194160")); -testMul(0xFEDCBA9876543210n, BigInt("-4660"), BigInt("-85579774817337681595200")); -testMul(0xFEDCBA9876543210n, BigInt("-4275878551"), BigInt("-78525477154691874604502820720")); -testMul(0xFEDCBA987654320Fn, 0xFEDCBA987654320Fn, 0xFDBAC097C8DC5ACAE132F7A6B7A1DCE1n); -testMul(0xFEDCBA987654320Fn, 0xFEDCBA97n, 0xFDBAC09654320FECDEEC6CD9n); -testMul(0xFEDCBA987654320Fn, 0x3n, 0x2FC962FC962FC962Dn); -testMul(0xFEDCBA987654320Fn, 0x2n, 0x1FDB97530ECA8641En); -testMul(0xFEDCBA987654320Fn, 0x1n, 0xFEDCBA987654320Fn); -testMul(0xFEDCBA987654320Fn, 0x0n, 0x0n); -testMul(0xFEDCBA987654320Fn, BigInt("-1"), BigInt("-18364758544493064719")); -testMul(0xFEDCBA987654320Fn, BigInt("-2"), BigInt("-36729517088986129438")); -testMul(0xFEDCBA987654320Fn, BigInt("-3"), BigInt("-55094275633479194157")); -testMul(0xFEDCBA987654320Fn, BigInt("-4275878551"), BigInt("-78525477154691874600226942169")); -testMul(0xFEDCBA987654320Fn, BigInt("-18364758544493064720"), BigInt("-337264356397531028976608289633615613680")); -testMul(0xFEDCBA98n, 0xFEDCBA98n, 0xFDBAC096DD413A40n); -testMul(0xFEDCBA98n, 0x1234n, 0x121F49F496E0n); -testMul(0xFEDCBA98n, 0x3n, 0x2FC962FC8n); -testMul(0xFEDCBA98n, 0x2n, 0x1FDB97530n); -testMul(0xFEDCBA98n, 0x1n, 0xFEDCBA98n); -testMul(0xFEDCBA98n, 0x0n, 0x0n); -testMul(0xFEDCBA98n, BigInt("-1"), BigInt("-4275878552")); -testMul(0xFEDCBA98n, BigInt("-2"), BigInt("-8551757104")); -testMul(0xFEDCBA98n, BigInt("-3"), BigInt("-12827635656")); -testMul(0xFEDCBA98n, BigInt("-4275878551"), BigInt("-18283137387177738152")); -testMul(0xFEDCBA98n, BigInt("-18364758544493064720"), BigInt("-78525477173056633148995885440")); -testMul(0x3n, 0x3n, 0x9n); -testMul(0x3n, 0x2n, 0x6n); -testMul(0x3n, 0x1n, 0x3n); -testMul(0x3n, 0x0n, 0x0n); -testMul(0x3n, BigInt("-1"), BigInt("-3")); -testMul(0x3n, BigInt("-2"), BigInt("-6")); -testMul(0x3n, BigInt("-3"), BigInt("-9")); -testMul(0x3n, BigInt("-4660"), BigInt("-13980")); -testMul(0x3n, BigInt("-4275878552"), BigInt("-12827635656")); -testMul(0x3n, BigInt("-18364758544493064720"), BigInt("-55094275633479194160")); -testMul(0x0n, 0x0n, 0x0n); -testMul(0x0n, BigInt("-1"), 0x0n); -testMul(0x0n, BigInt("-2"), 0x0n); -testMul(0x0n, BigInt("-3"), 0x0n); -testMul(0x0n, BigInt("-4275878551"), 0x0n); -testMul(0x0n, BigInt("-18364758544493064719"), 0x0n); -testMul(BigInt("-1"), BigInt("-1"), 0x1n); -testMul(BigInt("-1"), BigInt("-2"), 0x2n); -testMul(BigInt("-1"), BigInt("-3"), 0x3n); -testMul(BigInt("-1"), BigInt("-4660"), 0x1234n); -testMul(BigInt("-1"), BigInt("-4275878551"), 0xFEDCBA97n); -testMul(BigInt("-1"), BigInt("-4275878552"), 0xFEDCBA98n); -testMul(BigInt("-1"), BigInt("-18364758544493064719"), 0xFEDCBA987654320Fn); -testMul(BigInt("-1"), BigInt("-18364758544493064720"), 0xFEDCBA9876543210n); -testMul(BigInt("-3"), BigInt("-3"), 0x9n); -testMul(BigInt("-3"), BigInt("-4660"), 0x369Cn); -testMul(BigInt("-3"), BigInt("-4275878551"), 0x2FC962FC5n); -testMul(BigInt("-3"), BigInt("-4275878552"), 0x2FC962FC8n); -testMul(BigInt("-3"), BigInt("-18364758544493064719"), 0x2FC962FC962FC962Dn); -testMul(BigInt("-3"), BigInt("-18364758544493064720"), 0x2FC962FC962FC9630n); -testMul(BigInt("-18364758544493064720"), BigInt("-18364758544493064720"), 0xFDBAC097C8DC5ACCDEEC6CD7A44A4100n); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-multiply-memory-stress.js b/implementation-contributed/javascriptcore/stress/big-int-multiply-memory-stress.js deleted file mode 100644 index 1abaa7e28f..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-multiply-memory-stress.js +++ /dev/null @@ -1,15 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -let a = 0n; -let b = 1n; -for (let i = 0; i < 1000000; i++) { - a = b * 30n; -} - -assert(a === 30n); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-negate-basic.js b/implementation-contributed/javascriptcore/stress/big-int-negate-basic.js deleted file mode 100644 index 59ba3c4724..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-negate-basic.js +++ /dev/null @@ -1,71 +0,0 @@ -//@ runBigIntEnabled -// Original tests from https://github.com/tc39/test262/blob/master/test/language/expressions/unary-minus/bigint.js - -function assert(a, b, message) { - if (a !== b) - throw new Error(message); -} - -function assertNotEqual(a, b, message) { - if (a === b) - throw new Error(message); -} - -assert(-0n, 0n, "-0n === 0n"); -assert(-(0n), 0n, "-(0n) === 0n"); -assertNotEqual(-1n, 1n, "-1n !== 1n"); -assert(-(1n), -1n, "-(1n) === -1n"); -assertNotEqual(-(1n), 1n, "-(1n) !== 1n"); -assert(-(-1n), 1n, "-(-1n) === 1n"); -assertNotEqual(-(-1n), -1n, "-(-1n) !== -1n"); -assert(- - 1n, 1n, "- - 1n === 1n"); -assertNotEqual(- - 1n, -1n, "- - 1n !== -1n"); -assert(-(0x1fffffffffffff01n), -0x1fffffffffffff01n, "-(0x1fffffffffffff01n) === -0x1fffffffffffff01n"); -assertNotEqual(-(0x1fffffffffffff01n), 0x1fffffffffffff01n, "-(0x1fffffffffffff01n) !== 0x1fffffffffffff01n"); -assertNotEqual(-(0x1fffffffffffff01n), -0x1fffffffffffff00n, "-(0x1fffffffffffff01n) !== -0x1fffffffffffff00n"); - -// Non-primitive cases - -assert(-Object(1n), -1n, "-Object(1n) === -1n"); -assertNotEqual(-Object(1n), 1n, "-Object(1n) !== 1n"); -assertNotEqual(-Object(1n), Object(-1n), "-Object(1n) !== Object(-1n)"); -assert(-Object(-1n), 1n, "-Object(-1n) === 1n"); -assertNotEqual(-Object(-1n), -1n, "-Object(-1n) !== -1n"); -assertNotEqual(-Object(-1n), Object(1n), "-Object(-1n) !== Object(1n)"); - -let obj = { - [Symbol.toPrimitive]: function() { - return 1n; - }, - valueOf: function() { - throw new Error("Should never be called"); - }, - toString: function() { - throw new Error("Should never be called"); - } -}; -assert(-obj, -1n, "@@toPrimitive not called properly"); - -obj = { - valueOf: function() { - return 1n; - }, - toString: function() { - throw new Error("Should never be called"); - } -} -assert(-obj, -1n, "valueOf not called properly"); - -obj = { - toString: function() { - return 1n; - } -}; - -assert(-obj, -1n, "-{toString: function() { return 1n; }} === -1n"); - -let x = 1n; -let y = -x; -let z = -y; -assert(x, z, "-(-x) !== z"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-negate-jit.js b/implementation-contributed/javascriptcore/stress/big-int-negate-jit.js deleted file mode 100644 index ab497831c9..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-negate-jit.js +++ /dev/null @@ -1,48 +0,0 @@ -//@ skip if not $jitTests -//@ runBigIntEnabled - -function assert(a, b) { - if (a !== b) - throw new Error("Bad!"); -} - -function negateBigInt(n) { - return -n; -} -noInline(negateBigInt); - -for (let i = 0; i < 100000; i++) { - assert(negateBigInt(100n), -100n); - assert(negateBigInt(-0x1fffffffffffff01n), 0x1fffffffffffff01n); -} - -if (numberOfDFGCompiles(negateBigInt) > 1) - throw "Failed negateBigInt(). We should have compiled a single negate for the BigInt type."; - -function negateBigIntSpecializedToInt(n) { - return -n; -} -noInline(negateBigIntSpecializedToInt); - -for (let i = 0; i < 100000; i++) { - negateBigIntSpecializedToInt(100); -} - -assert(negateBigIntSpecializedToInt(100n), -100n); - -// Testing case mixing int and BigInt speculations -function mixedSpeculationNegateBigInt(n, arr) { - return -(-(-n)); -} -noInline(mixedSpeculationNegateBigInt); - -for (let i = 0; i < 100000; i++) { - if (i % 2) - assert(mixedSpeculationNegateBigInt(100), -100); - else - assert(mixedSpeculationNegateBigInt(-0x1fffffffffffff01n), 0x1fffffffffffff01n); -} - -if (numberOfDFGCompiles(mixedSpeculationNegateBigInt) > 1) - throw "Failed negateBigInt(). We should have compiled a single negate for the BigInt type."; - diff --git a/implementation-contributed/javascriptcore/stress/big-int-no-conversion-to-number.js b/implementation-contributed/javascriptcore/stress/big-int-no-conversion-to-number.js deleted file mode 100644 index 1406128d1d..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-no-conversion-to-number.js +++ /dev/null @@ -1,12 +0,0 @@ -//@ runBigIntEnabled - -let message; -try { - 1n + 1; -} catch (error) { - message = error.message; -} - -if (message !== "Invalid mix of BigInt and other type in addition.") { - throw new Error("Error message has changed to something unexpected"); -} diff --git a/implementation-contributed/javascriptcore/stress/big-int-operations-error.js b/implementation-contributed/javascriptcore/stress/big-int-operations-error.js deleted file mode 100644 index 90e47b7cf7..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-operations-error.js +++ /dev/null @@ -1,44 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function assertThrowTypeError(input) { - try { - eval(input); - assert(false); - } catch (e) { - assert(e instanceof TypeError); - } -} - -assert("a" + 100n, "a100"); -assert(128n + "baba", "128baba"); - -assertThrowTypeError("10n + 30"); -assertThrowTypeError("36 + 15n"); -assertThrowTypeError("120n + 30.5"); -assertThrowTypeError("44.5 + 112034n"); - -assertThrowTypeError("10n - 30"); -assertThrowTypeError("36 - 15n"); -assertThrowTypeError("120n - 30.5"); -assertThrowTypeError("44.5 - 112034n"); - -assertThrowTypeError("10n * 30"); -assertThrowTypeError("36 * 15n"); -assertThrowTypeError("120n * 30.5"); -assertThrowTypeError("44.5 * 112034n"); - -assertThrowTypeError("10n / 30"); -assertThrowTypeError("36 / 15n"); -assertThrowTypeError("120n / 30.5"); -assertThrowTypeError("44.5 / 112034n"); - -assertThrowTypeError("10n ** 30"); -assertThrowTypeError("36 ** 15n"); -assertThrowTypeError("120n ** 30.5"); -assertThrowTypeError("44.5 ** 112034n"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-prop-descriptor.js b/implementation-contributed/javascriptcore/stress/big-int-prop-descriptor.js deleted file mode 100644 index d680b8e2fb..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-prop-descriptor.js +++ /dev/null @@ -1,12 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -let p = Object.getOwnPropertyDescriptor(this, "BigInt"); -assert(p.writable === true); -assert(p.enumerable === false); -assert(p.configurable === true); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-proto-constructor.js b/implementation-contributed/javascriptcore/stress/big-int-proto-constructor.js deleted file mode 100644 index 0490c6f567..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-proto-constructor.js +++ /dev/null @@ -1,14 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -let p = Object.getOwnPropertyDescriptor(BigInt.prototype, "constructor"); - -assert(p.writable === true); -assert(p.enumerable === false); -assert(p.configurable === true); -assert(p.value === BigInt); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-proto-name.js b/implementation-contributed/javascriptcore/stress/big-int-proto-name.js deleted file mode 100644 index 816c181bbf..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-proto-name.js +++ /dev/null @@ -1,13 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -let p = Object.getOwnPropertyDescriptor(BigInt, "name"); -assert(p.enumerable === false); -assert(p.writable === false); -assert(p.configurable === true); -assert(p.value === "BigInt"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-prototype-properties.js b/implementation-contributed/javascriptcore/stress/big-int-prototype-properties.js deleted file mode 100644 index e53efa53be..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-prototype-properties.js +++ /dev/null @@ -1,39 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -(() => { - let p = Object.getOwnPropertyDescriptor(BigInt.prototype, "toString"); - - assert(p.enumerable === false); - assert(p.configurable === true); - assert(p.writable === true); -})(); - -(() => { - let p = Object.getOwnPropertyDescriptor(BigInt.prototype, "toLocaleString"); - - assert(p.enumerable === false); - assert(p.configurable === true); - assert(p.writable === true); -})(); - -(() => { - let p = Object.getOwnPropertyDescriptor(BigInt.prototype, "valueOf"); - - assert(p.enumerable === false); - assert(p.configurable === true); - assert(p.writable === true); -})(); - -(() => { - let p = Object.getOwnPropertyDescriptor(BigInt.prototype, Symbol.toStringTag); - - assert(p.enumerable === false); - assert(p.configurable === true); - assert(p.writable === false); -})(); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-prototype-proto.js b/implementation-contributed/javascriptcore/stress/big-int-prototype-proto.js deleted file mode 100644 index d35be7ee73..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-prototype-proto.js +++ /dev/null @@ -1,11 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -let proto = Object.getPrototypeOf(BigInt.prototype); - -assert(proto === Object.prototype); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-prototype-symbol-to-string-tag.js b/implementation-contributed/javascriptcore/stress/big-int-prototype-symbol-to-string-tag.js deleted file mode 100644 index 8dbea22dac..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-prototype-symbol-to-string-tag.js +++ /dev/null @@ -1,30 +0,0 @@ -//@ runBigIntEnabled -// Original test from test262/test/built-ins/BigInt/prototype/Symbol.toStringTag.js - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -let p = Object.getOwnPropertyDescriptor(BigInt.prototype, Symbol.toStringTag); - -assert(p.writable === false); -assert(p.enumerable === false); -assert(p.configurable === true); -assert(p.value === "BigInt"); - -assert(Object.prototype.toString.call(3n) === "[object BigInt]"); -assert(Object.prototype.toString.call(Object(3n)) === "[object BigInt]"); - -// Verify that Object.prototype.toString does not have special casing for BigInt -// as it does for most other primitive types -Object.defineProperty(BigInt.prototype, Symbol.toStringTag, { - value: "FooBar", - writable: false, - enumerable: false, - configurable: true -}); - -assert(Object.prototype.toString.call(3n) === "[object FooBar]"); -assert(Object.prototype.toString.call(Object(3n)) === "[object FooBar]"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-prototype-to-string-apply.js b/implementation-contributed/javascriptcore/stress/big-int-prototype-to-string-apply.js deleted file mode 100644 index c73154dec4..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-prototype-to-string-apply.js +++ /dev/null @@ -1,24 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function throwsTypeError(v) { - try { - BigInt.prototype.toString.apply(v); - assert(false); - } catch (e) { - assert(e instanceof TypeError); - } -} - -throwsTypeError(3); -throwsTypeError(3.5); -throwsTypeError("ABC"); -throwsTypeError(Symbol("test")); -throwsTypeError({}); -throwsTypeError(true); -throwsTypeError([3n]); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-prototype-to-string-cast-overflow.js b/implementation-contributed/javascriptcore/stress/big-int-prototype-to-string-cast-overflow.js deleted file mode 100644 index a9fa302374..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-prototype-to-string-cast-overflow.js +++ /dev/null @@ -1,20 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function assertThrowRangeError(input) { - try { - let number = 3n; - number.toString(input); - assert(false); - } catch (e) { - assert(e instanceof RangeError); - } -} - -assertThrowRangeError(1e100); -assertThrowRangeError(-1e101); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-prototype-to-string-exception.js b/implementation-contributed/javascriptcore/stress/big-int-prototype-to-string-exception.js deleted file mode 100644 index 6c1d3c0335..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-prototype-to-string-exception.js +++ /dev/null @@ -1,22 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -let o = { - valueOf: () => { - throw new Error("Bad"); - return 2; - } -} - -let a = 20n; -try { - a.toString(o); - assert(false); -} catch (e) { - assert(e.message == "Bad"); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-prototype-to-string-wrong-values.js b/implementation-contributed/javascriptcore/stress/big-int-prototype-to-string-wrong-values.js deleted file mode 100644 index 79e51d5075..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-prototype-to-string-wrong-values.js +++ /dev/null @@ -1,31 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function assertRangeError(v) { - let a = 456n; - try { - a.toString(v); - assert(false); - } catch (e) { - assert(e instanceof RangeError); - } -} - -assertRangeError(1); -assertRangeError(37); -assertRangeError(37.1); -assertRangeError(37.2); -assertRangeError(0); -assertRangeError(-1); -assertRangeError(1.999999); -assertRangeError(37.00000000000000001); -assertRangeError(NaN); -assertRangeError(null); -assertRangeError(+Infinity); -assertRangeError(-Infinity); -assertRangeError(-0); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-prototype-value-of.js b/implementation-contributed/javascriptcore/stress/big-int-prototype-value-of.js deleted file mode 100644 index 2b5f626adb..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-prototype-value-of.js +++ /dev/null @@ -1,22 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function assertThrowTypeError(input) { - try { - let n = BigInt.prototype.valueOf(input); - assert(false); - } catch (e) { - assert(e instanceof TypeError); - } -} - -assertThrowTypeError(10); -assertThrowTypeError("abc"); -assertThrowTypeError(Symbol("a")); -assertThrowTypeError(10.5); -assertThrowTypeError({}); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-spec-to-primitive.js b/implementation-contributed/javascriptcore/stress/big-int-spec-to-primitive.js deleted file mode 100644 index 37f8790d68..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-spec-to-primitive.js +++ /dev/null @@ -1,17 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function foo(input) { - let a = ""; - return "" + input + ""; -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - assert(foo(10n) === "10"); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-spec-to-this.js b/implementation-contributed/javascriptcore/stress/big-int-spec-to-this.js deleted file mode 100644 index f03bf680fd..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-spec-to-this.js +++ /dev/null @@ -1,23 +0,0 @@ -//@ skip if not $jitTests -//@ runDefault("--useBigInt=true", "--useConcurrentJIT=false") - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function foo() { - return typeof this; -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - assert(foo.apply(10n) === "object"); -} - -for (let i = 0; i < 10000; i++) { - assert(foo.apply(300) === "object"); -} - -assert(numberOfDFGCompiles(foo) === 1); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-strict-equals-jit.js b/implementation-contributed/javascriptcore/stress/big-int-strict-equals-jit.js deleted file mode 100644 index 8457d4a067..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-strict-equals-jit.js +++ /dev/null @@ -1,37 +0,0 @@ -//@ runDefault("--useBigInt=true", "--useConcurrentJIT=false") - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function foo(a, b) { - return a === b; -} -noInline(foo); - -for (let i = 0; i < 100000; i++) { - assert(!foo(2n, 3n)); - assert(foo(3n, 3n)); -} - -assert(!foo(3, 3n)); -assert(!foo(0.33, 3n)); -assert(!foo("3", 3n)); -assert(!foo(Symbol("3"), 3n)); -assert(!foo(true, 3n)); -assert(!foo(false, 3n)); -assert(!foo(NaN, 3n)); -assert(!foo(null, 3n)); -assert(!foo(undefined, 3n)); -assert(!foo(+Infinity, 3n)); -assert(!foo(-Infinity, 3n)); - -function bar() { - return 3n; -} -noInline(bar); - -for (let i = 0; i < 100000; i++) - assert(bar() === bar()); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-strict-spec-to-this.js b/implementation-contributed/javascriptcore/stress/big-int-strict-spec-to-this.js deleted file mode 100644 index b5d03bd27b..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-strict-spec-to-this.js +++ /dev/null @@ -1,23 +0,0 @@ -//@ runDefault("--useBigInt=true", "--useConcurrentJIT=false") - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function foo() { - "use strict"; - return typeof this; -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - assert(foo.apply(10n) === "bigint"); -} - -for (let i = 0; i < 10000; i++) { - assert(foo.apply(300) === "number"); -} - -assert(numberOfDFGCompiles(foo) > 1); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-sub-wrapped-value.js b/implementation-contributed/javascriptcore/stress/big-int-sub-wrapped-value.js deleted file mode 100644 index 5b18880f8a..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-sub-wrapped-value.js +++ /dev/null @@ -1,36 +0,0 @@ -//@ runBigIntEnabled - -assert = { - sameValue: function (input, expected, message) { - if (input !== expected) - throw new Error(message); - } -}; - -function testSub(x, y, z, message) { - assert.sameValue(x - y, z, message); -} - -testSub(Object(2n), 1n, 1n, "ToPrimitive: unbox object with internal slot"); - -let o = { - [Symbol.toPrimitive]: function() { - return 2n; - } -}; -testSub(o, 1n, 1n, "ToPrimitive: @@toPrimitive"); - -o = { - valueOf: function() { - return 2n; - } -}; -testSub(o, 1n, 1n, "ToPrimitive: valueOf"); - -o = { - toString: function() { - return 2n; - } -} -testSub(o, 1n, 1n, "ToPrimitive: toString"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-subtraction-basic.js b/implementation-contributed/javascriptcore/stress/big-int-subtraction-basic.js deleted file mode 100644 index 90213242b7..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-subtraction-basic.js +++ /dev/null @@ -1,303 +0,0 @@ -//@ runBigIntEnabled - -assert = { - sameValue: function (input, expected, message) { - if (input !== expected) - throw new Error(message); - } -}; - -function testSub(x, y, z) { - assert.sameValue(x - y, z, x + " - " + y + " = " + z); -} - -testSub(0xFEDCBA9876543210n, 0xFEDCBA9876543210n, 0x0n); -testSub(0xFEDCBA9876543210n, 0xFEDCBA987654320Fn, 0x1n); -testSub(0xFEDCBA9876543210n, 0xFEDCBA98n, 0xFEDCBA9777777778n); -testSub(0xFEDCBA9876543210n, 0xFEDCBA97n, 0xFEDCBA9777777779n); -testSub(0xFEDCBA9876543210n, 0x1234n, 0xFEDCBA9876541FDCn); -testSub(0xFEDCBA9876543210n, 0x3n, 0xFEDCBA987654320Dn); -testSub(0xFEDCBA9876543210n, 0x2n, 0xFEDCBA987654320En); -testSub(0xFEDCBA9876543210n, 0x1n, 0xFEDCBA987654320Fn); -testSub(0xFEDCBA9876543210n, 0x0n, 0xFEDCBA9876543210n); -testSub(0xFEDCBA9876543210n, -0x1n, 0xFEDCBA9876543211n); -testSub(0xFEDCBA9876543210n, -0x2n, 0xFEDCBA9876543212n); -testSub(0xFEDCBA9876543210n, -0x3n, 0xFEDCBA9876543213n); -testSub(0xFEDCBA9876543210n, -0x1234n, 0xFEDCBA9876544444n); -testSub(0xFEDCBA9876543210n, -0xFEDCBA97n, 0xFEDCBA997530ECA7n); -testSub(0xFEDCBA9876543210n, -0xFEDCBA98n, 0xFEDCBA997530ECA8n); -testSub(0xFEDCBA9876543210n, -0xFEDCBA987654320Fn, 0x1FDB97530ECA8641Fn); -testSub(0xFEDCBA9876543210n, -0xFEDCBA9876543210n, 0x1FDB97530ECA86420n); -testSub(0xFEDCBA987654320Fn, 0xFEDCBA9876543210n, -0x1n); -testSub(0xFEDCBA987654320Fn, 0xFEDCBA987654320Fn, 0x0n); -testSub(0xFEDCBA987654320Fn, 0xFEDCBA98n, 0xFEDCBA9777777777n); -testSub(0xFEDCBA987654320Fn, 0xFEDCBA97n, 0xFEDCBA9777777778n); -testSub(0xFEDCBA987654320Fn, 0x1234n, 0xFEDCBA9876541FDBn); -testSub(0xFEDCBA987654320Fn, 0x3n, 0xFEDCBA987654320Cn); -testSub(0xFEDCBA987654320Fn, 0x2n, 0xFEDCBA987654320Dn); -testSub(0xFEDCBA987654320Fn, 0x1n, 0xFEDCBA987654320En); -testSub(0xFEDCBA987654320Fn, 0x0n, 0xFEDCBA987654320Fn); -testSub(0xFEDCBA987654320Fn, -0x1n, 0xFEDCBA9876543210n); -testSub(0xFEDCBA987654320Fn, -0x2n, 0xFEDCBA9876543211n); -testSub(0xFEDCBA987654320Fn, -0x3n, 0xFEDCBA9876543212n); -testSub(0xFEDCBA987654320Fn, -0x1234n, 0xFEDCBA9876544443n); -testSub(0xFEDCBA987654320Fn, -0xFEDCBA97n, 0xFEDCBA997530ECA6n); -testSub(0xFEDCBA987654320Fn, -0xFEDCBA98n, 0xFEDCBA997530ECA7n); -testSub(0xFEDCBA987654320Fn, -0xFEDCBA987654320Fn, 0x1FDB97530ECA8641En); -testSub(0xFEDCBA987654320Fn, -0xFEDCBA9876543210n, 0x1FDB97530ECA8641Fn); -testSub(0xFEDCBA98n, 0xFEDCBA9876543210n, -0xFEDCBA9777777778n); -testSub(0xFEDCBA98n, 0xFEDCBA987654320Fn, -0xFEDCBA9777777777n); -testSub(0xFEDCBA98n, 0xFEDCBA98n, 0x0n); -testSub(0xFEDCBA98n, 0xFEDCBA97n, 0x1n); -testSub(0xFEDCBA98n, 0x1234n, 0xFEDCA864n); -testSub(0xFEDCBA98n, 0x3n, 0xFEDCBA95n); -testSub(0xFEDCBA98n, 0x2n, 0xFEDCBA96n); -testSub(0xFEDCBA98n, 0x1n, 0xFEDCBA97n); -testSub(0xFEDCBA98n, 0x0n, 0xFEDCBA98n); -testSub(0xFEDCBA98n, -0x1n, 0xFEDCBA99n); -testSub(0xFEDCBA98n, -0x2n, 0xFEDCBA9An); -testSub(0xFEDCBA98n, -0x3n, 0xFEDCBA9Bn); -testSub(0xFEDCBA98n, -0x1234n, 0xFEDCCCCCn); -testSub(0xFEDCBA98n, -0xFEDCBA97n, 0x1FDB9752Fn); -testSub(0xFEDCBA98n, -0xFEDCBA98n, 0x1FDB97530n); -testSub(0xFEDCBA98n, -0xFEDCBA987654320Fn, 0xFEDCBA997530ECA7n); -testSub(0xFEDCBA98n, -0xFEDCBA9876543210n, 0xFEDCBA997530ECA8n); -testSub(0xFEDCBA97n, 0xFEDCBA9876543210n, -0xFEDCBA9777777779n); -testSub(0xFEDCBA97n, 0xFEDCBA987654320Fn, -0xFEDCBA9777777778n); -testSub(0xFEDCBA97n, 0xFEDCBA98n, -0x1n); -testSub(0xFEDCBA97n, 0xFEDCBA97n, 0x0n); -testSub(0xFEDCBA97n, 0x1234n, 0xFEDCA863n); -testSub(0xFEDCBA97n, 0x3n, 0xFEDCBA94n); -testSub(0xFEDCBA97n, 0x2n, 0xFEDCBA95n); -testSub(0xFEDCBA97n, 0x1n, 0xFEDCBA96n); -testSub(0xFEDCBA97n, 0x0n, 0xFEDCBA97n); -testSub(0xFEDCBA97n, -0x1n, 0xFEDCBA98n); -testSub(0xFEDCBA97n, -0x2n, 0xFEDCBA99n); -testSub(0xFEDCBA97n, -0x3n, 0xFEDCBA9An); -testSub(0xFEDCBA97n, -0x1234n, 0xFEDCCCCBn); -testSub(0xFEDCBA97n, -0xFEDCBA97n, 0x1FDB9752En); -testSub(0xFEDCBA97n, -0xFEDCBA98n, 0x1FDB9752Fn); -testSub(0xFEDCBA97n, -0xFEDCBA987654320Fn, 0xFEDCBA997530ECA6n); -testSub(0xFEDCBA97n, -0xFEDCBA9876543210n, 0xFEDCBA997530ECA7n); -testSub(0x1234n, 0xFEDCBA9876543210n, -0xFEDCBA9876541FDCn); -testSub(0x1234n, 0xFEDCBA987654320Fn, -0xFEDCBA9876541FDBn); -testSub(0x1234n, 0xFEDCBA98n, -0xFEDCA864n); -testSub(0x1234n, 0xFEDCBA97n, -0xFEDCA863n); -testSub(0x1234n, 0x1234n, 0x0n); -testSub(0x1234n, 0x3n, 0x1231n); -testSub(0x1234n, 0x2n, 0x1232n); -testSub(0x1234n, 0x1n, 0x1233n); -testSub(0x1234n, 0x0n, 0x1234n); -testSub(0x1234n, -0x1n, 0x1235n); -testSub(0x1234n, -0x2n, 0x1236n); -testSub(0x1234n, -0x3n, 0x1237n); -testSub(0x1234n, -0x1234n, 0x2468n); -testSub(0x1234n, -0xFEDCBA97n, 0xFEDCCCCBn); -testSub(0x1234n, -0xFEDCBA98n, 0xFEDCCCCCn); -testSub(0x1234n, -0xFEDCBA987654320Fn, 0xFEDCBA9876544443n); -testSub(0x1234n, -0xFEDCBA9876543210n, 0xFEDCBA9876544444n); -testSub(0x3n, 0xFEDCBA9876543210n, -0xFEDCBA987654320Dn); -testSub(0x3n, 0xFEDCBA987654320Fn, -0xFEDCBA987654320Cn); -testSub(0x3n, 0xFEDCBA98n, -0xFEDCBA95n); -testSub(0x3n, 0xFEDCBA97n, -0xFEDCBA94n); -testSub(0x3n, 0x1234n, -0x1231n); -testSub(0x3n, 0x3n, 0x0n); -testSub(0x3n, 0x2n, 0x1n); -testSub(0x3n, 0x1n, 0x2n); -testSub(0x3n, 0x0n, 0x3n); -testSub(0x3n, -0x1n, 0x4n); -testSub(0x3n, -0x2n, 0x5n); -testSub(0x3n, -0x3n, 0x6n); -testSub(0x3n, -0x1234n, 0x1237n); -testSub(0x3n, -0xFEDCBA97n, 0xFEDCBA9An); -testSub(0x3n, -0xFEDCBA98n, 0xFEDCBA9Bn); -testSub(0x3n, -0xFEDCBA987654320Fn, 0xFEDCBA9876543212n); -testSub(0x3n, -0xFEDCBA9876543210n, 0xFEDCBA9876543213n); -testSub(0x2n, 0xFEDCBA9876543210n, -0xFEDCBA987654320En); -testSub(0x2n, 0xFEDCBA987654320Fn, -0xFEDCBA987654320Dn); -testSub(0x2n, 0xFEDCBA98n, -0xFEDCBA96n); -testSub(0x2n, 0xFEDCBA97n, -0xFEDCBA95n); -testSub(0x2n, 0x1234n, -0x1232n); -testSub(0x2n, 0x3n, -0x1n); -testSub(0x2n, 0x2n, 0x0n); -testSub(0x2n, 0x1n, 0x1n); -testSub(0x2n, 0x0n, 0x2n); -testSub(0x2n, -0x1n, 0x3n); -testSub(0x2n, -0x2n, 0x4n); -testSub(0x2n, -0x3n, 0x5n); -testSub(0x2n, -0x1234n, 0x1236n); -testSub(0x2n, -0xFEDCBA97n, 0xFEDCBA99n); -testSub(0x2n, -0xFEDCBA98n, 0xFEDCBA9An); -testSub(0x2n, -0xFEDCBA987654320Fn, 0xFEDCBA9876543211n); -testSub(0x2n, -0xFEDCBA9876543210n, 0xFEDCBA9876543212n); -testSub(0x1n, 0xFEDCBA9876543210n, -0xFEDCBA987654320Fn); -testSub(0x1n, 0xFEDCBA987654320Fn, -0xFEDCBA987654320En); -testSub(0x1n, 0xFEDCBA98n, -0xFEDCBA97n); -testSub(0x1n, 0xFEDCBA97n, -0xFEDCBA96n); -testSub(0x1n, 0x1234n, -0x1233n); -testSub(0x1n, 0x3n, -0x2n); -testSub(0x1n, 0x2n, -0x1n); -testSub(0x1n, 0x1n, 0x0n); -testSub(0x1n, 0x0n, 0x1n); -testSub(0x1n, -0x1n, 0x2n); -testSub(0x1n, -0x2n, 0x3n); -testSub(0x1n, -0x3n, 0x4n); -testSub(0x1n, -0x1234n, 0x1235n); -testSub(0x1n, -0xFEDCBA97n, 0xFEDCBA98n); -testSub(0x1n, -0xFEDCBA98n, 0xFEDCBA99n); -testSub(0x1n, -0xFEDCBA987654320Fn, 0xFEDCBA9876543210n); -testSub(0x1n, -0xFEDCBA9876543210n, 0xFEDCBA9876543211n); -testSub(0x0n, 0xFEDCBA9876543210n, -0xFEDCBA9876543210n); -testSub(0x0n, 0xFEDCBA987654320Fn, -0xFEDCBA987654320Fn); -testSub(0x0n, 0xFEDCBA98n, -0xFEDCBA98n); -testSub(0x0n, 0xFEDCBA97n, -0xFEDCBA97n); -testSub(0x0n, 0x1234n, -0x1234n); -testSub(0x0n, 0x3n, -0x3n); -testSub(0x0n, 0x2n, -0x2n); -testSub(0x0n, 0x1n, -0x1n); -testSub(0x0n, 0x0n, 0x0n); -testSub(0x0n, -0x1n, 0x1n); -testSub(0x0n, -0x2n, 0x2n); -testSub(0x0n, -0x3n, 0x3n); -testSub(0x0n, -0x1234n, 0x1234n); -testSub(0x0n, -0xFEDCBA97n, 0xFEDCBA97n); -testSub(0x0n, -0xFEDCBA98n, 0xFEDCBA98n); -testSub(0x0n, -0xFEDCBA987654320Fn, 0xFEDCBA987654320Fn); -testSub(0x0n, -0xFEDCBA9876543210n, 0xFEDCBA9876543210n); -testSub(-0x1n, 0xFEDCBA9876543210n, -0xFEDCBA9876543211n); -testSub(-0x1n, 0xFEDCBA987654320Fn, -0xFEDCBA9876543210n); -testSub(-0x1n, 0xFEDCBA98n, -0xFEDCBA99n); -testSub(-0x1n, 0xFEDCBA97n, -0xFEDCBA98n); -testSub(-0x1n, 0x1234n, -0x1235n); -testSub(-0x1n, 0x3n, -0x4n); -testSub(-0x1n, 0x2n, -0x3n); -testSub(-0x1n, 0x1n, -0x2n); -testSub(-0x1n, 0x0n, -0x1n); -testSub(-0x1n, -0x1n, 0x0n); -testSub(-0x1n, -0x2n, 0x1n); -testSub(-0x1n, -0x3n, 0x2n); -testSub(-0x1n, -0x1234n, 0x1233n); -testSub(-0x1n, -0xFEDCBA97n, 0xFEDCBA96n); -testSub(-0x1n, -0xFEDCBA98n, 0xFEDCBA97n); -testSub(-0x1n, -0xFEDCBA987654320Fn, 0xFEDCBA987654320En); -testSub(-0x1n, -0xFEDCBA9876543210n, 0xFEDCBA987654320Fn); -testSub(-0x2n, 0xFEDCBA9876543210n, -0xFEDCBA9876543212n); -testSub(-0x2n, 0xFEDCBA987654320Fn, -0xFEDCBA9876543211n); -testSub(-0x2n, 0xFEDCBA98n, -0xFEDCBA9An); -testSub(-0x2n, 0xFEDCBA97n, -0xFEDCBA99n); -testSub(-0x2n, 0x1234n, -0x1236n); -testSub(-0x2n, 0x3n, -0x5n); -testSub(-0x2n, 0x2n, -0x4n); -testSub(-0x2n, 0x1n, -0x3n); -testSub(-0x2n, 0x0n, -0x2n); -testSub(-0x2n, -0x1n, -0x1n); -testSub(-0x2n, -0x2n, 0x0n); -testSub(-0x2n, -0x3n, 0x1n); -testSub(-0x2n, -0x1234n, 0x1232n); -testSub(-0x2n, -0xFEDCBA97n, 0xFEDCBA95n); -testSub(-0x2n, -0xFEDCBA98n, 0xFEDCBA96n); -testSub(-0x2n, -0xFEDCBA987654320Fn, 0xFEDCBA987654320Dn); -testSub(-0x2n, -0xFEDCBA9876543210n, 0xFEDCBA987654320En); -testSub(-0x3n, 0xFEDCBA9876543210n, -0xFEDCBA9876543213n); -testSub(-0x3n, 0xFEDCBA987654320Fn, -0xFEDCBA9876543212n); -testSub(-0x3n, 0xFEDCBA98n, -0xFEDCBA9Bn); -testSub(-0x3n, 0xFEDCBA97n, -0xFEDCBA9An); -testSub(-0x3n, 0x1234n, -0x1237n); -testSub(-0x3n, 0x3n, -0x6n); -testSub(-0x3n, 0x2n, -0x5n); -testSub(-0x3n, 0x1n, -0x4n); -testSub(-0x3n, 0x0n, -0x3n); -testSub(-0x3n, -0x1n, -0x2n); -testSub(-0x3n, -0x2n, -0x1n); -testSub(-0x3n, -0x3n, 0x0n); -testSub(-0x3n, -0x1234n, 0x1231n); -testSub(-0x3n, -0xFEDCBA97n, 0xFEDCBA94n); -testSub(-0x3n, -0xFEDCBA98n, 0xFEDCBA95n); -testSub(-0x3n, -0xFEDCBA987654320Fn, 0xFEDCBA987654320Cn); -testSub(-0x3n, -0xFEDCBA9876543210n, 0xFEDCBA987654320Dn); -testSub(-0x1234n, 0xFEDCBA9876543210n, -0xFEDCBA9876544444n); -testSub(-0x1234n, 0xFEDCBA987654320Fn, -0xFEDCBA9876544443n); -testSub(-0x1234n, 0xFEDCBA98n, -0xFEDCCCCCn); -testSub(-0x1234n, 0xFEDCBA97n, -0xFEDCCCCBn); -testSub(-0x1234n, 0x1234n, -0x2468n); -testSub(-0x1234n, 0x3n, -0x1237n); -testSub(-0x1234n, 0x2n, -0x1236n); -testSub(-0x1234n, 0x1n, -0x1235n); -testSub(-0x1234n, 0x0n, -0x1234n); -testSub(-0x1234n, -0x1n, -0x1233n); -testSub(-0x1234n, -0x2n, -0x1232n); -testSub(-0x1234n, -0x3n, -0x1231n); -testSub(-0x1234n, -0x1234n, 0x0n); -testSub(-0x1234n, -0xFEDCBA97n, 0xFEDCA863n); -testSub(-0x1234n, -0xFEDCBA98n, 0xFEDCA864n); -testSub(-0x1234n, -0xFEDCBA987654320Fn, 0xFEDCBA9876541FDBn); -testSub(-0x1234n, -0xFEDCBA9876543210n, 0xFEDCBA9876541FDCn); -testSub(-0xFEDCBA97n, 0xFEDCBA9876543210n, -0xFEDCBA997530ECA7n); -testSub(-0xFEDCBA97n, 0xFEDCBA987654320Fn, -0xFEDCBA997530ECA6n); -testSub(-0xFEDCBA97n, 0xFEDCBA98n, -0x1FDB9752Fn); -testSub(-0xFEDCBA97n, 0xFEDCBA97n, -0x1FDB9752En); -testSub(-0xFEDCBA97n, 0x1234n, -0xFEDCCCCBn); -testSub(-0xFEDCBA97n, 0x3n, -0xFEDCBA9An); -testSub(-0xFEDCBA97n, 0x2n, -0xFEDCBA99n); -testSub(-0xFEDCBA97n, 0x1n, -0xFEDCBA98n); -testSub(-0xFEDCBA97n, 0x0n, -0xFEDCBA97n); -testSub(-0xFEDCBA97n, -0x1n, -0xFEDCBA96n); -testSub(-0xFEDCBA97n, -0x2n, -0xFEDCBA95n); -testSub(-0xFEDCBA97n, -0x3n, -0xFEDCBA94n); -testSub(-0xFEDCBA97n, -0x1234n, -0xFEDCA863n); -testSub(-0xFEDCBA97n, -0xFEDCBA97n, 0x0n); -testSub(-0xFEDCBA97n, -0xFEDCBA98n, 0x1n); -testSub(-0xFEDCBA97n, -0xFEDCBA987654320Fn, 0xFEDCBA9777777778n); -testSub(-0xFEDCBA97n, -0xFEDCBA9876543210n, 0xFEDCBA9777777779n); -testSub(-0xFEDCBA98n, 0xFEDCBA9876543210n, -0xFEDCBA997530ECA8n); -testSub(-0xFEDCBA98n, 0xFEDCBA987654320Fn, -0xFEDCBA997530ECA7n); -testSub(-0xFEDCBA98n, 0xFEDCBA98n, -0x1FDB97530n); -testSub(-0xFEDCBA98n, 0xFEDCBA97n, -0x1FDB9752Fn); -testSub(-0xFEDCBA98n, 0x1234n, -0xFEDCCCCCn); -testSub(-0xFEDCBA98n, 0x3n, -0xFEDCBA9Bn); -testSub(-0xFEDCBA98n, 0x2n, -0xFEDCBA9An); -testSub(-0xFEDCBA98n, 0x1n, -0xFEDCBA99n); -testSub(-0xFEDCBA98n, 0x0n, -0xFEDCBA98n); -testSub(-0xFEDCBA98n, -0x1n, -0xFEDCBA97n); -testSub(-0xFEDCBA98n, -0x2n, -0xFEDCBA96n); -testSub(-0xFEDCBA98n, -0x3n, -0xFEDCBA95n); -testSub(-0xFEDCBA98n, -0x1234n, -0xFEDCA864n); -testSub(-0xFEDCBA98n, -0xFEDCBA97n, -0x1n); -testSub(-0xFEDCBA98n, -0xFEDCBA98n, 0x0n); -testSub(-0xFEDCBA98n, -0xFEDCBA987654320Fn, 0xFEDCBA9777777777n); -testSub(-0xFEDCBA98n, -0xFEDCBA9876543210n, 0xFEDCBA9777777778n); -testSub(-0xFEDCBA987654320Fn, 0xFEDCBA9876543210n, -0x1FDB97530ECA8641Fn); -testSub(-0xFEDCBA987654320Fn, 0xFEDCBA987654320Fn, -0x1FDB97530ECA8641En); -testSub(-0xFEDCBA987654320Fn, 0xFEDCBA98n, -0xFEDCBA997530ECA7n); -testSub(-0xFEDCBA987654320Fn, 0xFEDCBA97n, -0xFEDCBA997530ECA6n); -testSub(-0xFEDCBA987654320Fn, 0x1234n, -0xFEDCBA9876544443n); -testSub(-0xFEDCBA987654320Fn, 0x3n, -0xFEDCBA9876543212n); -testSub(-0xFEDCBA987654320Fn, 0x2n, -0xFEDCBA9876543211n); -testSub(-0xFEDCBA987654320Fn, 0x1n, -0xFEDCBA9876543210n); -testSub(-0xFEDCBA987654320Fn, 0x0n, -0xFEDCBA987654320Fn); -testSub(-0xFEDCBA987654320Fn, -0x1n, -0xFEDCBA987654320En); -testSub(-0xFEDCBA987654320Fn, -0x2n, -0xFEDCBA987654320Dn); -testSub(-0xFEDCBA987654320Fn, -0x3n, -0xFEDCBA987654320Cn); -testSub(-0xFEDCBA987654320Fn, -0x1234n, -0xFEDCBA9876541FDBn); -testSub(-0xFEDCBA987654320Fn, -0xFEDCBA97n, -0xFEDCBA9777777778n); -testSub(-0xFEDCBA987654320Fn, -0xFEDCBA98n, -0xFEDCBA9777777777n); -testSub(-0xFEDCBA987654320Fn, -0xFEDCBA987654320Fn, 0x0n); -testSub(-0xFEDCBA987654320Fn, -0xFEDCBA9876543210n, 0x1n); -testSub(-0xFEDCBA9876543210n, 0xFEDCBA9876543210n, -0x1FDB97530ECA86420n); -testSub(-0xFEDCBA9876543210n, 0xFEDCBA987654320Fn, -0x1FDB97530ECA8641Fn); -testSub(-0xFEDCBA9876543210n, 0xFEDCBA98n, -0xFEDCBA997530ECA8n); -testSub(-0xFEDCBA9876543210n, 0xFEDCBA97n, -0xFEDCBA997530ECA7n); -testSub(-0xFEDCBA9876543210n, 0x1234n, -0xFEDCBA9876544444n); -testSub(-0xFEDCBA9876543210n, 0x3n, -0xFEDCBA9876543213n); -testSub(-0xFEDCBA9876543210n, 0x2n, -0xFEDCBA9876543212n); -testSub(-0xFEDCBA9876543210n, 0x1n, -0xFEDCBA9876543211n); -testSub(-0xFEDCBA9876543210n, 0x0n, -0xFEDCBA9876543210n); -testSub(-0xFEDCBA9876543210n, -0x1n, -0xFEDCBA987654320Fn); -testSub(-0xFEDCBA9876543210n, -0x2n, -0xFEDCBA987654320En); -testSub(-0xFEDCBA9876543210n, -0x3n, -0xFEDCBA987654320Dn); -testSub(-0xFEDCBA9876543210n, -0x1234n, -0xFEDCBA9876541FDCn); -testSub(-0xFEDCBA9876543210n, -0xFEDCBA97n, -0xFEDCBA9777777779n); -testSub(-0xFEDCBA9876543210n, -0xFEDCBA98n, -0xFEDCBA9777777778n); -testSub(-0xFEDCBA9876543210n, -0xFEDCBA987654320Fn, -0x1n); -testSub(-0xFEDCBA9876543210n, -0xFEDCBA9876543210n, 0x0n); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-subtraction-jit.js b/implementation-contributed/javascriptcore/stress/big-int-subtraction-jit.js deleted file mode 100644 index cb081aafb8..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-subtraction-jit.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runBigIntEnabled - -let assert = { - sameValue: function(i, e, m) { - if (i !== e) - throw new Error(m); - } -} - -function bigIntAddition(x, y) { - return x - y; -} -noInline(bigIntAddition); - -for (let i = 0; i < 10000; i++) { - let r = bigIntAddition(3n, 10n); - assert.sameValue(r, -7n, 3n + " - " + 10n + " = " + r); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-subtraction-type-error.js b/implementation-contributed/javascriptcore/stress/big-int-subtraction-type-error.js deleted file mode 100644 index 74ac48a589..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-subtraction-type-error.js +++ /dev/null @@ -1,125 +0,0 @@ -//@ runBigIntEnabled - -function assert(a, message) { - if (!a) - throw new Error(message); -} - -function assertThrowTypeError(a, b, message) { - try { - let n = a - b; - assert(false, message + ": Should throw TypeError, but executed without exception"); - } catch (e) { - assert(e instanceof TypeError, message + ": expected TypeError, got: " + e); - } -} - -assertThrowTypeError(30n, Symbol("foo"), "BingInt - Symbol"); -assertThrowTypeError(Symbol("bar"), 18757382984821n, "Symbol - BigInt"); -assertThrowTypeError(30n, 3320, "BingInt - Int32"); -assertThrowTypeError(33256, 18757382984821n, "Int32 - BigInt"); -assertThrowTypeError(30n, 0.543, "BingInt - Double"); -assertThrowTypeError(230.19293, 18757382984821n, "Double - BigInt"); -assertThrowTypeError(18757382984821n, "abc", "BigInt - String"); -assertThrowTypeError("def", 18757382984821n, "String - BigInt"); -assertThrowTypeError(18757382984821n, "", "BigInt - Empty String"); -assertThrowTypeError("", 18757382984821n, "Empty - BigInt"); -assertThrowTypeError(18757382984821n, NaN, "BigInt - NaN"); -assertThrowTypeError(NaN, 18757382984821n, "NaN - BigInt"); -assertThrowTypeError(18757382984821n, undefined, "BigInt - undefined"); -assertThrowTypeError(undefined, 18757382984821n, "undefined - BigInt"); -assertThrowTypeError(18757382984821n, true, "BigInt - true"); -assertThrowTypeError(true, 18757382984821n, "true - BigInt"); -assertThrowTypeError(18757382984821n, false, "BigInt - false"); -assertThrowTypeError(false, 18757382984821n, "false - BigInt"); -assertThrowTypeError(18757382984821n, +Infinity, "BigInt - Infinity"); -assertThrowTypeError(+Infinity, 18757382984821n, "Infinity - BigInt"); -assertThrowTypeError(18757382984821n, -Infinity, "BigInt - -Infinity"); -assertThrowTypeError(-Infinity, 18757382984821n, "-Infinity - BigInt"); - -// Error when returning from object - -let o = { - valueOf: function () { return Symbol("Foo"); } -}; - -assertThrowTypeError(30n, o, "BingInt - Object.valueOf returning Symbol"); -assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Symbol - BigInt"); - -o = { - valueOf: function () { return 33256; } -}; - -assertThrowTypeError(30n, o, "BingInt - Object.valueOf returning Int32"); -assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Int32 - BigInt"); - -o = { - valueOf: function () { return 0.453; } -}; - -assertThrowTypeError(30n, o, "BingInt - Object.valueOf returning Double"); -assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning Double - BigInt"); - -o = { - valueOf: function () { return ""; } -}; - -assertThrowTypeError(30n, o, "BingInt - Object.valueOf returning String"); -assertThrowTypeError(o, 18757382984821n, "Object.valueOf returning String - BigInt"); - -o = { - toString: function () { return Symbol("Foo"); } -}; - -assertThrowTypeError(30n, o, "BingInt - Object.toString returning Symbol"); -assertThrowTypeError(o, 18757382984821n, "Object.toString returning Symbol - BigInt"); - -o = { - toString: function () { return 33256; } -}; - -assertThrowTypeError(30n, o, "BingInt - Object.toString returning Int32"); -assertThrowTypeError(o, 18757382984821n, "Object.toString returning Int32 - BigInt"); - -o = { - toString: function () { return 0.453; } -}; - -assertThrowTypeError(30n, o, "BingInt - Object.toString returning Double"); -assertThrowTypeError(o, 18757382984821n, "Object.toString returning Double - BigInt"); - -o = { - toString: function () { return "abc"; } -}; - -assertThrowTypeError(30n, o, "BingInt - Object.toString returning String"); -assertThrowTypeError(o, 18757382984821n, "Object.toString returning String - BigInt"); - -o = { - [Symbol.toPrimitive]: function () { return Symbol("Foo"); } -}; - -assertThrowTypeError(30n, o, "BingInt - Object.@@toPrimitive returning Symbol"); -assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Symbol - BigInt"); - -o = { - [Symbol.toPrimitive]: function () { return 33256; } -}; - -assertThrowTypeError(30n, o, "BingInt - Object.@@toPrimitive returning Int32"); -assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Int32 - BigInt"); - -o = { - [Symbol.toPrimitive]: function () { return 0.453; } -}; - -assertThrowTypeError(30n, o, "BingInt - Object.@@toPrimitive returning Double"); -assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning Double - BigInt"); - -o = { - [Symbol.toPrimitive]: function () { return "Abc"; } -}; - -assertThrowTypeError(30n, o, "BingInt - Object.@@toPrimitive returning String"); -assertThrowTypeError(o, 18757382984821n, "Object.@@toPrimitive returning String - BigInt"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-to-object.js b/implementation-contributed/javascriptcore/stress/big-int-to-object.js deleted file mode 100644 index 2d7a039d55..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-to-object.js +++ /dev/null @@ -1,13 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function foo() { - assert(typeof this === "object") -} - -foo.apply(BigInt(1)); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-to-string.js b/implementation-contributed/javascriptcore/stress/big-int-to-string.js deleted file mode 100644 index d7878a9fe6..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-to-string.js +++ /dev/null @@ -1,33 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -let v = 10n; -assert(v.toString() === "10"); -assert(v.toString(2) === "1010"); -assert(v.toString(3) === "101"); -assert(v.toString(8) === "12"); -assert(v.toString(16) === "a"); -assert(v.toString(32) === "a"); - -// Invaid radix - -function testInvalidRadix(radix) { - try { - v.toString(radix); - assert(false); - } catch(e) { - assert(e instanceof RangeError); - } -} - -testInvalidRadix(-10); -testInvalidRadix(-1); -testInvalidRadix(0); -testInvalidRadix(1); -testInvalidRadix(37); -testInvalidRadix(4294967312); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-type-of-proven-type.js b/implementation-contributed/javascriptcore/stress/big-int-type-of-proven-type.js deleted file mode 100644 index d2f539798c..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-type-of-proven-type.js +++ /dev/null @@ -1,18 +0,0 @@ -//@ runDefault("--useBigInt=true", "--useConcurrentJIT=false") - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function foo(o) { - let newString = o.toString(); - if (typeof o === "bigint") - return newString; -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - assert(foo(3n) === "3"); -} - diff --git a/implementation-contributed/javascriptcore/stress/big-int-type-of.js b/implementation-contributed/javascriptcore/stress/big-int-type-of.js deleted file mode 100644 index e53cd30124..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-type-of.js +++ /dev/null @@ -1,10 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -assert(typeof 0n === "bigint"); -assert(typeof 1n !== "object"); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-unary-plus.js b/implementation-contributed/javascriptcore/stress/big-int-unary-plus.js deleted file mode 100644 index 4d4ac37b9e..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-unary-plus.js +++ /dev/null @@ -1,51 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad!") -} - -function assertTypeError(input) { - try { - let a = +input; - assert(false); - } catch(e) { - assert(e instanceof TypeError); - } -} - -assertTypeError(10n); -assertTypeError(-10n); -assertTypeError(Object(10n)); -assertTypeError(Object(-10n)); - -let obj = { - [Symbol.toPrimitive]: function() { - return 1n; - }, - valueOf: function() { - throw new Error("Should never be called"); - }, - toString: function() { - throw new Error("Should never be called"); - } -}; -assertTypeError(obj); - -obj = { - valueOf: function() { - return 1n; - }, - toString: function() { - throw new Error("Should never be called"); - } -}; -assertTypeError(obj); - -obj = { - toString: function() { - return 1n; - } -}; -assertTypeError(obj); - diff --git a/implementation-contributed/javascriptcore/stress/big-int-white-space-trailing-leading.js b/implementation-contributed/javascriptcore/stress/big-int-white-space-trailing-leading.js deleted file mode 100644 index 521a77615b..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-int-white-space-trailing-leading.js +++ /dev/null @@ -1,111 +0,0 @@ -//@ runBigIntEnabled - -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function assertThrowSyntaxError(input) { - try { - eval(input); - assert(false); - } catch (e) { - assert(e instanceof SyntaxError); - } -} - -var d; - -assert(eval("d=\u000C5n") === 5n); -assert(d === 5n); - -assert(eval("d=\u000915n") === 15n); -assert(d === 15n); - -assert(eval("d=\u000B19n\u000B;") === 19n); -assert(d === 19n); - -assert(eval("d=\u000C119n;") === 119n); -assert(d === 119n); - -assert(eval("d=\u002095n;") === 95n); -assert(d === 95n); - -assert(eval("d=\u00A053n;") === 53n); -assert(d === 53n); - -assert(eval("d=\uFEFF39n;") === 39n); -assert(d === 39n); - -assert(eval("d=5n\u000C") === 5n); -assert(d === 5n); - -assert(eval("d=15n\u0009") === 15n); -assert(d === 15n); - -assert(eval("d=19n\u000B;") === 19n); -assert(d === 19n); - -assert(eval("d=119n\u000C;") === 119n); -assert(d === 119n); - -assert(eval("d=95n\u0020;") === 95n); -assert(d === 95n); - -assert(eval("d=53n\u00A0;") === 53n); -assert(d === 53n); - -assert(eval("d=39n\uFEFF;") === 39n); -assert(d === 39n); - -assert(eval("\u000C\u000Cd\u000C\u000C=\u000C\u000C5n\u000C;\u000C") === 5n); -assert(d === 5n); - -assert(eval("\u0009\u0009d\u0009\u0009=\u0009\u000915n\u0009;") === 15n); -assert(d === 15n); - -assert(eval("\u000B\u000Bd\u000B\u000B=\u000B\u000B19n\u000B;") === 19n); -assert(d === 19n); - -assert(eval("\u000C\u000Cd\u000C=\u000C\u000C119n;") === 119n); -assert(d === 119n); - -assert(eval("\u0020d\u0020=\u0020\u002095n;") === 95n); -assert(d === 95n); - -assert(eval("\u00A0d\u00A0=\u00A0\u00A053n;") === 53n); -assert(d === 53n); - -assert(eval("\uFEFFd\uFEFF=\uFEFF\uFEFF39n;") === 39n); -assert(d === 39n); - -// Assert errors - -assertThrowSyntaxError("0b\u000C2n"); -assertThrowSyntaxError("0b\u000B1101n"); -assertThrowSyntaxError("0b\u0009111111n"); -assertThrowSyntaxError("0b\u002010101n"); -assertThrowSyntaxError("0b\u00A01011n"); -assertThrowSyntaxError("0b\uFEFF111000n"); - -assertThrowSyntaxError("0o\u000C2n"); -assertThrowSyntaxError("0o\u000B45n"); -assertThrowSyntaxError("0o\u000977n"); -assertThrowSyntaxError("0o\u0020777n"); -assertThrowSyntaxError("0o\u00A01777n"); -assertThrowSyntaxError("0o\uFEFF17361n"); - -assertThrowSyntaxError("0x\u000C2n"); -assertThrowSyntaxError("0x\u000B45n"); -assertThrowSyntaxError("0x\u000977n"); -assertThrowSyntaxError("0x\u0020777n"); -assertThrowSyntaxError("0x\u00A01777n"); -assertThrowSyntaxError("0x\uFEFF17361n"); - -assertThrowSyntaxError("2\u000Cn"); -assertThrowSyntaxError("45\u000Bn"); -assertThrowSyntaxError("77\u0009n"); -assertThrowSyntaxError("777\u0020n"); -assertThrowSyntaxError("1777\u00A0n"); -assertThrowSyntaxError("17361\uFEFFn"); - diff --git a/implementation-contributed/javascriptcore/stress/big-match.js b/implementation-contributed/javascriptcore/stress/big-match.js deleted file mode 100644 index 4eb441c7a6..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-match.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; - -var bigString = "x"; -while (bigString.length < 200000) - bigString = bigString + bigString; - -if (bigString.length != 262144) - throw "Error: bad string length: " + bigString.length; - -var result = /x/g[Symbol.match](bigString); - -if (result.length != 262144) - throw "Error: bad result array length: " + result.length; - -for (var i = 0; i < result.length; ++i) { - if (result[i] != "x") - throw "Error: array does not contain \"x\" at i = " + i + ": " + result[i]; -} - - diff --git a/implementation-contributed/javascriptcore/stress/big-split-captures.js b/implementation-contributed/javascriptcore/stress/big-split-captures.js deleted file mode 100644 index 5a2f49a3e5..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-split-captures.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; - -var bigString = "xyz"; -while (bigString.length < 200000) - bigString = bigString + bigString; - -if (bigString.length != 393216) - throw "Error: bad string length: " + bigString.length; - -var result = /(x)(y)(z)/[Symbol.split](bigString); - -if (result.length != 524289) - throw "Error: bad result array length: " + result.length; - -if (result[0] != "") - throw "Error: array does not start with an empty string."; - -for (var i = 1; i < result.length; i += 4) { - if (result[i + 0] != "x") - throw "Error: array does not contain \"x\" at i = " + i + " + 0: " + result[i + 0]; - if (result[i + 1] != "y") - throw "Error: array does not contain \"y\" at i = " + i + " + 1: " + result[i + 1]; - if (result[i + 2] != "z") - throw "Error: array does not contain \"z\" at i = " + i + " + 2: " + result[i + 2]; - if (result[i + 3] != "") - throw "Error: array does not contain \"\" at i = " + i + " + 3: " + result[i + 3]; -} diff --git a/implementation-contributed/javascriptcore/stress/big-split.js b/implementation-contributed/javascriptcore/stress/big-split.js deleted file mode 100644 index e4ee783a48..0000000000 --- a/implementation-contributed/javascriptcore/stress/big-split.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; - -var bigString = "xy"; -while (bigString.length < 200000) - bigString = bigString + bigString; - -if (bigString.length != 262144) - throw "Error: bad string length: " + bigString.length; - -var result = /x/[Symbol.split](bigString); - -if (result.length != 131073) - throw "Error: bad result array length: " + result.length; - -if (result[0] != "") - throw "Error: array does not start with an empty string."; - -for (var i = 1; i < result.length; ++i) { - if (result[i] != "y") - throw "Error: array does not contain \"y\" at i = " + i + ": " + result[i]; -} diff --git a/implementation-contributed/javascriptcore/stress/bit-op-value-to-int32-input-liveness.js b/implementation-contributed/javascriptcore/stress/bit-op-value-to-int32-input-liveness.js deleted file mode 100644 index d614db2cd0..0000000000 --- a/implementation-contributed/javascriptcore/stress/bit-op-value-to-int32-input-liveness.js +++ /dev/null @@ -1,20 +0,0 @@ -function foo(a, b) { - return a.f ^ b.f; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo({f:5.5}, {f:6.5}); - if (result != 3) - throw "Error: bad result: " + result; -} - -var result = foo({f:"5.5"}, {f:6.5}); -if (result != 3) - throw "Error: bad result: " + result; - -var result = foo({f:5.5}, {f:"6.5"}); -if (result != 3) - throw "Error: bad result: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/block-scoped-function-declarations.js b/implementation-contributed/javascriptcore/stress/block-scoped-function-declarations.js deleted file mode 100644 index 60de29dfbf..0000000000 --- a/implementation-contributed/javascriptcore/stress/block-scoped-function-declarations.js +++ /dev/null @@ -1,227 +0,0 @@ -"use strict"; - -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} - -function test(f) { - for (let i = 0; i < 500; i++) - f(); -} - -{ - let called = false; - function foo() { - called = true; - function bar() { return 25; } - assert(bar() === 25); - { - function bar() { return 30; } - assert(bar() === 30); - } - assert(bar() === 25); - } - test(foo); - assert(called); -} - -{ - let called = false; - function foo() { - called = true; - assert(bar() === 25); - { - assert(bar() === 30); - function bar() { return 30; } - } - assert(bar() === 25); - - function bar() { return 25; } - } - test(foo); - assert(called); -} - -{ - let called = false; - function foo() { - called = true; - function foo() { return bar(); } - function bar() { return 25; } - assert(bar() === 25); - assert(foo() === 25); - { - function bar() { return 30; } - function foo() { return 25; } - assert(bar() === 30); - assert(foo() === 25); - } - assert(bar() === 25); - assert(foo() === 25); - } - test(foo); - assert(called); -} - -{ - let called = false; - function foo() { - called = true; - assert(bar() === 25); - assert(foo() === 25); - { - function bar() { return 30; } - function foo() { return 25; } - assert(bar() === 30); - assert(foo() === 25); - } - assert(bar() === 25); - assert(foo() === 25); - - function foo() { return bar(); } - function bar() { return 25; } - } - test(foo); - assert(called); -} - -{ - let called = false; - function foo() { - called = true; - let isDefault = false; - switch ('foo') { - case 1: - function foo() { return 25; } - break; - case 2: - function bar() { return 30; } - break; - default: - isDefault = true; - assert(foo() === 25); - assert(bar() === 30); - break; - } - assert(isDefault); - } - test(foo); - assert(called); -} - -{ - let called = false; - function foo() { - called = true; - let is1 = false; - switch (1) { - case 1: - is1 = true; - function foo() { return 25; } - assert(foo() === 25); - assert(bar() === 30); - break; - case 2: - function bar() { return 30; } - break; - } - assert(is1); - } - test(foo); - assert(called); -} - -{ - let called = false; - function foo() { - called = true; - function foo() { return 25; } - function bar() { return "bar"; } - let is2 = false; - switch (2) { - case 1: { - function foo() { return 30; } - break; - } - case 2: - is2 = true; - function bar() { return 30; } - assert(bar() === 30); - assert(foo() === 25); - break; - } - assert(is2); - assert(bar() === "bar"); - assert(foo() === 25); - } - test(foo); - assert(called); -} - -{ - let called = false; - function foo() { - called = true; - function foo() { return 25; } - function bar() { return "bar"; } - let capture = () => foo + "" + bar; - let is2 = false; - switch (2) { - case 1: { - function foo() { return 30; } - break; - } - case 2: - is2 = true; - function bar() { return 30; } - let capture = () => bar; - assert(bar() === 30); - assert(foo() === 25); - break; - } - assert(is2); - assert(bar() === "bar"); - assert(foo() === 25); - } - test(foo); - assert(called); -} - -{ - let called = false; - function foo() { - called = true; - let f1; - let f2 = foo; - function foo() { } - if (true) { - f1 = foo; - function foo() { } - } - assert(!!f1 && !!f2); - assert(f1 !== f2); - } - test(foo); - assert(called); -} - -{ - let called = false; - function foo() { - called = true; - let f1; - let f2 = foo; - function foo() { } - let capture = () => foo; - if (true) { - f1 = foo; - function foo() { } - let capture = () => foo; - } - assert(!!f1 && !!f2); - assert(f1 !== f2); - } - test(foo); - assert(called); -} diff --git a/implementation-contributed/javascriptcore/stress/bound-function-does-not-have-caller-and-arguments.js b/implementation-contributed/javascriptcore/stress/bound-function-does-not-have-caller-and-arguments.js deleted file mode 100644 index 97cc76f6c4..0000000000 --- a/implementation-contributed/javascriptcore/stress/bound-function-does-not-have-caller-and-arguments.js +++ /dev/null @@ -1,15 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testFunction(func) { - var array = Object.getOwnPropertyNames(func); - shouldBe(array.indexOf("arguments"), -1); - shouldBe(array.indexOf("caller"), -1); -} - -testFunction((() => { }).bind()); -testFunction((() => { "use strict"; }).bind()); -testFunction((function () { }).bind()); -testFunction((function () { "use strict"; }).bind()); diff --git a/implementation-contributed/javascriptcore/stress/bound-function-lazy-name-generation.js b/implementation-contributed/javascriptcore/stress/bound-function-lazy-name-generation.js deleted file mode 100644 index be1a747e3f..0000000000 --- a/implementation-contributed/javascriptcore/stress/bound-function-lazy-name-generation.js +++ /dev/null @@ -1,23 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion!"); -} - -function test() { - let f = function foo() { }.bind({}); - assert(f.name === "bound foo"); - - f = function () { }.bind({}); - assert(f.name === "bound "); - - f = function foo() { }.bind({}); - assert(Reflect.ownKeys(f).includes("name")); - assert(f.name === "bound foo"); - assert(Reflect.ownKeys(f).includes("name")); - - f = function foo() { }.bind({}); - assert(f.name === "bound foo"); - assert(Reflect.ownKeys(f).includes("name")); -} -for (let i = 0; i < 10000; i++) - test(); diff --git a/implementation-contributed/javascriptcore/stress/bound-function-tail-call-with-exception.js b/implementation-contributed/javascriptcore/stress/bound-function-tail-call-with-exception.js deleted file mode 100644 index f3ce6f7aa0..0000000000 --- a/implementation-contributed/javascriptcore/stress/bound-function-tail-call-with-exception.js +++ /dev/null @@ -1,23 +0,0 @@ -//@ runNoJIT - -function bar(a, idx) -{ - "use strict"; - if (idx > 0) - throw "Hello"; - return a; -} - -boundBar = bar.bind(null, 42); - -function foo(a, idx) -{ - "use strict"; - return boundBar(idx); -} - -boundFoo = foo.bind(null, 41); - -try { - boundFoo(1); -} catch(e) {} diff --git a/implementation-contributed/javascriptcore/stress/bound-function-uses-prototype.js b/implementation-contributed/javascriptcore/stress/bound-function-uses-prototype.js deleted file mode 100644 index 19dba2c71c..0000000000 --- a/implementation-contributed/javascriptcore/stress/bound-function-uses-prototype.js +++ /dev/null @@ -1,31 +0,0 @@ -// Test ES6 feature of using the bindee's prototype when binding a function. - -bind = Function.prototype.bind; - -function testChangeProto() { - function foo() { } - - foo.__proto__ = Object.prototype; - - let bar = bind.call(foo); - if (bar.__proto__ !== foo.__proto__) - throw "incorrect prototype"; - - foo.__proto__ = null; - bar = bind.call(foo); - if (bar.__proto__ !== foo.__proto__) - throw "cached prototype incorrectly" -} -testChangeProto(); - -function testBuiltins() { - let bar = bind.call(Array); - if (bar.__proto__ !== Array.__proto__) - throw "builtin prototype incorrect"; - - Array.__proto__ = null; - bar = bind.call(Array); - if (bar.__proto__ !== Array.__proto__) - throw "builtin prototype did not change correctly."; -} -testBuiltins(); diff --git a/implementation-contributed/javascriptcore/stress/bounds-check-not-eliminated-by-licm.js b/implementation-contributed/javascriptcore/stress/bounds-check-not-eliminated-by-licm.js deleted file mode 100644 index 0b3141e393..0000000000 --- a/implementation-contributed/javascriptcore/stress/bounds-check-not-eliminated-by-licm.js +++ /dev/null @@ -1,30 +0,0 @@ -function testInLoopTests(array, index) -{ - let arrayLength = array.length; - let sum = 0; - for (let i = 0; i < 10; ++i) { - if (index >= 0 && index < arrayLength) { - sum += array[index]; - } - } - return sum; -} -noInline(testInLoopTests); - - -let testArray = [1, 2, 3]; - -// Warmup "in-bounds" up to FTL. -for (let i = 0; i < 1e5; ++i) { - if (testInLoopTests(testArray, 1) !== 20) - throw "Failed testInLoopTests(testArray, 1)" - if (testInLoopTests(testArray, 2) !== 30) - throw "Failed testInLoopTests(testArray, 2)" -} - -let largeIntResult = testInLoopTests(testArray, 2147483647); -if (largeIntResult !== 0) - throw "Failed testInLoopTests(testArray, 2147483647)"; -let smallIntResult = testInLoopTests(testArray, -2147483647); -if (smallIntResult !== 0) - throw "Failed testInLoopTests(testArray, -2147483647)"; diff --git a/implementation-contributed/javascriptcore/stress/branch-check-int32-on-boolean-to-number-untyped.js b/implementation-contributed/javascriptcore/stress/branch-check-int32-on-boolean-to-number-untyped.js deleted file mode 100644 index 8f4af0b3cf..0000000000 --- a/implementation-contributed/javascriptcore/stress/branch-check-int32-on-boolean-to-number-untyped.js +++ /dev/null @@ -1,23 +0,0 @@ -function foo(o) { - if (o.f) - return "yes"; - else - return "no"; -} - -noInline(foo); - -function test(value, expected) { - var result = foo({f:value}); - if (result != expected) - throw "Error: bad result for " + value + ": " + result; -} - -for (var i = 0; i < 10000; ++i) { - test(1, "yes"); - test(0, "no"); - test(true, "yes"); - test(false, "no"); -} - -test("yes", "yes"); diff --git a/implementation-contributed/javascriptcore/stress/branch-check-number-on-boolean-to-number-untyped.js b/implementation-contributed/javascriptcore/stress/branch-check-number-on-boolean-to-number-untyped.js deleted file mode 100644 index d6099a9a94..0000000000 --- a/implementation-contributed/javascriptcore/stress/branch-check-number-on-boolean-to-number-untyped.js +++ /dev/null @@ -1,23 +0,0 @@ -function foo(o) { - if (o.f) - return "yes"; - else - return "no"; -} - -noInline(foo); - -function test(value, expected) { - var result = foo({f:value}); - if (result != expected) - throw "Error: bad result for " + value + ": " + result; -} - -for (var i = 0; i < 10000; ++i) { - test(1.5, "yes"); - test(0.0, "no"); - test(true, "yes"); - test(false, "no"); -} - -test("yes", "yes"); diff --git a/implementation-contributed/javascriptcore/stress/branch-may-exit-due-to-object-or-other-use-kind.js b/implementation-contributed/javascriptcore/stress/branch-may-exit-due-to-object-or-other-use-kind.js deleted file mode 100644 index aee19edc1f..0000000000 --- a/implementation-contributed/javascriptcore/stress/branch-may-exit-due-to-object-or-other-use-kind.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2015 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. ``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 - * 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. - */ - -// Regression test for https://bugs.webkit.org/show_bug.cgi?id=144152 - -// The bug in 144152 needs 3 conditions to manifest: -// 1. The branch test value in the inlined function is of useKind ObjectOrOtherUse. -// 2. The branch test value is proven to be a known useKind. -// 3. The masqueradesAsUndefined watchpoint is no longer valid. -// With the bug fixed, this test should not crash on debug builds. - -function inlinedFunction(x) { - if (x) // Conditional branch that will assert on a debug build if the bug is present. - new Object; -} - -function foo(x) { - if (x) // Testing x before calling the inlined function sets up condition 2. - inlinedFunction(x); -} - -makeMasquerader(); // Invalidates the masqueradesAsUndefined watchpoint for condition 3. -for (var i = 0; i < 10000; i++) - foo({}); // Pass an object argument to set up condition 1. diff --git a/implementation-contributed/javascriptcore/stress/broken-have-a-bad-time-with-arguments-for-gc-testing.js b/implementation-contributed/javascriptcore/stress/broken-have-a-bad-time-with-arguments-for-gc-testing.js deleted file mode 100644 index 2857b04638..0000000000 --- a/implementation-contributed/javascriptcore/stress/broken-have-a-bad-time-with-arguments-for-gc-testing.js +++ /dev/null @@ -1,140 +0,0 @@ -//@ runFTLNoCJIT - -// Tests accessing an element in arguments before and after having a bad time. -// This test should not crash. - -let verbose = false; - -var utilities = 'function shouldEqual(testId, actual, expected) {' + '\n' + - ' if (actual != expected)' + '\n' + - ' throw testId + ": ERROR: expect " + expected + ", actual " + actual;' + '\n' + - '}' + '\n'; - -var haveABadTime = 'Object.defineProperty(Object.prototype, 20, { get() { return 20; } });' + '\n'; - -var directArgumentsDecl = ' var args = arguments;' + '\n'; - -var scopedArgumentsDecl = ' var args = arguments;' + '\n' + - ' function closure() { return x; }' + '\n'; - -var clonedArgumentsDecl = ' "use strict";' + '\n' + - ' var args = arguments;' + '\n'; - -function testFunction(argsDecl, insertElementAction, indexToReturn) { - var script = 'function test(x) {' + '\n' + - argsDecl + - insertElementAction + - ' return args[' + indexToReturn + '];' + '\n' + - '}' + '\n' + - 'noInline(test);' + '\n'; - return script; -} - -function warmupFunction(tierWarmupCount, testArgs) { - var script = 'function warmup() {' + '\n' + - ' for (var i = 0; i < ' + tierWarmupCount + '; i++) {' + '\n' + - ' test(' + testArgs + ');' + '\n' + - ' }' + '\n' + - '}' + '\n'; - return script; -} - -let argumentsDecls = { - direct: directArgumentsDecl, - scoped: scopedArgumentsDecl, - cloned: clonedArgumentsDecl -}; - -let indicesToReturn = { - inBounds: 0, - outOfBoundsInsertedElement: 10, - outOfBoundsInPrototype: 20 -}; - -let tierWarmupCounts = { - llint: 1, - baseline: 50, - dfg: 1000, - ftl: 10000 -}; - -let testArgsList = { - noArgs: { - args: '', - result: { - inBounds: { beforeBadTime: 'undefined', afterBadTime: 'undefined', }, - outOfBoundsInsertedElement: { beforeBadTime: '10', afterBadTime: '10', }, - outOfBoundsInPrototype: { beforeBadTime: 'undefined', afterBadTime: '20', }, - } - }, - someArgs: { - args: '1, 2, 3', - result: { - inBounds: { beforeBadTime: '1', afterBadTime: '1', }, - outOfBoundsInsertedElement: { beforeBadTime: '10', afterBadTime: '10', }, - outOfBoundsInPrototype: { beforeBadTime: 'undefined', afterBadTime: '20', }, - } - } -}; - -let insertElementActions = { - insertElement: ' args[10] = 10;' + '\n', - dontInsertElement: '' -}; - -for (let argsDeclIndex in argumentsDecls) { - let argsDecl = argumentsDecls[argsDeclIndex]; - - for (let indexToReturnIndex in indicesToReturn) { - let indexToReturn = indicesToReturn[indexToReturnIndex]; - - for (let insertElementActionIndex in insertElementActions) { - let insertElementAction = insertElementActions[insertElementActionIndex]; - - for (let tierWarmupCountIndex in tierWarmupCounts) { - let tierWarmupCount = tierWarmupCounts[tierWarmupCountIndex]; - - for (let testArgsIndex in testArgsList) { - let testArgs = testArgsList[testArgsIndex].args; - let expectedResult = testArgsList[testArgsIndex].result[indexToReturnIndex]; - - if (indexToReturnIndex == 'outOfBoundsInsertedElement' - && insertElementActionIndex == 'dontInsertElement') - expectedResult = 'undefined'; - - let testName = - argsDeclIndex + '-' + - indexToReturnIndex + '-' + - insertElementActionIndex + '-' + - tierWarmupCountIndex + '-' + - testArgsIndex; - - - let script = utilities + - testFunction(argsDecl, insertElementAction, indexToReturn) + - warmupFunction(tierWarmupCount, testArgs) + - 'warmup()' + '\n' + - 'shouldEqual(10000, test(' + testArgs + '), ' + expectedResult['beforeBadTime'] + ');' + '\n'; - haveABadTime + - 'shouldEqual(20000, test(' + testArgs + '), ' + expectedResult['afterBadTime'] + ');' + '\n'; - - if (verbose) { - print('Running test configuration: ' + testName); - print( - 'Test script: ====================================================\n' + - script + - '=== END script =================================================='); - } - - try { - runString(script); - } catch (e) { - print('FAILED test configuration: ' + testName); - print('FAILED test script:\n' + script); - throw e; - } - } - } - } - } -} diff --git a/implementation-contributed/javascriptcore/stress/cached-prototype-setter.js b/implementation-contributed/javascriptcore/stress/cached-prototype-setter.js deleted file mode 100644 index ed27108eb3..0000000000 --- a/implementation-contributed/javascriptcore/stress/cached-prototype-setter.js +++ /dev/null @@ -1,45 +0,0 @@ -// [ARM] stress/cached-prototype-setter.js.no-llint fails intermittently on Aarch64 Linux -// https://bugs.webkit.org/show_bug.cgi?id=142277 -//@ skip if $architecture == "arm64" and $hostOS == "linux" - -(function() { - var xSetterCalled = false; - - function MyConstructor() - { - this.x = 1; - } - - new MyConstructor; - new MyConstructor; - function setter() { - xSetterCalled = true; - } - Object.prototype.__defineSetter__("x", setter); - new MyConstructor; - - if (!xSetterCalled) - throw new Error("FAIL: 'x' setter was not called."); -})(); - -(function() { - var xSetterCalled = false; - - function makeO() - { - var o = { }; - o.x = 1; - return o; - } - - makeO(); - makeO(); - function setter(x) { - xSetterCalled = true; - } - Object.prototype.__defineSetter__("x", setter); - makeO(); - - if (!xSetterCalled) - throw new Error("FAIL: 'x' setter was not called."); -})(); diff --git a/implementation-contributed/javascriptcore/stress/call-apply-builtin-functions-dont-use-iterators.js b/implementation-contributed/javascriptcore/stress/call-apply-builtin-functions-dont-use-iterators.js deleted file mode 100644 index c4d33edca7..0000000000 --- a/implementation-contributed/javascriptcore/stress/call-apply-builtin-functions-dont-use-iterators.js +++ /dev/null @@ -1,27 +0,0 @@ -(function(){ - "use strict"; - var it = [][Symbol.iterator](); - while (it) { - if (it.hasOwnProperty('next')) - delete it.next; - it = Object.getPrototypeOf(it); - } - - var bind = Function.prototype.bind; - var uncurryThis = bind.bind(bind.call); - - var bindFn = uncurryThis(bind); - var applyFn = uncurryThis(bind.apply); - function test() { print("here"); } - var sliceFn = uncurryThis([].slice); - function addAll(var_args) { - var args = sliceFn(arguments, 0); - var result = this; - for (var i = 0; i < args.length; i++) - result += args[i]; - return result; - } - if (applyFn(addAll, 3, [4, 5, 6]) !== 18) - throw "incorrect result"; - -})(); diff --git a/implementation-contributed/javascriptcore/stress/call-apply-exponential-bytecode-size.js b/implementation-contributed/javascriptcore/stress/call-apply-exponential-bytecode-size.js deleted file mode 100644 index 3ab699c73c..0000000000 --- a/implementation-contributed/javascriptcore/stress/call-apply-exponential-bytecode-size.js +++ /dev/null @@ -1,109 +0,0 @@ -// This test seems to require 64 MB for the executable memory pool. As per -// jit/ExecutableAllocator.cpp, it is 64 MB or above only for arm64 and -// x86-64. -//@skip if $architecture != "arm64" and $architecture != "x86-64" -"use strict"; - -function assert(b) { - if (!b) - throw new Error(); -} - -const inc = (x, y) => { return x + 1; } -const inc2 = (x, y) => { return y ? y + 1 : x + 1; } -function bar() { - return inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, 1))))))))))))))))))))); -} -assert(bar() === 22); - -function randomApplyOrCall(bias, size, dontSpreadBias = 0) { - let cur = `1`; - for (let i = 0; i < size; ++i) { - if (Math.random() >= bias) { - if (Math.random() >= dontSpreadBias) - cur = `inc.call(null, ${cur})`; - else - cur = `inc.call(...[null, ${cur}])`; - } else { - if (Math.random() >= dontSpreadBias) - cur = `inc.apply(null, [${cur}])`; - else - cur = `inc.apply(...[null, [${cur}]])`; - } - } - - if (bias > 0.85) { - cur = `let random = ${Math.random()}; ${cur}`; - } - - return eval(cur); -} - -const depth = 100; -assert(randomApplyOrCall(0, depth) === depth + 1); -assert(randomApplyOrCall(1, depth) === depth + 1); -assert(randomApplyOrCall(0, depth, 0) === depth + 1); -assert(randomApplyOrCall(1, depth, 1) === depth + 1); -for (let i = 0; i < 1000; ++i) { - assert(randomApplyOrCall(Math.random(), depth) === depth + 1); - assert(randomApplyOrCall(Math.random(), depth + 1, Math.random()) === depth + 2); -} - -function baz() { - return inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, 1)))))))))))))))))))), - inc.call(null, inc.call(null, 1))); -} -assert(baz() === 22); - -function jaz() { - return inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.apply(null, [inc.call(null, inc.call(null, - inc.call(null, 1)))]))))))))))))))))), - inc.call(null, inc.call(null, inc.apply(null, [1])))); -} -assert(jaz() === 22); - -function haz() { - return inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.apply(null, [inc.call(null, inc.call(null, - inc.call(null, 1)))]))))))))))))))))), - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.call(null, inc.call(null, inc.call(null, - inc.call(null, inc.apply(null, [inc.call(null, inc.call(null, - inc.call(null, 1)))]))))))))))))))))))); -} -assert(haz() === 22); - -function foo() { - return inc2.call(null, inc2.call(null, inc2.call(null, inc2.call(null, - inc2.call(null, inc2.call(null, inc2.call(null, inc2.call(null, - inc2.call(null, inc2.call(null, inc2.call(null, inc2.call(null, - inc2.call(null, inc2.call(null, inc2.call(null, inc2.call(null, - inc2.call(null, inc2.apply(null, [inc2.call(null, inc2.call(null, - inc2.call(null, 1)))]))))))))))))))))), - inc2.call(null, inc2.call(null, inc2.call(null, inc2.call(null, - inc2.call(null, inc2.call(null, inc2.call(null, inc2.call(null, - inc2.call(null, inc2.call(null, inc2.call(null, inc2.call(null, - inc2.call(null, inc2.call(null, inc2.call(null, inc2.call(null, - inc2.call(null, inc2.apply(null, [inc2.call(null, inc2.call(null, - inc2.call(null, inc2.call(null, inc.call(null, 1)))))]))))))))))))))))))); -} -assert(foo() === 25); diff --git a/implementation-contributed/javascriptcore/stress/call-forward-varargs-for-inlined-escaped-arguments.js b/implementation-contributed/javascriptcore/stress/call-forward-varargs-for-inlined-escaped-arguments.js deleted file mode 100644 index 475850681e..0000000000 --- a/implementation-contributed/javascriptcore/stress/call-forward-varargs-for-inlined-escaped-arguments.js +++ /dev/null @@ -1,23 +0,0 @@ -function foo() { - return arguments; -} - -function baz(a, b, c) { - return a + b + c; -} - -noInline(baz); - -function bar(a, b, c) { - var args = foo(b, c, 42); - return baz.apply(void 0, args); -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var result = bar(1, 2, 3); - if (result != 47) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/call-non-calleable-constructors-as-function.js b/implementation-contributed/javascriptcore/stress/call-non-calleable-constructors-as-function.js deleted file mode 100644 index e921b7e4b2..0000000000 --- a/implementation-contributed/javascriptcore/stress/call-non-calleable-constructors-as-function.js +++ /dev/null @@ -1,59 +0,0 @@ -var errors = ""; -var numTests = 0; - -function test(type) { - var didThrow = false; - try { - var bad = type(10); - } catch(e) { - didThrow = true; - } - - if (!didThrow) { - errors += ("bad result: calling " + type.name + " as a function did not throw\n"); - } - numTests++; - - if (typeof type !== "function") - errors += ("bad result: typeof " + type.name + " is not function. Was " + (typeof type) + "\n"); - numTests++; -} - -// According to the spec, the constructors of the following types "are not intended to be -// called as a function and will throw an exception". However, as constructors, their -// type should be "function". - -// https://tc39.github.io/ecma262/#sec-typedarray-constructors -test(Int8Array); -test(Uint8Array); -test(Uint8ClampedArray); -test(Int16Array); -test(Uint16Array); -test(Int32Array); -test(Uint32Array); -test(Float32Array); -test(Float64Array); - -// https://tc39.github.io/ecma262/#sec-map-constructor -test(Map); -// https://tc39.github.io/ecma262/#sec-set-constructor -test(Set); -// https://tc39.github.io/ecma262/#sec-weakmap-constructor -test(WeakMap); -// https://tc39.github.io/ecma262/#sec-weakset-constructor -test(WeakSet); -// https://tc39.github.io/ecma262/#sec-arraybuffer-constructor -test(ArrayBuffer); -// https://tc39.github.io/ecma262/#sec-dataview-constructor -test(DataView); -// https://tc39.github.io/ecma262/#sec-promise-constructor -test(Promise); -// https://tc39.github.io/ecma262/#sec-proxy-constructor -test(Proxy); - -let expectedNumTests = 34; -if (numTests != expectedNumTests) { - errors += "Not all tests were run: ran " + numTests + " out of " + expectedNumTests + " \n"; -} -if (errors.length) - throw new Error(errors); diff --git a/implementation-contributed/javascriptcore/stress/call-object-constructor.js b/implementation-contributed/javascriptcore/stress/call-object-constructor.js deleted file mode 100644 index ee1fea19bd..0000000000 --- a/implementation-contributed/javascriptcore/stress/call-object-constructor.js +++ /dev/null @@ -1,18 +0,0 @@ -function test(n) { - return n === Object(n); -} -noInline(test); - -function assert(condition) { - if (!condition) - throw new Error("assertion failed"); -} - -for (i = 0; i < 100000; i++) { - assert(!test(null)); - assert(!test(undefined)); - assert(!test(1)); - assert(!test("")); - assert(!test(Symbol.iterator)); - assert(test({})); -} diff --git a/implementation-contributed/javascriptcore/stress/call-varargs-double-new-array-buffer.js b/implementation-contributed/javascriptcore/stress/call-varargs-double-new-array-buffer.js deleted file mode 100644 index 156030b7d0..0000000000 --- a/implementation-contributed/javascriptcore/stress/call-varargs-double-new-array-buffer.js +++ /dev/null @@ -1,33 +0,0 @@ -function assert(b, m = "") { - if (!b) - throw new Error("Bad assert: " + m); -} -noInline(assert); - -function bar(...args) { - return args; -} -noInline(bar); - -function foo(a, ...args) { - let x = bar(...args, 42, ...[0.5, 1.5, 2.5, 3.5, 4.5], ...args); - return x; -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - let r = foo(i, i+1, i+2, i+3); - assert(r.length === 12); - assert(r[0] === i+1, JSON.stringify(r)); - assert(r[1] === i+2, JSON.stringify(r)); - assert(r[2] === i+3, JSON.stringify(r)); - assert(r[3] === 42, JSON.stringify(r)); - assert(r[4] === 0.5, JSON.stringify(r)); - assert(r[5] === 1.5, JSON.stringify(r)); - assert(r[6] === 2.5, JSON.stringify(r)); - assert(r[7] === 3.5, JSON.stringify(r)); - assert(r[8] === 4.5, JSON.stringify(r)); - assert(r[9] === i+1, JSON.stringify(r)); - assert(r[10] === i+2, JSON.stringify(r)); - assert(r[11] === i+3, JSON.stringify(r)); -} diff --git a/implementation-contributed/javascriptcore/stress/call-varargs-from-inlined-code-with-odd-number-of-arguments.js b/implementation-contributed/javascriptcore/stress/call-varargs-from-inlined-code-with-odd-number-of-arguments.js deleted file mode 100644 index b8d4395ccd..0000000000 --- a/implementation-contributed/javascriptcore/stress/call-varargs-from-inlined-code-with-odd-number-of-arguments.js +++ /dev/null @@ -1,30 +0,0 @@ -// [DFG] call-varargs-from-inlined-code-with-odd-number-of-arguments.js fails in POSIX environment if SamplingProfiler is enabled -// https://bugs.webkit.org/show_bug.cgi?id=153704 -//@ if $hostOS == "linux" then defaultNoSamplingProfilerRun else defaultRun end - -function foo(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) { - return a * 2 + b * 3 + c * 5 + d * 7 + e * 11 + f * 13 + g * 17 + h * 19 + i * 23 + j * 29 + k * 31 + l * 37 + m * 41 + n * 43 + o * 47 + p * 53 + q * 59 + r * 61 + s * 67 + t * 71 + u * 73 + v * 79 + w * 83 + x * 89 + y * 97; -} - -function bar() { - return foo.apply(this, arguments); -} - -function baz(x) { - return bar(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25) + x; -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - var result = baz(0); - if (result != 21586 - 26 * 101) - throw "Error: bad result: " + result; -} - -// Force recompilation. -for (var i = 0; i < 10000; ++i) { - var result = baz(2147483646); - if (result != 2147502606) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/call-varargs-from-inlined-code.js b/implementation-contributed/javascriptcore/stress/call-varargs-from-inlined-code.js deleted file mode 100644 index 3484bdacd0..0000000000 --- a/implementation-contributed/javascriptcore/stress/call-varargs-from-inlined-code.js +++ /dev/null @@ -1,30 +0,0 @@ -// [DFG] call-varargs-from-inlined-code-with-odd-number-of-arguments.js fails in POSIX environment if SamplingProfiler is enabled -// https://bugs.webkit.org/show_bug.cgi?id=153704 -//@ if $hostOS == "linux" then defaultNoSamplingProfilerRun else defaultRun end - -function foo(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) { - return a * 2 + b * 3 + c * 5 + d * 7 + e * 11 + f * 13 + g * 17 + h * 19 + i * 23 + j * 29 + k * 31 + l * 37 + m * 41 + n * 43 + o * 47 + p * 53 + q * 59 + r * 61 + s * 67 + t * 71 + u * 73 + v * 79 + w * 83 + x * 89 + y * 97 + z * 101; -} - -function bar() { - return foo.apply(this, arguments); -} - -function baz(x) { - return bar(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26) + x; -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - var result = baz(0); - if (result != 21586) - throw "Error: bad result: " + result; -} - -// Force recompilation. -for (var i = 0; i < 10000; ++i) { - var result = baz(2147483646); - if (result != 2147505232) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/call-varargs-length-effects.js b/implementation-contributed/javascriptcore/stress/call-varargs-length-effects.js deleted file mode 100644 index 03bcfd7eed..0000000000 --- a/implementation-contributed/javascriptcore/stress/call-varargs-length-effects.js +++ /dev/null @@ -1,24 +0,0 @@ -function foo() { return arguments.length; } - -var o = {}; -o[0] = 42; -var callCount = 0; -o.__defineGetter__("length", function() { - callCount++; - return 1; -}); - -function bar() { - callCount = 0; - var result = foo.apply(this, o); - if (result != 1) - throw "Error: bad result: " + result; - if (callCount != 1) - throw "Error: bad call count: " + callCount; -} - -noInline(foo); -noInline(bar); - -for (var i = 0; i < 10000; ++i) - bar(); diff --git a/implementation-contributed/javascriptcore/stress/call-varargs-spread-new-array-buffer.js b/implementation-contributed/javascriptcore/stress/call-varargs-spread-new-array-buffer.js deleted file mode 100644 index 6a5c8d3985..0000000000 --- a/implementation-contributed/javascriptcore/stress/call-varargs-spread-new-array-buffer.js +++ /dev/null @@ -1,29 +0,0 @@ -function assert(b, m = "") { - if (!b) - throw new Error("Bad assert: " + m); -} -noInline(assert); - -function bar(...args) { - return args; -} -noInline(bar); - -function foo() { - let args = [1, 2, 3]; - let x = bar(...args, 42, ...args); - return x; -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - let r = foo(); - assert(r.length === 7); - assert(r[0] === 1, JSON.stringify(r)); - assert(r[1] === 2, JSON.stringify(r)); - assert(r[2] === 3, JSON.stringify(r)); - assert(r[3] === 42, JSON.stringify(r)); - assert(r[4] === 1, JSON.stringify(r)); - assert(r[5] === 2, JSON.stringify(r)); - assert(r[6] === 3, JSON.stringify(r)); -} diff --git a/implementation-contributed/javascriptcore/stress/call-varargs-spread-new-array-buffer2.js b/implementation-contributed/javascriptcore/stress/call-varargs-spread-new-array-buffer2.js deleted file mode 100644 index d2f8ad8da4..0000000000 --- a/implementation-contributed/javascriptcore/stress/call-varargs-spread-new-array-buffer2.js +++ /dev/null @@ -1,33 +0,0 @@ -function assert(b, m = "") { - if (!b) - throw new Error("Bad assert: " + m); -} -noInline(assert); - -function bar(...args) { - return args; -} -noInline(bar); - -function foo(a, ...args) { - let x = bar(...args, 42, ...[0, 1, 2, 3, 4], ...args); - return x; -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - let r = foo(i, i+1, i+2, i+3); - assert(r.length === 12); - assert(r[0] === i+1, JSON.stringify(r)); - assert(r[1] === i+2, JSON.stringify(r)); - assert(r[2] === i+3, JSON.stringify(r)); - assert(r[3] === 42, JSON.stringify(r)); - assert(r[4] === 0, JSON.stringify(r)); - assert(r[5] === 1, JSON.stringify(r)); - assert(r[6] === 2, JSON.stringify(r)); - assert(r[7] === 3, JSON.stringify(r)); - assert(r[8] === 4, JSON.stringify(r)); - assert(r[9] === i+1, JSON.stringify(r)); - assert(r[10] === i+2, JSON.stringify(r)); - assert(r[11] === i+3, JSON.stringify(r)); -} diff --git a/implementation-contributed/javascriptcore/stress/call-varargs-spread.js b/implementation-contributed/javascriptcore/stress/call-varargs-spread.js deleted file mode 100644 index 0e19c88854..0000000000 --- a/implementation-contributed/javascriptcore/stress/call-varargs-spread.js +++ /dev/null @@ -1,28 +0,0 @@ -function assert(b, m = "") { - if (!b) - throw new Error("Bad assert: " + m); -} -noInline(assert); - -function bar(...args) { - return args; -} -noInline(bar); - -function foo(a, ...args) { - let x = bar(...args, 42, ...args); - return x; -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - let r = foo(i, i+1, i+2, i+3); - assert(r.length === 7); - assert(r[0] === i+1, JSON.stringify(r)); - assert(r[1] === i+2, JSON.stringify(r)); - assert(r[2] === i+3, JSON.stringify(r)); - assert(r[3] === 42, JSON.stringify(r)); - assert(r[4] === i+1, JSON.stringify(r)); - assert(r[5] === i+2, JSON.stringify(r)); - assert(r[6] === i+3, JSON.stringify(r)); -} diff --git a/implementation-contributed/javascriptcore/stress/call-varargs-with-different-arguments-length-after-warmup.js b/implementation-contributed/javascriptcore/stress/call-varargs-with-different-arguments-length-after-warmup.js deleted file mode 100644 index a96e254d32..0000000000 --- a/implementation-contributed/javascriptcore/stress/call-varargs-with-different-arguments-length-after-warmup.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2015 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. ``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 - * 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. - */ - -// Regression test for https://bugs.webkit.org/show_bug.cgi?id=143407. - -var verbose = false; - -function foo() { - return arguments.length; -} - -function Foo() { - this.length = arguments.length; -} - -var callTestBodyStr = -" var result = this.method.apply(this, arguments);" + "\n" + -" return result + 1;"; - -var constructTestBodyStr = -" return new this.constructor(...arguments);"; - -var tiers = [ - { name: "LLint", iterations: 10 }, - { name: "BaselineJIT", iterations: 50 }, - { name: "DFG", iterations: 500 }, - { name: "FTL", iterations: 10000 }, -]; - -function doTest(testCategory, testBodyStr, tier) { - try { - var iterations = tiers[tier].iterations; - if (verbose) - print("Testing " + testCategory + " tier " + tiers[tier].name + " by iterating " + iterations + " times"); - - var o = {} - o.method = foo; - o.constructor = Foo; - o.trigger = new Function(testBodyStr); - - for (var i = 0; i < iterations; i++) - o.trigger(o, 1); - o.trigger(o, 1, 2); - - } catch (e) { - print("FAILED " + testCategory + " in tier " + tiers[tier].name + ": " + e); - return false; - } - return true; -} - -var failureFound = 0; - -for (var tier = 0; tier < tiers.length; tier++) { - if (!doTest("op_call_varargs", callTestBodyStr, tier)) - failureFound++; -} - -for (var tier = 0; tier < tiers.length; tier++) { - if (!doTest("op_construct_varargs", constructTestBodyStr, tier)) - failureFound++; -} - -if (failureFound == 1) - throw "ERROR: test has 1 failure"; -else if (failureFound > 1) - throw "ERROR: test has " + failureFound + " failures"; -else if (verbose) - print("No failures"); diff --git a/implementation-contributed/javascriptcore/stress/caller-and-arguments-properties-for-functions-that-dont-have-them.js b/implementation-contributed/javascriptcore/stress/caller-and-arguments-properties-for-functions-that-dont-have-them.js deleted file mode 100644 index c9b119ebe7..0000000000 --- a/implementation-contributed/javascriptcore/stress/caller-and-arguments-properties-for-functions-that-dont-have-them.js +++ /dev/null @@ -1,74 +0,0 @@ -function assert(b) { - if (!b) - throw new Error; -} - -function test1(f) { - f.__proto__ = {}; - Object.defineProperty(f, "caller", {value:42}); - assert(f.caller === 42); - Object.defineProperty(f, "arguments", {value:32}); - assert(f.arguments === 32); -} -for (let i = 0; i < 1000; ++i) { - test1(function () { "use strict"; }); - test1(class C { }); - test1(() => undefined); - test1(async function foo(){}); - test1(function* foo() { }); -} - -function test2(f, p = {}) { - f.__proto__ = p; - f.caller = 42; - assert(f.caller === 42); - f.arguments = 44; - assert(f.arguments === 44); -} - -{ - let proxy = new Proxy({}, { - has(...args) { - throw new Error("Should not be called!"); - } - }); - for (let i = 0; i < 1000; ++i) { - test2(function () { "use strict"; }, proxy); - test2(class C { }, proxy); - test2(() => undefined, proxy); - test2(async function foo(){}, proxy); - test2(function* foo() { }, proxy); - } -} - -for (let i = 0; i < 1000; ++i) { - test2(function () { "use strict"; }); - test2(class C { }); - test2(() => undefined); - test2(async function foo(){}); - test2(function* foo() { }); -} - -function test3(f) { - f.__proto__ = {}; - f.caller = 42; - assert(f.caller === 42); - assert(f.hasOwnProperty("caller")); - assert(delete f.caller === true); - assert(f.caller === undefined); - assert(!f.hasOwnProperty("caller")); - - f.arguments = 44; - assert(f.arguments === 44); - assert(f.hasOwnProperty("arguments")); - assert(delete f.arguments === true); - assert(f.arguments === undefined); - assert(!f.hasOwnProperty("arguments")); -} -for (let i = 0; i < 1000; ++i) { - test3(function () { "use strict"; }); - test3(class C { }); - test3(() => undefined); - test3(async function foo(){}); - test3(function* foo() { }); -} diff --git a/implementation-contributed/javascriptcore/stress/caller-native-code.js b/implementation-contributed/javascriptcore/stress/caller-native-code.js deleted file mode 100644 index 132305c045..0000000000 --- a/implementation-contributed/javascriptcore/stress/caller-native-code.js +++ /dev/null @@ -1,25 +0,0 @@ -function f() { - foo = f.caller; -} - -// Test C++ code constructor -new Number({ valueOf: f }); - -if (foo !== null) - throw new Error(foo); - -foo = 1; - -// Test C++ function. -[1].slice({ valueOf: f }); - -if (foo !== null) - throw new Error(foo); - -foo = 1; - -// Test builtin js code -[1].map(f) - -if (foo !== null) - throw new Error(foo); diff --git a/implementation-contributed/javascriptcore/stress/capture-escape-and-throw.js b/implementation-contributed/javascriptcore/stress/capture-escape-and-throw.js deleted file mode 100644 index c77497c536..0000000000 --- a/implementation-contributed/javascriptcore/stress/capture-escape-and-throw.js +++ /dev/null @@ -1,28 +0,0 @@ -var f; - -function foo(s) { - var x = 1; - f = function() { return x; }; - x = 2; - new Array(s); - x = 3; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) - foo(1); - -var didThrow = false; -try { - foo(-1); -} catch (e) { - didThrow = e; -} - -if (("" + didThrow).indexOf("RangeError") != 0) - throw "Error: did not throw right exception: " + didThrow; - -var result = f(); -if (result != 2) - throw "Error: bad result from f(): " + result; diff --git a/implementation-contributed/javascriptcore/stress/captured-arguments-variable.js b/implementation-contributed/javascriptcore/stress/captured-arguments-variable.js deleted file mode 100644 index a0e68e4ef8..0000000000 --- a/implementation-contributed/javascriptcore/stress/captured-arguments-variable.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo(a) { - return arguments[1] + (function() { return a * 101; })(); -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(42, 97); - if (result != 4339) - throw "Error: bad result: " + result; -} - -Object.prototype[1] = 111; - -var result = foo(42); -if (result != 4353) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz1.js b/implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz1.js deleted file mode 100644 index 64b9bc34b3..0000000000 --- a/implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz1.js +++ /dev/null @@ -1,10 +0,0 @@ -// This test should not crash. -var caughtReferenceError = false; -try { - try { throw [void 0]; } catch ([{constructor} = new constructor]) { } -} catch (e) { - caughtReferenceError = true; -} - -if (!caughtReferenceError) - throw Error("Missing ReferenceError"); diff --git a/implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz2.js b/implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz2.js deleted file mode 100644 index 39a573acaf..0000000000 --- a/implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz2.js +++ /dev/null @@ -1,10 +0,0 @@ -// This test should not crash. -var caughtReferenceError = false; -try { - try { throw []; } catch ({c = new class extends C {}, constructor: C}) { } -} catch (e) { - caughtReferenceError = true; -} - -if (!caughtReferenceError) - throw Error("Missing ReferenceError"); diff --git a/implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz3.js b/implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz3.js deleted file mode 100644 index fe33f3945d..0000000000 --- a/implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz3.js +++ /dev/null @@ -1,10 +0,0 @@ -// This test should not crash. -var caughtReferenceError = false; -try { - try { throw {}; } catch ({a = (print(a), b), b}) { } -} catch (e) { - caughtReferenceError = true; -} - -if (!caughtReferenceError) - throw Error("Missing ReferenceError"); diff --git a/implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz4.js b/implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz4.js deleted file mode 100644 index 5d6b2cc65b..0000000000 --- a/implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz4.js +++ /dev/null @@ -1,11 +0,0 @@ -// This test should not crash. -var caughtReferenceError = false; -try { - function* m(){ try {throw [void 0]} catch ([c = (yield c)]) {} } - [...m()] -} catch (e) { - caughtReferenceError = true; -} - -if (!caughtReferenceError) - throw Error("Missing ReferenceError"); diff --git a/implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz5.js b/implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz5.js deleted file mode 100644 index 02462bc13f..0000000000 --- a/implementation-contributed/javascriptcore/stress/catch-clause-should-be-under-tdz5.js +++ /dev/null @@ -1,10 +0,0 @@ -// This test should not crash. -var caughtReferenceError = false; -try { - while(1) try {throw {}} catch({a=({}={__proto__}), __proto__}){} -} catch (e) { - caughtReferenceError = true; -} - -if (!caughtReferenceError) - throw Error("Missing ReferenceError"); diff --git a/implementation-contributed/javascriptcore/stress/catch-parameter-destructuring.js b/implementation-contributed/javascriptcore/stress/catch-parameter-destructuring.js deleted file mode 100644 index 50d225e1e6..0000000000 --- a/implementation-contributed/javascriptcore/stress/catch-parameter-destructuring.js +++ /dev/null @@ -1,146 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -class CallGuard { - constructor() - { - this.called = false; - } - - call() - { - this.called = true; - } -} - -(function () { - let guard = new CallGuard(); - try { - throw { value: 42, done: false }; - } catch ({ value, done }) { - shouldBe(value, 42); - shouldBe(done, false); - guard.call(); - } - shouldBe(guard.called, true); -}()); - -(function () { - let guard = new CallGuard(); - try { - throw { value: 42, done: false }; - } catch ({ value: v, done: d }) { - shouldBe(v, 42); - shouldBe(d, false); - guard.call(); - } - shouldBe(guard.called, true); - // lexical - shouldBe(typeof v, "undefined"); - shouldBe(typeof d, "undefined"); -}()); - -shouldThrow(function () { - try { - throw { get error() { throw new Error("OK"); } }; - } catch ({ error }) { - } -}, `Error: OK`); - -let guard = new CallGuard(); -shouldThrow(function () { - try { - throw { get error() { throw new Error("OK"); } }; - } catch ({ error }) { - } finally { - guard.call(); - } -}, `Error: OK`); -shouldBe(guard.called, true); - -(function initialize() { - let guard = new CallGuard(); - try { - throw { value: 42, done: false }; - } catch ({ value, done, hello = 44 }) { - shouldBe(value, 42); - shouldBe(done, false); - shouldBe(hello, 44); - guard.call(); - } - shouldBe(guard.called, true); -}()); - -(function array() { - let guard = new CallGuard(); - try { - throw [0, 1, 2, 3, 4, 5]; - } catch ([ a, b, c, ...d ]) { - shouldBe(a, 0); - shouldBe(b, 1); - shouldBe(c, 2); - shouldBe(JSON.stringify(d), `[3,4,5]`); - guard.call(); - } - shouldBe(guard.called, true); -}()); - -(function generator() { - function *gen(v) { - try { - throw v; - } catch ({ value = yield 42 }) { - yield value; - } - } - - { - let g = gen({}); - { - let { value, done } = g.next(); - shouldBe(value, 42); - shouldBe(done, false); - } - { - let { value, done } = g.next("OK"); - shouldBe(value, "OK"); - shouldBe(done, false); - } - { - let { value, done } = g.next("OK"); - shouldBe(value, undefined); - shouldBe(done, true); - } - } - - { - let g = gen({value: 400}); - { - let { value, done } = g.next(); - shouldBe(value, 400); - shouldBe(done, false); - } - { - let { value, done } = g.next("OK"); - shouldBe(value, undefined); - shouldBe(done, true); - } - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/catch-parameter-syntax.js b/implementation-contributed/javascriptcore/stress/catch-parameter-syntax.js deleted file mode 100644 index 68f855fa43..0000000000 --- a/implementation-contributed/javascriptcore/stress/catch-parameter-syntax.js +++ /dev/null @@ -1,171 +0,0 @@ -function testSyntax(script) { - try { - eval(script); - } catch (error) { - if (error instanceof SyntaxError) - throw new Error("Bad error: " + String(error)); - } -} - -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -testSyntaxError(` -(function () { - try { - } catch ([a, a]) { - } -}) -`, `SyntaxError: Unexpected identifier 'a'. Cannot declare a lexical variable twice: 'a'.`); - -testSyntaxError(` -(function () { - try { - } catch ({ a, b:a }) { - } -}) -`, `SyntaxError: Unexpected identifier 'a'. Cannot declare a lexical variable twice: 'a'.`); - -testSyntax(` -(function () { - try { - } catch (let) { - } -}) -`, ``); - -testSyntax(` -(function () { - try { - } catch ([let]) { - } -}) -`, ``); - -testSyntaxError(` -(function () { - 'use strict'; - try { - } catch (let) { - } -}) -`, `SyntaxError: Cannot use 'let' as a catch parameter name in strict mode.`); - -testSyntaxError(` -(function () { - 'use strict'; - try { - } catch ([let]) { - } -}) -`, `SyntaxError: Cannot use 'let' as a catch parameter name in strict mode.`); - - -testSyntax(` -(function () { - try { - } catch (yield) { - } -}) -`); - -testSyntax(` -(function () { - try { - } catch ([yield]) { - } -}) -`); - -testSyntaxError(` -(function () { - 'use strict'; - try { - } catch (yield) { - } -}) -`, `SyntaxError: Cannot use 'yield' as a catch parameter name in strict mode.`); - -testSyntaxError(` -(function () { - 'use strict'; - try { - } catch ([yield]) { - } -}) -`, `SyntaxError: Cannot use 'yield' as a catch parameter name in strict mode.`); - -testSyntaxError(` -(function () { - try { - } catch (yield = 20) { - } -}) -`, `SyntaxError: Unexpected token '='. Expected ')' to end a 'catch' target.`); - -testSyntax(` -(function () { - try { - } catch ([...yield]) { - } -}) -`); - -testSyntax(` -(function () { - try { - } catch ([yield = 30]) { - } -}) -`); - -testSyntax(` -(function () { - try { - } catch ({ yield = 30 }) { - } -}) -`); - -testSyntaxError(` -(function () { - try { - } catch (...Hello) { - } -}) -`, `SyntaxError: Unexpected token '...'. Expected a parameter pattern or a ')' in parameter list.`); - -testSyntaxError(` -(function *() { - try { - } catch (yield) { - } -}) -`, `SyntaxError: Cannot use 'yield' as a catch parameter name in a generator function.`); - -testSyntax(` -(function *() { - try { - } catch ({ value = yield 42 }) { - } -}) -`); - -testSyntax(` -(function *() { - try { - } catch ({ value = yield }) { - } -}) -`); diff --git a/implementation-contributed/javascriptcore/stress/catch-set-argument-speculation-failure.js b/implementation-contributed/javascriptcore/stress/catch-set-argument-speculation-failure.js deleted file mode 100644 index 12f939d9bd..0000000000 --- a/implementation-contributed/javascriptcore/stress/catch-set-argument-speculation-failure.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; - -let flag = true; -function o() { - if (flag) - return {x:20}; - return {y:20, x:20}; -} -noInline(o); - -let counter = 0; -function e() { - if ((++counter) % 50 === 0) - throw new Error; -} -noInline(e); - -let counter2 = 0; -function e2() { - if ((++counter2) % 2 === 0) - throw new Error; -} -noInline(e2); - -function escape(){ } -noInline(escape); - -function baz(o) { - try { - e(); - escape(o.x); - } catch(e) { - escape(o.x); - e2(); - } finally { - o.x; - } -} -noInline(baz); - -{ - let o = {x:20}; - function run() { - for (let i = 0; i < 1000; ++i) { - try { - baz(o); - } catch { } - } - } - run(); - o = {y:40, x:20}; - run(); -} diff --git a/implementation-contributed/javascriptcore/stress/catch-variables-under-tdz.js b/implementation-contributed/javascriptcore/stress/catch-variables-under-tdz.js deleted file mode 100644 index 0f9838508f..0000000000 --- a/implementation-contributed/javascriptcore/stress/catch-variables-under-tdz.js +++ /dev/null @@ -1,21 +0,0 @@ -function test(s) { - for (let i = 0; i < 100; i++) { - let threw = false; - try { - let evalString = `try { throw new Error } catch(${s}) { }`; - eval(evalString); - } catch(e) { - threw = e instanceof ReferenceError; - } - if (!threw) - throw new Error("Bad test!"); - } -} - -test("{a = a}"); -test("{a = eval('a')}"); -test("{a = eval('a + a')}"); -test("{a = eval('b'), b}"); -test("{a = eval('b + b'), b}"); -test("{a = eval('b + b'), b = 20}"); -test("{a = b+b, b = 20}"); diff --git a/implementation-contributed/javascriptcore/stress/check-string-ident.js b/implementation-contributed/javascriptcore/stress/check-string-ident.js deleted file mode 100644 index fc17421798..0000000000 --- a/implementation-contributed/javascriptcore/stress/check-string-ident.js +++ /dev/null @@ -1,16 +0,0 @@ -// Skipped due to flakiness, used defaultNoEagerRun before. -//@ skip - -const o = { baz: 20 }; -function foo(p) { - o[p] = 20; -} -noInline(foo); -noOSRExitFuzzing(foo); - -for (let i = 0; i < 1000000; i++) { - foo("baz"); -} - -if (numberOfDFGCompiles(foo) > 1) - throw new Error("We should not have to compile this function more than once."); diff --git a/implementation-contributed/javascriptcore/stress/check-structure-ir-ensures-empty-does-not-flow-through.js b/implementation-contributed/javascriptcore/stress/check-structure-ir-ensures-empty-does-not-flow-through.js deleted file mode 100644 index 5f906d0f99..0000000000 --- a/implementation-contributed/javascriptcore/stress/check-structure-ir-ensures-empty-does-not-flow-through.js +++ /dev/null @@ -1,26 +0,0 @@ -function runNearStackLimit(f) { - function t() { - try { - return t(); - } catch (e) { - return f(); - } - } - return t() -} - -function test() { - function f(arg) { - let loc = arg; - try { - loc.p = 0; - } catch (e) {} - arg.p = 1; - } - let obj = {}; - runNearStackLimit(() => { - return f(obj); - }); -} -for (let i = 0; i < 50; ++i) - test(); diff --git a/implementation-contributed/javascriptcore/stress/chill-mod-chill-mod.js b/implementation-contributed/javascriptcore/stress/chill-mod-chill-mod.js deleted file mode 100644 index e5e770f83c..0000000000 --- a/implementation-contributed/javascriptcore/stress/chill-mod-chill-mod.js +++ /dev/null @@ -1,10 +0,0 @@ -function foo(a, b) -{ - return (~~(a % b)) + (~~(b % a)); -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) - foo(1, 2); - diff --git a/implementation-contributed/javascriptcore/stress/class-derived-from-null.js b/implementation-contributed/javascriptcore/stress/class-derived-from-null.js deleted file mode 100644 index a1053c03e0..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-derived-from-null.js +++ /dev/null @@ -1,130 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad!") -} - -function assertThrow(cb, errorMessage) { - let error; - try { - cb(); - } catch (e) { - error = e; - } - if (!error || !(error instanceof Error)) - throw new Error("Error is expected!"); - - if (error.toString() !== errorMessage) - throw new Error("Error: `" + errorMessage + "` is expected, but was `" + error.toString() + "`"); -} - -function test(f, count = 1000) { - for (let i = 0; i < count; i++) - f(); -} - -function test1() { - class C extends null { } - assertThrow(() => (new C), 'TypeError: function is not a constructor (evaluating \'super(...args)\')'); - assert(Reflect.getPrototypeOf(C.prototype) === null); - - let o = {} - class D extends null { - constructor() { - return o; - } - } - assert(new D === o); - assert(Reflect.getPrototypeOf(D.prototype) === null); - - class E extends null { - constructor() { - return this; - } - } - assertThrow(()=>(new E), 'ReferenceError: Cannot access uninitialized variable.'); - assert(Reflect.getPrototypeOf(E.prototype) === null); -} -test(test1); - -function jsNull() { return null; } -function test2() { - class C extends jsNull() { } - assertThrow(() => (new C), 'TypeError: function is not a constructor (evaluating \'super(...args)\')'); - assert(Reflect.getPrototypeOf(C.prototype) === null); - - let o = {} - class D extends jsNull() { - constructor() { - return o; - } - } - assert(new D === o); - assert(Reflect.getPrototypeOf(D.prototype) === null); - - class E extends jsNull() { - constructor() { - return this; - } - } - assert(() => (new E), 'ReferenceError: Cannot access uninitialized variable.'); - assert(Reflect.getPrototypeOf(E.prototype) === null); -} -test(test2); - -function test3() { - class C extends jsNull() { constructor() { super(); } } - let threw = false; - try { - new C; - } catch(e) { - threw = e.toString() === "TypeError: function is not a constructor (evaluating 'super()')"; - } - assert(threw); - - class D extends jsNull() { constructor() { let arr = ()=>super(); arr(); } } - threw = false; - try { - new D; - } catch(e) { - threw = e.toString() === "TypeError: function is not a constructor (evaluating 'super()')"; - } - assert(threw); - - class E extends jsNull() { constructor() { let arr = ()=>super(); return this; } } - assert(()=>(new E), 'ReferenceError: Cannot access uninitialized variable.'); - assert(Reflect.getPrototypeOf(E.prototype) === null); -} -test(test3); - -function test4() { - class E extends jsNull() { constructor() { return 25; } } - assert(() => (new E), 'ReferenceError: Cannot access uninitialized variable.'); - assert(Reflect.getPrototypeOf(E.prototype) === null); -} -test(test4); - -function test5() { - class E extends jsNull() { constructor() { let arr = ()=>this; return arr(); } } - assert(()=>(new E), 'ReferenceError: Cannot access uninitialized variable.'); - assert(Reflect.getPrototypeOf(E.prototype) === null); -} -test(test5); - -function test6() { - class Base { } - class D extends Base { } - class E extends jsNull() { constructor() { let ret = this; return ret; } } - class F extends jsNull() { constructor() { return 25; } } - class G extends jsNull() { constructor() { super(); } } - assertThrow(() => Reflect.construct(E, [], D), 'ReferenceError: Cannot access uninitialized variable.'); - assertThrow(() => Reflect.construct(F, [], D), 'TypeError: Cannot return a non-object type in the constructor of a derived class.'); - - let threw = false; - try { - Reflect.construct(G, [], D); - } catch(e) { - threw = e.toString() === "TypeError: function is not a constructor (evaluating 'super()')"; - } - assert(threw); -} -test(test6); diff --git a/implementation-contributed/javascriptcore/stress/class-expression-generates-environment.js b/implementation-contributed/javascriptcore/stress/class-expression-generates-environment.js deleted file mode 100644 index d59170631f..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-expression-generates-environment.js +++ /dev/null @@ -1,64 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -(function () { - class A { - method() { - shouldBe(typeof A, 'function'); - } - - static staticMethod() { - shouldBe(typeof A, 'function'); - } - } - - let originalA = A; - - originalA.staticMethod(); - (new originalA()).method(); - A = undefined; - originalA.staticMethod(); - (new originalA()).method(); -}()); - - -(function () { - class A { - method() { - shouldThrow(() => { - A = 42; - }, `TypeError: Attempted to assign to readonly property.`); - } - - static staticMethod() { - shouldThrow(() => { - A = 42; - }, `TypeError: Attempted to assign to readonly property.`); - } - } - - let originalA = A; - - originalA.staticMethod(); - (new originalA()).method(); - A = undefined; - originalA.staticMethod(); - (new originalA()).method(); -}()); diff --git a/implementation-contributed/javascriptcore/stress/class-expression-should-be-tdz-in-heritage.js b/implementation-contributed/javascriptcore/stress/class-expression-should-be-tdz-in-heritage.js deleted file mode 100644 index 0f140ae17c..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-expression-should-be-tdz-in-heritage.js +++ /dev/null @@ -1,20 +0,0 @@ -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - - -shouldThrow(function () { - class A extends A { - } -}, `ReferenceError: Cannot access uninitialized variable.`); diff --git a/implementation-contributed/javascriptcore/stress/class-method-does-not-declare-variable-to-upper-scope.js b/implementation-contributed/javascriptcore/stress/class-method-does-not-declare-variable-to-upper-scope.js deleted file mode 100644 index 5fc6a1bb9d..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-method-does-not-declare-variable-to-upper-scope.js +++ /dev/null @@ -1,29 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -// This is the minimized test case for the crash. -// https://bugs.webkit.org/show_bug.cgi?id=150115 -(function () { - eval("class A { static 1() { return 405 } };"); -}()); - -(function () { - class A { - method() { - shouldBe(typeof staticMethod, 'undefined'); - } - - static staticMethod() { - shouldBe(typeof method, 'undefined'); - } - } - - shouldBe(typeof method, 'undefined'); - shouldBe(typeof staticMethod, 'undefined'); - - let a = new A(); - a.method(); - A.staticMethod(); -}()); diff --git a/implementation-contributed/javascriptcore/stress/class-static-get-weird.js b/implementation-contributed/javascriptcore/stress/class-static-get-weird.js deleted file mode 100644 index 02f967e688..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-static-get-weird.js +++ /dev/null @@ -1,19 +0,0 @@ -{ - class c { static get name() { return 42; } } - if (c.name !== 42) throw "Fail"; -} - -{ - class c { static get arguments() { return 42; } } - if (c.arguments !== 42) throw "Fail"; -} - -{ - class c { static get caller() { return 42; } } - if (c.caller !== 42) throw "Fail"; -} - -{ - class c { static get length() { return 42; } } - if (c.length !== 42) throw "Fail"; -} diff --git a/implementation-contributed/javascriptcore/stress/class-subclassing-array.js b/implementation-contributed/javascriptcore/stress/class-subclassing-array.js deleted file mode 100644 index 2868796bd4..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-subclassing-array.js +++ /dev/null @@ -1,35 +0,0 @@ -// This file tests subclassing arrays. - -class A extends Array { } -class B extends A { get 1() { return 1; } } -class C extends B { } - -function test() { - - a = new A(); - b = new B(); - c = new C(); - - if (!Array.isArray(a) || !Array.isArray(b) || !Array.isArray(c)) - throw "subclasses are not arrays"; - - if (!(a instanceof Array && a instanceof A)) - throw "b has incorrect prototype chain"; - - if (!(b instanceof Array && b instanceof A && b instanceof B)) - throw "b has incorrect prototype chain"; - - if (!(c instanceof Array && c instanceof A && c instanceof B && c instanceof C)) - throw "c has incorrect prototype chain"; - - a[1] = 2; - b[1] = 2; - c[1] = 2; - - if (a[1] !== 2 || b[1] !== 1 || c[1] !== 1) - throw "bad indexing type"; -} -noInline(test); - -for(i = 0; i < 10000; i++) - test(); diff --git a/implementation-contributed/javascriptcore/stress/class-subclassing-function.js b/implementation-contributed/javascriptcore/stress/class-subclassing-function.js deleted file mode 100644 index b26f1783b0..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-subclassing-function.js +++ /dev/null @@ -1,37 +0,0 @@ -F = class extends Function { } -N = class extends null { } - -function test(i) { - - let f = new F("x", "return x + " + i + ";"); - let C = new F("x", "this.x = x; this.i = " + i); - - if (!(f instanceof Function && f instanceof F)) - throw "bad chain"; - - if (f(1) !== i+1) - throw "function was not called correctly"; - - let o = new C("hello"); - if (o.x !== "hello" || o.i !== i) - throw "function as constructor was not correct"; - - let g = new F("x", "y", "return this.foo + x + y"); - if (g.call({foo:1}, 1, 1) !== 3) - throw "function was not .callable"; - - let g2 = g.bind({foo:1}, 1); - if (!(g2 instanceof F)) - throw "the binding of a subclass should inherit from the bound function's class"; - - if (g2(1) !== 3) - throw "binding didn't work"; - - let bound = C.bind(null) - if (bound.__proto__ !== C.__proto__) - throw "binding with null as prototype didn't work"; -} -noInline(test); - -for (i = 0; i < 10000; i++) - test(i); diff --git a/implementation-contributed/javascriptcore/stress/class-subclassing-misc.js b/implementation-contributed/javascriptcore/stress/class-subclassing-misc.js deleted file mode 100644 index c37482032d..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-subclassing-misc.js +++ /dev/null @@ -1,59 +0,0 @@ -// This file tests subclassing various misc constructors. - -class A extends ArrayBuffer { } -class B extends Boolean { } -class D extends Date { } -class E extends Error { } -class N extends Number { } -class M extends Map { } -class R extends RegExp { } -class S extends Set { } -class WM extends WeakMap { } -class WS extends WeakSet { } - -function test() { - - a = new A(10); - if (!(a instanceof ArrayBuffer && a instanceof A)) - throw "a has incorrect prototype chain"; - - b = new B(true); - if (!(b instanceof Boolean && b instanceof B)) - throw "b has incorrect prototype chain"; - - d = new D(); - if (!(d instanceof Date && d instanceof D)) - throw "d has incorrect prototype chain"; - - e = new E(); - if (!(e instanceof Error && e instanceof E)) - throw "e has incorrect prototype chain"; - - n = new N(10); - if (!(n instanceof Number && n instanceof N)) - throw "n has incorrect prototype chain"; - - m = new M(); - if (!(m instanceof Map && m instanceof M)) - throw "m has incorrect prototype chain"; - - r = new R("foo"); - if (!(r instanceof RegExp && r instanceof R)) - throw "r has incorrect prototype chain"; - - s = new S(); - if (!(s instanceof Set && s instanceof S)) - throw "s has incorrect prototype chain"; - - wm = new WM(); - if (!(wm instanceof WeakMap && wm instanceof WM)) - throw "wm has incorrect prototype chain"; - - ws = new WS(); - if (!(ws instanceof WeakSet && ws instanceof WS)) - throw "ws has incorrect prototype chain"; -} -noInline(test); - -for(i = 0; i < 10000; i++) - test(); diff --git a/implementation-contributed/javascriptcore/stress/class-subclassing-string.js b/implementation-contributed/javascriptcore/stress/class-subclassing-string.js deleted file mode 100644 index bd9b37729b..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-subclassing-string.js +++ /dev/null @@ -1,38 +0,0 @@ -A = class extends String { } -B = class extends A { get 4() { return 1; } } -C = class extends B { } - -A.prototype[3] = 1; - -function test() { - let a = new A("foo"); - let b = new B("baz"); - let c = new C("bar"); - - // String objects have a non-writable length property - a.length = 1; - b.length = 1; - c.length = 1; - - if (a.length !== 3 || b.length !== 3 || c.length !== 3) - throw "not string objects"; - - if (!(a instanceof A && a instanceof String)) - throw "a has incorrect prototype chain"; - - if (!(b instanceof B && b instanceof A && b instanceof String)) - throw "b has incorrect prototype chain"; - - if (!(c instanceof C && c instanceof B && c instanceof A && c instanceof String)) - throw "c has incorrect prototype chain"; - - if (a[4] !== undefined || b[4] !== 1 || c[4] !== 1) - throw "bad indexing type with accessors on chain"; - - if (a[3] !== 1 || b[3] !== 1 || c[3] !== 1) - throw "bad indexing type with values on chain"; -} -noInline(test); - -for (i = 0; i < 10000; i++) - test(); diff --git a/implementation-contributed/javascriptcore/stress/class-subclassing-typedarray.js b/implementation-contributed/javascriptcore/stress/class-subclassing-typedarray.js deleted file mode 100644 index 328669870c..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-subclassing-typedarray.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -let typedArrays = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array]; - -let subclasses = typedArrays.map(constructor => class extends constructor { }); - -function checkSubclass(constructor) { - let inst = new constructor(10); - inst[11] = 10; - if (!(inst instanceof constructor && inst instanceof constructor.__proto__ && inst[11] === undefined)) - throw "subclass of " + constructor.__proto__ + " was incorrect"; -} - -function test() { - subclasses.forEach(checkSubclass); -} - -for (var i = 0; i < 10000; i++) - test(); diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-block-scoping.js b/implementation-contributed/javascriptcore/stress/class-syntax-block-scoping.js deleted file mode 100644 index f3526f9bab..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-block-scoping.js +++ /dev/null @@ -1,49 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Assertion failure"); -} -noInline(assert); - -function truth() { return true; } -noInline(truth); - -const NUM_LOOPS = 1000; - -;(function() { - function foo() { - let first; - let second; - class A {}; - first = A; - if (truth()) { - class A {}; - second = A; - } - assert(first !== second); - } - function baz() { - class A { static hello() { return 10; } }; - assert(A.hello() === 10); - if (truth()) { - class A { static hello() { return 20; } }; - assert(A.hello() === 20); - } - assert(A.hello() === 10); - } - function bar() { - class A { static hello() { return 10; } }; - let capA = function() { return A; } - assert(A.hello() === 10); - if (truth()) { - class A { static hello() { return 20; } }; - let capA = function() { return A; } - assert(A.hello() === 20); - } - assert(A.hello() === 10); - } - for (let i = 0; i < NUM_LOOPS; i++) { - foo(); - bar(); - baz(); - } -})(); diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-definition-semantics.js b/implementation-contributed/javascriptcore/stress/class-syntax-definition-semantics.js deleted file mode 100644 index c925283943..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-definition-semantics.js +++ /dev/null @@ -1,36 +0,0 @@ - -function shouldBeSyntaxError(s) { - let isSyntaxError = false; - try { - eval(s); - } catch(e) { - if (e instanceof SyntaxError) - isSyntaxError = true; - } - if (!isSyntaxError) - throw new Error("expected a syntax error"); -} -noInline(shouldBeSyntaxError); - -function shouldNotBeSyntaxError(s) { - let isSyntaxError = false; - try { - eval(s); - } catch(e) { - if (e instanceof SyntaxError) - isSyntaxError = true; - } - if (isSyntaxError) - throw new Error("did not expect a syntax error"); -} - -function truth() { return true; } -noInline(truth); - -shouldBeSyntaxError("class A { }; class A { };"); -shouldBeSyntaxError("function foo() { class A { }; class A { }; }"); -shouldBeSyntaxError("function foo() { if (truth()) { class A { }; class A { }; } }"); -shouldBeSyntaxError("switch(10) { case 10: class A { }; break; case 20: class A { } }"); -shouldBeSyntaxError("if (truth()) class A { }"); -shouldNotBeSyntaxError("switch(10) { case 10: { class A { }; break; } case 20: class A { } }"); -shouldNotBeSyntaxError("class A { } if (truth()) { class A { } }"); diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-derived-default-constructor.js b/implementation-contributed/javascriptcore/stress/class-syntax-derived-default-constructor.js deleted file mode 100644 index f0c477e5f5..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-derived-default-constructor.js +++ /dev/null @@ -1,26 +0,0 @@ - -var A = class A { }; -var B = class B extends A { }; -var C = class C extends B { constructor() { super(); } }; - -noInline(C); - -(function() { - var x; - for (var i = 0; i < 1e5; ++i) - x = new C(false); -})(); - -var D = class D extends A { constructor() { - super(...arguments); - return function () { return arguments; } -} }; -var E = class E extends D { constructor() { super(); } }; - -noInline(E); - -(function() { - var x; - for (var i = 0; i < 1e5; ++i) - x = new C(false); -})(); diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-double-constructor.js b/implementation-contributed/javascriptcore/stress/class-syntax-double-constructor.js deleted file mode 100644 index 71fac0403d..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-double-constructor.js +++ /dev/null @@ -1,183 +0,0 @@ -const oneCallOfParentConstructor = 1; -const twoCallOfParentConstructor = 2; - -function tryCatch(klass) { - let result = false; - try { - new klass(); - } catch(e) { - result = e instanceof ReferenceError; - } - return result; -} - -var testCase = function (actual, expected, message) { - if (actual !== expected) { - throw message + ". Expected '" + expected + "', but was '" + actual + "'"; - } -}; - -let count = 0; -class A { - constructor() { - this.id = 0; - count++; - } -} - -class B extends A { - constructor() { - super(); - super(); - super(); - } -} - -testCase(tryCatch(B), true, 'Error: ReferenceError was not raised in case of two or more call super() #1'); -testCase(count, twoCallOfParentConstructor, 'Excpected two call of parent constructor #1'); - -count = 0; -class C extends A { - constructor() { - (()=>super())(); - (()=>super())(); - (()=>super())(); - } -} - -testCase(tryCatch(C), true, 'Error: ReferenceError was not raised in case of two or more call super() in arrrow function #2'); -testCase(count, twoCallOfParentConstructor, 'Excpected two call of parent constructor in arrow function #2'); - -count = 0; -class D extends A { - constructor() { - eval('super()'); - eval('super()'); - eval('super()'); - } -} - -testCase(tryCatch(D), true, 'Error: ReferenceError was not raised in case of two or more call super() in eval #3'); -testCase(count, twoCallOfParentConstructor, 'Excpected two call of parent constructor in eval #3'); - -count = 0; -class E extends A { - constructor() { - (()=>eval('super()'))(); - (()=>eval('super()'))(); - (()=>eval('super()'))(); - } -} - -testCase(tryCatch(E), true, 'Error: ReferenceError was not raised in case of two or more call super() in eval within arrow function #4'); -testCase(count, twoCallOfParentConstructor, 'Excpected two call of parent constructor in eval within arrow function #4'); - -count = 0; -class F extends A { - constructor() { - super(); - var arrow = () => 'testValue'; - arrow(); - } -} - -testCase(tryCatch(F), false, 'Error: ReferenceError was raised but should not be #5'); -testCase(count, oneCallOfParentConstructor, 'Excpected two call of parent constructor #5'); - -count = 0; -class G extends A { - constructor() { - super(); - eval('(()=>"abc")()'); - } -} - -testCase(tryCatch(G), false, 'Error: ReferenceError was raised but should not be #6'); -testCase(count, oneCallOfParentConstructor, 'Excpected two call of parent constructor #6'); - -count = 0; -class H extends A { - constructor() { - eval('(()=>eval("super()"))()'); - try { - eval('(()=>eval("super()"))()'); - } catch(e) { - let result = e instanceof ReferenceError; - if (!result) throw new Error('Wrong type error'); - } - try { - eval('(()=>eval("super()"))()'); - } catch(e) { - let result = e instanceof ReferenceError; - if (!result) throw new Error('Wrong type error'); - } - try { - eval('(()=>eval("super()"))()'); - } catch(e) { - let result = e instanceof ReferenceError; - if (!result) throw new Error('Wrong type error'); - } - } -} - -testCase(tryCatch(H), false, 'Error: ReferenceError was raised but should not be #7'); -testCase(count, 4, 'Excpected two call of parent constructor #7'); - -noInline(B); -for (var i = 0; i < 10000; i++) { - count = 0; - let result = false; - try { - new B(); - } catch(e) { - result = e instanceof ReferenceError; - } - - testCase(result, true, ''); - testCase(count, 2, ''); -} - -count = 0; -class I extends A { - constructor() { - super(); - (()=>super())(); - } -} - -testCase(tryCatch(I), true, 'Error: ReferenceError was not raised in case of two or more call super() #8'); -testCase(count, 2, 'Excpected two call of parent constructor #8'); - -count = 0; -class J extends A { - constructor() { - super(); - eval('super()'); - } -} - -testCase(tryCatch(J), true, 'Error: ReferenceError was not raised in case of two or more call super() #9'); -testCase(count, 2, 'Excpected two call of parent constructor #9'); - -let maxCount = 150000; -class K extends A { - constructor(i) { - if (i % 2 === 0 ) - super(); - if (i % 2 !== 0 || maxCount === i) - super(); - } -} - -noInline(K); -let result = false; -try { - count = 0; - for (var i = 1; i <= maxCount; i++) { - new K(i); - } -} catch (e) { - result = e instanceof ReferenceError; -} -testCase(result, true, 'Error: ReferenceError was not raised in case of two or more call super() #10'); -testCase(count, maxCount + 1, 'Excpected a lot of calls of parent constructor #10'); diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-no-loop-tdz.js b/implementation-contributed/javascriptcore/stress/class-syntax-no-loop-tdz.js deleted file mode 100644 index 87a65cb73e..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-no-loop-tdz.js +++ /dev/null @@ -1,20 +0,0 @@ - -class A { - constructor() { } -} - -class B extends A { - constructor() { - for (var j = 0; j < 10; j++) { - if (!j) - super(); - else - this; - } - } -} - -noInline(B); - -for (var i = 0; i < 10000; ++i) - new B(); diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-catch.js b/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-catch.js deleted file mode 100644 index 05d144a4b5..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-catch.js +++ /dev/null @@ -1,19 +0,0 @@ - -class A { - constructor() { } -} - -class B extends A { - constructor() { - try { - this; - } catch (e) { - super(); - } - } -} - -noInline(B); - -for (var i = 0; i < 10000; ++i) - new B(); diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-conditional.js b/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-conditional.js deleted file mode 100644 index 71276b17ba..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-conditional.js +++ /dev/null @@ -1,18 +0,0 @@ - -class A { - constructor() { } -} - -class B extends A { - constructor(accessThisBeforeSuper) { - if (accessThisBeforeSuper) - this; - else - super(); - } -} - -noInline(B); - -for (var i = 0; i < 10000; ++i) - new B(false); diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-eval.js b/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-eval.js deleted file mode 100644 index 93bcd31b4c..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-eval.js +++ /dev/null @@ -1,18 +0,0 @@ - -class A { - constructor() { } -} - -class B extends A { - constructor(shouldAccessThis) { - var evalFunction = eval; - evalFunction("this"); - eval("shouldAccessThis ? this : null"); - super(); - } -} - -noInline(B); - -for (var i = 0; i < 1e4; ++i) - new B(false); diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-loop-no-inline-super.js b/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-loop-no-inline-super.js deleted file mode 100644 index 533a4adf4a..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-loop-no-inline-super.js +++ /dev/null @@ -1,25 +0,0 @@ - -class A { - constructor() { } -} - -noInline(A); - -class B extends A { - constructor() { - var values = []; - for (var j = 0; j < 100; j++) { - if (j == 1) - super(); - else if (j > 2) - this; - else - values.push(i); - } - } -} - -noInline(B); - -for (var i = 0; i < 10000; ++i) - new B(); diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-loop.js b/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-loop.js deleted file mode 100644 index 574bc1076e..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz-in-loop.js +++ /dev/null @@ -1,23 +0,0 @@ - -class A { - constructor() { } -} - -class B extends A { - constructor() { - var values = []; - for (var j = 0; j < 100; j++) { - if (j == 1) - super(); - else if (j > 2) - this; - else - values.push(i); - } - } -} - -noInline(B); - -for (var i = 0; i < 10000; ++i) - new B(); diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz.js b/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz.js deleted file mode 100644 index b0c7c310e6..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-no-tdz.js +++ /dev/null @@ -1,16 +0,0 @@ - -class A { - constructor() { } -} - -class B extends A { - constructor() { - super(); - this; - } -} - -noInline(B); - -for (var i = 0; i < 10000; ++i) - new B(); diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-super-in-eval.js b/implementation-contributed/javascriptcore/stress/class-syntax-super-in-eval.js deleted file mode 100644 index 3c3552ef00..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-super-in-eval.js +++ /dev/null @@ -1,93 +0,0 @@ -var testValue = 'test-value'; - -class A { - constructor() { - this.value = testValue; - } -} - -class B extends A { - constructor(tdz) { - if (tdz) - this.id = 'id'; - eval('super()'); - } -} - -var b = new B(false); -if (b.value !== testValue) - throw new Error("wrong value"); - -noInline(B); - -let checkTDZ = function (klass, i) { - var exception; - try { - new klass(true); - } catch (e) { - exception = e; - if (!(e instanceof ReferenceError)) - throw "Exception thrown in iteration " + i + " was not a reference error"; - } - if (!exception) - throw "Exception not thrown for an unitialized this at iteration " + i; -} - -for (var i = 0; i < 1e4; ++i) { - checkTDZ(B); -} - -class C extends A { - constructor(tdz) { - if (tdz) - this.id = 'id'; - eval("eval('super()')"); - } -} - -var c = new C(false); -if (c.value !== testValue) - throw new Error("wrong value"); - -for (var i = 0; i < 1e4; ++i) { - checkTDZ(C); -} - -class D extends A { - constructor(tdz) { - if (tdz) - this.id = 'id'; - eval("eval(\"eval('super()')\")"); - } -} - -var d = new D(false); -if (d.value !== testValue) - throw new Error("wrong value"); - -for (var i = 0; i < 1e4; ++i) { - checkTDZ(D); -} - -var getEval = function (count) { - var newCount = count - 1; - return newCount === 0 - ? 'super()' - : 'eval(getEval(' + newCount + '))'; -}; - -class E extends A { - constructor(tdz) { - if (tdz) - this.id = 'id'; - eval(getEval(10)); - } -} - -var e = new E(false); -if (e.value !== testValue) - throw new Error("wrong value"); - -for (var i = 0; i < 1000; ++i) { - checkTDZ(E); -} diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-tdz-in-catch.js b/implementation-contributed/javascriptcore/stress/class-syntax-tdz-in-catch.js deleted file mode 100644 index 3704bcfcd8..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-tdz-in-catch.js +++ /dev/null @@ -1,30 +0,0 @@ - -class A { - constructor() { } -} - -class B extends A { - constructor() { - try { - this; - } catch (e) { - this; - super(); - } - } -} - -noInline(B); - -for (var i = 0; i < 10000; ++i) { - var exception = null; - try { - new B(false); - } catch (e) { - exception = e; - if (!(e instanceof ReferenceError)) - throw "Exception thrown in iteration " + i + " was not a reference error"; - } - if (!exception) - throw "Exception not thrown for an unitialized this at iteration " + i; -} diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-tdz-in-conditional.js b/implementation-contributed/javascriptcore/stress/class-syntax-tdz-in-conditional.js deleted file mode 100644 index 27d0bcba84..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-tdz-in-conditional.js +++ /dev/null @@ -1,28 +0,0 @@ - -class A { - constructor() { } -} - -class B extends A { - constructor(accessThisBeforeSuper) { - if (accessThisBeforeSuper) - this; - else { - this; - super(); - } - } -} - -noInline(B); - -for (var i = 0; i < 10000; ++i) { - var exception = null; - try { - new B(false); - } catch (e) { - exception = e; - } - if (!exception) - throw "Exception not thrown for an unitialized this at iteration " + i; -} diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-tdz-in-eval.js b/implementation-contributed/javascriptcore/stress/class-syntax-tdz-in-eval.js deleted file mode 100644 index e0c965be7e..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-tdz-in-eval.js +++ /dev/null @@ -1,26 +0,0 @@ - -class A { - constructor() { } -} - -class B extends A { - constructor() { - eval("this"); - super(); - } -} - -noInline(B); - -for (var i = 0; i < 1e4; ++i) { - var exception; - try { - new B(); - } catch (e) { - exception = e; - if (!(e instanceof ReferenceError)) - throw "Exception thrown in iteration " + i + " was not a reference error"; - } - if (!exception) - throw "Exception not thrown for an unitialized this at iteration " + i; -} diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-tdz-in-loop.js b/implementation-contributed/javascriptcore/stress/class-syntax-tdz-in-loop.js deleted file mode 100644 index 6ab5e6da7a..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-tdz-in-loop.js +++ /dev/null @@ -1,30 +0,0 @@ - -class A { - constructor() { } -} - -class B extends A { - constructor() { - for (var j = 0; j < 100; j++) { - if (j) - super(); - else - this; - } - } -} - -noInline(B); - -for (var i = 0; i < 10000; ++i) { - var exception = null; - try { - new B(); - } catch (e) { - exception = e; - if (!(e instanceof ReferenceError)) - throw "Exception thrown in iteration " + i + " was not a reference error"; - } - if (!exception) - throw "Exception not thrown for an unitialized this at iteration " + i; -} diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-tdz-osr-entry-in-loop.js b/implementation-contributed/javascriptcore/stress/class-syntax-tdz-osr-entry-in-loop.js deleted file mode 100644 index 12da75973f..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-tdz-osr-entry-in-loop.js +++ /dev/null @@ -1,58 +0,0 @@ - -class A { - constructor() { } -} - -class B extends A { - constructor(iterationCount) { - let values = []; - - for (let i = 2; i < iterationCount; ++i) { - // Let's keep the loop busy. - let divided = false; - for (let j = i - 1; j > 1; --j) { - if (!(i % j)) { - divided = true; - break; - } - } - if (!divided) - values.push(i); - - if (!(i % (iterationCount - 2))) - print(this); - else if (values.length == iterationCount) - super(values); - } - } -} - -noInline(B); - -// Small warm up with small iteration count. Try to get to DFG. -for (var i = 0; i < 30; ++i) { - var exception = null; - try { - new B(10); - } catch (e) { - exception = e; - if (!(e instanceof ReferenceError)) - throw "Exception thrown in iteration " + i + " was not a reference error"; - } - if (!exception) - throw "Exception not thrown for an unitialized this at iteration " + i; -} - -// Now try to go to FTL in the constructor. -for (var i = 0; i < 2; ++i) { - var exception = null; - try { - new B(7e3); - } catch (e) { - exception = e; - if (!(e instanceof ReferenceError)) - throw "Exception thrown in iteration " + i + " was not a reference error"; - } - if (!exception) - throw "Exception not thrown for an unitialized this at iteration " + i; -} diff --git a/implementation-contributed/javascriptcore/stress/class-syntax-tdz.js b/implementation-contributed/javascriptcore/stress/class-syntax-tdz.js deleted file mode 100644 index c14c66739e..0000000000 --- a/implementation-contributed/javascriptcore/stress/class-syntax-tdz.js +++ /dev/null @@ -1,80 +0,0 @@ - -class A { - constructor() { } -} - -class B extends A { - constructor() { - this; - super(); - } -} - -noInline(B); - -function assert(b) { - if (!b) - throw new Error("Assertion failure"); -} -noInline(assert); - -function shouldThrowTDZ(func) { - var hasThrown = false; - try { - func(); - } catch(e) { - if (e.name.indexOf("ReferenceError") !== -1) - hasThrown = true; - } - assert(hasThrown); -} -noInline(shouldThrowTDZ); - -function truth() { return true; } -noInline(truth); - -for (var i = 0; i < 100; ++i) { - var exception; - try { - new B(); - } catch (e) { - exception = e; - if (!(e instanceof ReferenceError)) - throw "Exception thrown in iteration " + i + " was not a reference error"; - } - if (!exception) - throw "Exception not thrown for an unitialized this at iteration " + i; -} - - - -;(function() { - function foo() { - return A; - class A { } - } - function bar() { - shouldThrowTDZ(function() { return A; }); - class A { } - } - function baz() { - class C { static m() { return "m"; } } - if (truth()) { - class B extends C { } - assert(B.m() === "m"); - } - class B extends A { } - class A { } - } - function taz() { - function f(x) { return x; } - class C extends f(C) { } - } - - for (var i = 0; i < 100; i++) { - shouldThrowTDZ(foo); - bar(); - shouldThrowTDZ(baz); - shouldThrowTDZ(taz); - } -})(); diff --git a/implementation-contributed/javascriptcore/stress/class_elements.js b/implementation-contributed/javascriptcore/stress/class_elements.js deleted file mode 100644 index 0c9ace37bd..0000000000 --- a/implementation-contributed/javascriptcore/stress/class_elements.js +++ /dev/null @@ -1,24 +0,0 @@ -function test() { - -let log = []; -function effect(desc) { log.push(desc); return desc; } - -class C { - [effect("instance#1")]() {} - static [effect("static#2")]() {} - get [effect("instanceGetter#3")]() {} - static get [effect("staticGetter#4")]() {} - set [effect("instanceSetter#5")](v) {} - static [effect("staticSetter#6")](v) {} -} - -return log[0] === "instance#1" && - log[1] === "static#2" && - log[2] === "instanceGetter#3" && - log[3] === "staticGetter#4" && - log[4] === "instanceSetter#5" && - log[5] === "staticSetter#6"; -} - -if (!test()) - throw new Error("Test failed"); \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/cloned-arguments-elimination.js b/implementation-contributed/javascriptcore/stress/cloned-arguments-elimination.js deleted file mode 100644 index 0e4e381cc0..0000000000 --- a/implementation-contributed/javascriptcore/stress/cloned-arguments-elimination.js +++ /dev/null @@ -1,33 +0,0 @@ -function testModifyLength() { - "use strict"; - - arguments.length = 10; - return arguments.length; -} -noInline(testModifyLength); - -function testAddOtherProperty() { - "use strict"; - - arguments.foo = 1; - return arguments.length; -} -noInline(testAddOtherProperty); - -function testAddOtherPropertyInBranch() { - "use strict"; - - if (arguments[0] % 2) - arguments.foo = 1; - return arguments.length; -} -noInline(testAddOtherPropertyInBranch); - -for (i = 0; i < 100000; i++) { - if (testModifyLength(1) !== 10) - throw "bad"; - if (testAddOtherProperty(1) !== 1) - throw "bad"; - if (testAddOtherPropertyInBranch(i) !== 1) - throw "bad"; -} diff --git a/implementation-contributed/javascriptcore/stress/cloned-arguments-get-by-val-double-array.js b/implementation-contributed/javascriptcore/stress/cloned-arguments-get-by-val-double-array.js deleted file mode 100644 index a026aff358..0000000000 --- a/implementation-contributed/javascriptcore/stress/cloned-arguments-get-by-val-double-array.js +++ /dev/null @@ -1,13 +0,0 @@ -function foo() { - "use strict"; - return arguments[0] + 1.5; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(4.2); - if (result != 5.7) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/cloned-arguments-modification.js b/implementation-contributed/javascriptcore/stress/cloned-arguments-modification.js deleted file mode 100644 index fdc261a267..0000000000 --- a/implementation-contributed/javascriptcore/stress/cloned-arguments-modification.js +++ /dev/null @@ -1,37 +0,0 @@ -function foo() { - "use strict"; - - if (arguments[Symbol.iterator] !== Array.prototype.values) - throw "Symbol.iterator is wrong"; - - arguments[Symbol.iterator] = 1; - - if (arguments[Symbol.iterator] !== 1) - throw "Symbol.iterator did not update"; - - let failed = true; - try { - arguments.callee; - } catch (e) { - failed = false; - } - if (failed) - throw "one property stopped another from showing up"; - - delete arguments[Symbol.iterator]; - - if (Symbol.iterator in arguments) - throw "Symbol.iterator did not get deleted"; - - failed = true; - try { - arguments.callee; - } catch (e) { - failed = false; - } - if (failed) - throw "one property stopped another from showing up"; -} - -for (i = 0; i < 10000; i++) - foo(); diff --git a/implementation-contributed/javascriptcore/stress/cloned-arguments-should-visit-callee-during-gc.js b/implementation-contributed/javascriptcore/stress/cloned-arguments-should-visit-callee-during-gc.js deleted file mode 100644 index 3ba0f16bd5..0000000000 --- a/implementation-contributed/javascriptcore/stress/cloned-arguments-should-visit-callee-during-gc.js +++ /dev/null @@ -1,34 +0,0 @@ -// Test that the ClonedArguments created by the Function.arguments will properly -// keep its callee alive. This test should not crash and should not print any error -// messages. - -var cachedArguments = []; -var numberOfEntries = 1000; - -function makeTransientFunction(i) { - function transientFunc() { - cachedArguments[i] = transientFunc.arguments; - } - return transientFunc; -} - -for (i = 0; i < numberOfEntries; i++) { - var transientFunc = makeTransientFunction(i); - transientFunc(); - // At this point, the only reference to the transient function is from - // cachedArguments[i].callee. -} - -gc(); - -// Allocate a bunch of memory to stomp over the transient functions that may have been -// erroneously collected. webkit.org/b/145709 -for (i = 0; i < numberOfEntries; i++) { - new Object(); -} - -for (i = 0; i < numberOfEntries; i++) { - var callee = cachedArguments[i].callee; - if (typeof callee != "function") - print("ERROR: callee is " + callee); -} diff --git a/implementation-contributed/javascriptcore/stress/compare-clobber-untypeduse.js b/implementation-contributed/javascriptcore/stress/compare-clobber-untypeduse.js deleted file mode 100644 index a1642161c5..0000000000 --- a/implementation-contributed/javascriptcore/stress/compare-clobber-untypeduse.js +++ /dev/null @@ -1,12 +0,0 @@ -// Test that we properly clobber untyped uses. This test should throw or crash. - -let val; - -for (var i = 0; i < 100000; i++) - val = 42; - -for (let i = 0; i < 1e6; i++) { - if (val != null && val == 2) { - throw "Val should be 42, but is 2"; - } -} diff --git a/implementation-contributed/javascriptcore/stress/compare-eq-object-or-other-to-object.js b/implementation-contributed/javascriptcore/stress/compare-eq-object-or-other-to-object.js deleted file mode 100644 index a6e1e6d66a..0000000000 --- a/implementation-contributed/javascriptcore/stress/compare-eq-object-or-other-to-object.js +++ /dev/null @@ -1,24 +0,0 @@ -function foo(a, b) { - return a == b; -} - -noInline(foo); - -function test(a, b, expected) { - var result = foo(a, b); - if (result != expected) - throw new Error("Unexpected result: " + result); -} - -for (var i = 0; i < 100000; ++i) { - var o = {f:42}; - var p = {g:43}; - test(o, o, true); - test(o, p, false); - test(p, o, false); - test(p, p, true); - test(null, o, false); - test(null, p, false); - test(void 0, o, false); - test(void 0, p, false); -} diff --git a/implementation-contributed/javascriptcore/stress/compare-eq-object-to-object-or-other.js b/implementation-contributed/javascriptcore/stress/compare-eq-object-to-object-or-other.js deleted file mode 100644 index 2064839173..0000000000 --- a/implementation-contributed/javascriptcore/stress/compare-eq-object-to-object-or-other.js +++ /dev/null @@ -1,24 +0,0 @@ -function foo(a, b) { - return a == b; -} - -noInline(foo); - -function test(a, b, expected) { - var result = foo(a, b); - if (result != expected) - throw new Error("Unexpected result: " + result); -} - -for (var i = 0; i < 100000; ++i) { - var o = {f:42}; - var p = {g:43}; - test(o, o, true); - test(o, p, false); - test(p, o, false); - test(p, p, true); - test(o, null, false); - test(p, null, false); - test(o, void 0, false); - test(p, void 0, false); -} diff --git a/implementation-contributed/javascriptcore/stress/compare-eq-on-null-and-undefined-non-peephole.js b/implementation-contributed/javascriptcore/stress/compare-eq-on-null-and-undefined-non-peephole.js deleted file mode 100644 index 20ff95feb7..0000000000 --- a/implementation-contributed/javascriptcore/stress/compare-eq-on-null-and-undefined-non-peephole.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict" - -function useForMath(undefinedArgument, nullArgument, polymorphicArgument) { - var a = (null == undefinedArgument) + (undefinedArgument == null) + (undefined == undefinedArgument) + (undefinedArgument == undefined); - var b = (null == nullArgument) + (nullArgument == null) + (undefined == nullArgument) + (nullArgument == undefined); - var c = (null == polymorphicArgument) + (polymorphicArgument == null) + (undefined == polymorphicArgument) + (polymorphicArgument == undefined); - var d = (5 == null) + (null == true) + (undefined == Math.LN2) + ("const" == undefined); - var e = (5 == undefinedArgument) + (nullArgument == true) + (nullArgument == Math.LN2) + ("const" == undefinedArgument); - - return a + b - c + d - e; -} -noInline(useForMath); - -function testUseForMath() { - for (let i = 0; i < 1e4; ++i) { - var value = useForMath(undefined, null, 5); - if (value != 8) - throw "Failed useForMath(undefined, null, 5), value = " + value + " with i = " + i; - - var value = useForMath(undefined, null, null); - if (value != 4) - throw "Failed useForMath(undefined, null, null), value = " + value + " with i = " + i; - - var value = useForMath(undefined, null, undefined); - if (value != 4) - throw "Failed useForMath(undefined, null, undefined), value = " + value + " with i = " + i; - - var value = useForMath(undefined, null, { foo: "bar" }); - if (value != 8) - throw "Failed useForMath(undefined, null, { foo: \"bar\" }), value = " + value + " with i = " + i; - - var value = useForMath(undefined, null, true); - if (value != 8) - throw "Failed useForMath(undefined, null, true), value = " + value + " with i = " + i; - - var value = useForMath(undefined, null, [1, 2, 3]); - if (value != 8) - throw "Failed useForMath(undefined, null, true), value = " + value + " with i = " + i; - - var value = useForMath(undefined, null, "WebKit!"); - if (value != 8) - throw "Failed useForMath(undefined, null, true), value = " + value + " with i = " + i; - } -} -testUseForMath(); \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/compare-eq-on-null-and-undefined-optimized-in-constant-folding.js b/implementation-contributed/javascriptcore/stress/compare-eq-on-null-and-undefined-optimized-in-constant-folding.js deleted file mode 100644 index b714e0c796..0000000000 --- a/implementation-contributed/javascriptcore/stress/compare-eq-on-null-and-undefined-optimized-in-constant-folding.js +++ /dev/null @@ -1,70 +0,0 @@ -"use strict" - -function unreachableCodeTest() { - var a; - - var b = null; - if (b) { - a = 5; - } - return a == b; -} -noInline(unreachableCodeTest); - -for (let i = 0; i < 1e4; ++i) { - if (!unreachableCodeTest()) - throw "Failed unreachableCodeTest() with i = " + i; -} - - -function inlinedCompareToNull(a) { - return a == null; -} - -function inlinedComparedToUndefined(a) { - return a == undefined; -} - -// Warmup. Litter the profile with every types. -function warmupInlineFunctions() { - let returnValue = 0; - for (let i = 0; i < 1e4; ++i) { - returnValue += inlinedCompareToNull("foo"); - returnValue += inlinedCompareToNull(null); - returnValue += inlinedCompareToNull(Math); - returnValue += inlinedCompareToNull(5); - returnValue += inlinedCompareToNull(5.5); - - returnValue += inlinedComparedToUndefined("foo"); - returnValue += inlinedComparedToUndefined(null); - returnValue += inlinedComparedToUndefined(Math); - returnValue += inlinedComparedToUndefined(5); - returnValue += inlinedComparedToUndefined(5.5); - } - return returnValue; -} -noInline(warmupInlineFunctions); -warmupInlineFunctions(); - -function testInlineFunctions(undefinedArg, nullArg) { - if (inlinedCompareToNull("foo")) - throw "Failed inlinedCompareToNull(\"foo\")"; - - if (!inlinedCompareToNull(null)) - throw "Failed !inlinedCompareToNull(null)"; - - if (!inlinedCompareToNull(undefined)) - throw "Failed !inlinedCompareToNull(undefined)"; - - if (!inlinedCompareToNull(undefinedArg)) - throw "Failed !inlinedCompareToNull(undefinedArg)"; - - if (!inlinedCompareToNull(nullArg)) - throw "Failed !inlinedCompareToNull(nullArg)"; - -} -noInline(testInlineFunctions); - -for (let i = 0; i < 1e4; ++i) { - testInlineFunctions(undefined, null); -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/compare-eq-on-null-and-undefined.js b/implementation-contributed/javascriptcore/stress/compare-eq-on-null-and-undefined.js deleted file mode 100644 index e4e92c49d4..0000000000 --- a/implementation-contributed/javascriptcore/stress/compare-eq-on-null-and-undefined.js +++ /dev/null @@ -1,174 +0,0 @@ -"use strict" - -// Trivial cases: everything is monomorphic and super predictable. -function compareConstants() -{ - return (null == null) && (null == undefined) && (undefined == null); -} -noInline(compareConstants); - -for (let i = 0; i < 1e4; ++i) { - if (!compareConstants()) - throw "Failed to compareConstants()."; -} - - -function opaqueNull() { - return null; -} -noInline(opaqueNull); - -function opaqueUndefined() { - return undefined; -} -noInline(opaqueUndefined); - -function compareConstantsAndDynamicValues() -{ - return ((null == opaqueNull()) - && (opaqueNull() == null) - && (undefined == opaqueNull()) - && (opaqueNull() == undefined) - && (null == opaqueUndefined()) - && (opaqueUndefined() == null) - && (undefined == opaqueUndefined()) - && (opaqueUndefined() == undefined)); -} -noInline(compareConstantsAndDynamicValues); - -for (let i = 1e4; i--;) { - if (!compareConstantsAndDynamicValues()) - throw "Failed compareConstantsAndDynamicValues()"; -} - - -function compareDynamicValues() -{ - return ((opaqueNull() == opaqueNull()) - && (opaqueUndefined() == opaqueUndefined()) - && (opaqueNull() == opaqueUndefined()) - && (opaqueUndefined() == opaqueNull())); -} -noInline(compareDynamicValues); - -for (let i = 0; i < 1e4; ++i) { - if (!compareDynamicValues()) - throw "Failed compareDynamicValues()"; -} - - -function compareDynamicValueToItself() -{ - const value1 = opaqueNull(); - const value2 = opaqueUndefined(); - return value1 == value1 && value2 == value2; -} -noInline(compareDynamicValueToItself); - -for (let i = 0; i < 1e4; ++i) { - if (!compareDynamicValueToItself()) - throw "Failed compareDynamicValueToItself()"; -} - - -// The case that interested us in the first place. -// Accessing an array with undecided shape always return undefined. - -function arrayTesting() -{ - let returnValue = true; - - const array1 = new Array(2); - for (let i = 0; i < 3; ++i) { - returnValue = returnValue && (array1[i] == null); - returnValue = returnValue && (null == array1[i]); - returnValue = returnValue && (array1[i] == undefined); - returnValue = returnValue && (undefined == array1[i]); - } - - const array2 = new Array(2); - for (let i = 0; i < 2; ++i) { - returnValue = returnValue && (array2[i] == opaqueNull()); - returnValue = returnValue && (opaqueNull() == array2[i]); - returnValue = returnValue && (array2[i] == opaqueUndefined()); - returnValue = returnValue && (opaqueUndefined() == array2[i]); - } - - const array3 = new Array(2); - for (let i = 0; i < 3; ++i) { - returnValue = returnValue && (array3[i] == array3[i]); - returnValue = returnValue && (array1[i] == array3[i]); - returnValue = returnValue && (array3[i] == array1[i]); - returnValue = returnValue && (array2[i] == array3[i]); - returnValue = returnValue && (array3[i] == array2[i]); - - } - - return returnValue; -} -noInline(arrayTesting); - -for (let i = 0; i < 1e4; ++i) { - if (!arrayTesting()) - throw "Failed arrayTesting()"; -} - - -// Let's make it polymorphic after optimization. We should fallback to a generic compare operation. - -function opaqueCompare1(a, b) { - return a == b; -} -noInline(opaqueCompare1); - -function testNullComparatorUpdate() { - for (let i = 0; i < 1e4; ++i) { - if (!opaqueCompare1(null, null)) - throw "Failed opaqueCompare1(null, null)" - } - - // Let's change types - for (let i = 0; i < 1e4; ++i) { - if (opaqueCompare1("foo", null)) - throw "Failed opaqueCompare1(\"foo\", null)" - } -} -testNullComparatorUpdate(); - -function opaqueCompare2(a, b) { - return a == b; -} -noInline(opaqueCompare2); - -function testUndefinedComparatorUpdate() { - for (let i = 0; i < 1e4; ++i) { - if (!opaqueCompare2(undefined, undefined)) - throw "Failed opaqueCompare2(undefined, undefined)" - } - - // Let's change types - for (let i = 0; i < 1e4; ++i) { - if (!opaqueCompare2("bar", "bar")) - throw "Failed opaqueCompare2(\"bar\", \"bar\")" - } -} -testUndefinedComparatorUpdate(); - -function opaqueCompare3(a, b) { - return a == b; -} -noInline(opaqueCompare3); - -function testNullAndUndefinedComparatorUpdate() { - for (let i = 0; i < 1e4; ++i) { - if (!opaqueCompare3(undefined, null) || !opaqueCompare2(null, undefined)) - throw "Failed opaqueCompare2(undefined/null, undefined/null)" - } - - // Let's change types - for (let i = 0; i < 1e4; ++i) { - if (opaqueCompare3(undefined, "bar")) - throw "Failed opaqueCompare3(undefined, \"bar\")" - } -} -testNullAndUndefinedComparatorUpdate(); diff --git a/implementation-contributed/javascriptcore/stress/compare-eq-should-use-known-other-use.js b/implementation-contributed/javascriptcore/stress/compare-eq-should-use-known-other-use.js deleted file mode 100644 index ce5f4a7edd..0000000000 --- a/implementation-contributed/javascriptcore/stress/compare-eq-should-use-known-other-use.js +++ /dev/null @@ -1,29 +0,0 @@ -function bar(testArgs) { - (() => { - try { - testArgs.func.call(1); - } catch (e) { - if (!testArgs.qux) { - return e == testArgs.qux; - } - } - })(); -} -for (var i = 0; i < 100000; i++) { - [ - { - func: ()=>{}, - }, - { - func: Int8Array.prototype.values, - foo: 0 - }, - { - func: Int8Array.prototype.values, - qux: 2 - }, - { - func: Int8Array.prototype.values, - }, - ].forEach(bar); -} diff --git a/implementation-contributed/javascriptcore/stress/compare-number-and-other.js b/implementation-contributed/javascriptcore/stress/compare-number-and-other.js deleted file mode 100644 index 8546bf37ea..0000000000 --- a/implementation-contributed/javascriptcore/stress/compare-number-and-other.js +++ /dev/null @@ -1,75 +0,0 @@ -let typeCases = [ - "1", - "Math.PI", - "NaN", - "undefined", - "null", - "true", - "false", -]; - -let operators = ["<", "<=", ">", ">=", "==", "!=", "===", "!=="]; - -function opaqueSideEffect() -{ -} -noInline(opaqueSideEffect); - -let testCaseIndex = 0; -for (let operator of operators) { - eval(` - function testPolymorphic(a, b) { - if (a ${operator} b) { - opaqueSideEffect() - return true; - } - return false; - } - noInline(testPolymorphic)`); - - for (let left of typeCases) { - for (let right of typeCases) { - let llintResult = eval(left + operator + right); - eval(` - function testMonomorphic${testCaseIndex}(a, b) { - if (a ${operator} b) { - opaqueSideEffect() - return true; - } - return false; - } - noInline(testMonomorphic${testCaseIndex}); - - function testMonomorphicLeftConstant${testCaseIndex}(b) { - if (${left} ${operator} b) { - opaqueSideEffect() - return true; - } - return false; - } - noInline(testMonomorphicLeftConstant${testCaseIndex}); - - function testMonomorphicRightConstant${testCaseIndex}(a) { - if (a ${operator} ${right}) { - opaqueSideEffect() - return true; - } - return false; - } - noInline(testMonomorphicRightConstant${testCaseIndex}); - - for (let i = 0; i < 500; ++i) { - if (testMonomorphic${testCaseIndex}(${left}, ${right}) != ${llintResult}) - throw "Failed testMonomorphic${testCaseIndex}(${left}, ${right})"; - if (testMonomorphicLeftConstant${testCaseIndex}(${right}) != ${llintResult}) - throw "Failed testMonomorphicLeftConstant${testCaseIndex}(${right})"; - if (testMonomorphicRightConstant${testCaseIndex}(${left}) != ${llintResult}) - throw "Failed testMonomorphicLeftConstant${testCaseIndex}(${left})"; - if (testPolymorphic(${left}, ${right}) !== ${llintResult}) - throw "Failed polymorphicVersion(${left})"; - } - `); - ++testCaseIndex; - } - } -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/compare-semantic-origin-op-negate-method-of-getting-a-value-profile.js b/implementation-contributed/javascriptcore/stress/compare-semantic-origin-op-negate-method-of-getting-a-value-profile.js deleted file mode 100644 index dd608682ae..0000000000 --- a/implementation-contributed/javascriptcore/stress/compare-semantic-origin-op-negate-method-of-getting-a-value-profile.js +++ /dev/null @@ -1,18 +0,0 @@ -let flag = false; -function a() { return flag ? {} : 10; } -noInline(a); -function b() { return 10.2; } -noInline(b); - -function foo(x) { - let r = -(x ? a() : b()); - return r; -} -noInline(foo); - -for (let i = 0; i < 100000; ++i) - foo(!!(i%2)); - -flag = true; -for (let i = 0; i < 100000; ++i) - foo(!!(i%2)); diff --git a/implementation-contributed/javascriptcore/stress/compare-strict-eq-integer-to-misc.js b/implementation-contributed/javascriptcore/stress/compare-strict-eq-integer-to-misc.js deleted file mode 100644 index e4d7c9a50d..0000000000 --- a/implementation-contributed/javascriptcore/stress/compare-strict-eq-integer-to-misc.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(thingy) { - if (thingy.length === void 0 || thingy.charAt !== void 0) - return "yes"; - return "no"; -} - -noInline(foo); - -function test(object, expected) { - var result = foo(object); - if (result != expected) - throw new Error("Bad result: " + result); -} - -for (var i = 0; i < 1000; ++i) { - test({}, "yes"); - test([], "no"); - test("hello", "yes"); - test((function(){return arguments;})(), "no"); - var array = []; - for (var j = 0; j < 100; ++j) { - test(array, "no"); - array.push(42); - } -} diff --git a/implementation-contributed/javascriptcore/stress/compare-strict-eq-on-various-types.js b/implementation-contributed/javascriptcore/stress/compare-strict-eq-on-various-types.js deleted file mode 100644 index af2283f8ee..0000000000 --- a/implementation-contributed/javascriptcore/stress/compare-strict-eq-on-various-types.js +++ /dev/null @@ -1,242 +0,0 @@ -//@ skip if not $jitTests -//@ defaultNoEagerRun -"use strict"; - -function opaqueKitString() { - return "Kit"; -} -noInline(opaqueKitString); - -let someObject = new Object; -let validInputTestCases = [ - "undefined", - "Symbol(\"WebKit\")", - "null", - "true", - "false", - "0", - "{ valueOf: () => { return Math.E; } }", - "-0", - "42", - "-42", - "Math.PI", - "NaN", - "\"WebKit\"", - "\"Web\" + opaqueKitString()", - "new String(\"WebKit\")", - "someObject", - "validInputTestCases", -]; - -let leftCases = validInputTestCases.map((element) => { return eval("(" + element + ")"); }); -let rightCases = validInputTestCases.map((element) => { return eval("(" + element + ")"); }); - -// Baseline results. -let expectedEqualResults = []; -let expectedNotEqualResults = []; -for (let testCaseInputLeft of leftCases) { - let equalResultRow = []; - let notEqualResultRow = []; - for (let testCaseInputRight of rightCases) { - equalResultRow.push(testCaseInputLeft === testCaseInputRight); - notEqualResultRow.push(testCaseInputLeft !== testCaseInputRight); - } - expectedEqualResults.push(equalResultRow); - expectedNotEqualResults.push(notEqualResultRow); -} - -function isIdentical(result, expected) -{ - if (expected === expected) { - if (result !== expected) - return false; - if (!expected && 1 / expected === -Infinity && 1 / result !== -Infinity) - return false; - - return true; - } - return result !== result; -} - - -// Very polymorphic compare. -function opaqueStrictEqualAllTypes(left, right) { - return left === right; -} -noInline(opaqueStrictEqualAllTypes); -noOSRExitFuzzing(opaqueStrictEqualAllTypes); - -function opaqueStrictNotEqualAllTypes(left, right) { - return left !== right; -} -noInline(opaqueStrictNotEqualAllTypes); -noOSRExitFuzzing(opaqueStrictNotEqualAllTypes); - -function testAllTypesCall() { - for (let i = 0; i < 1e3; ++i) { - for (let leftCaseIndex = 0; leftCaseIndex < leftCases.length; ++leftCaseIndex) { - for (let rightCaseIndex = 0; rightCaseIndex < rightCases.length; ++rightCaseIndex) { - let strictEqualOutput = opaqueStrictEqualAllTypes(leftCases[leftCaseIndex], rightCases[rightCaseIndex]); - if (!isIdentical(strictEqualOutput, expectedEqualResults[leftCaseIndex][rightCaseIndex])) { - throw "Failed testAllTypesCall for equality. Left = " + - leftCases[leftCaseIndex] + - ", Right = " + - rightCases[rightCaseIndex] + - ", Result = " + - strictEqualOutput; - } - - let strictNotEqualOutput = opaqueStrictNotEqualAllTypes(leftCases[leftCaseIndex], rightCases[rightCaseIndex]); - if (!isIdentical(strictNotEqualOutput, expectedNotEqualResults[leftCaseIndex][rightCaseIndex])) { - throw "Failed testAllTypesCall for !equality. Left = " + - leftCases[leftCaseIndex] + - ", Right = " + - rightCases[rightCaseIndex] + - ", Result = " + - strictEqualOutput; - } - } - } - } - if (numberOfDFGCompiles(opaqueStrictEqualAllTypes) > 5) - throw "opaqueStrictEqualAllTypes() should have been quickly compiled as fully polymorphic."; - if (opaqueStrictNotEqualAllTypes(opaqueStrictEqualAllTypes) > 5) - throw "opaqueStrictEqualAllTypes() should have been quickly compiled as fully polymorphic."; -} -testAllTypesCall(); - - -// Comparing String to every type. -function opaqueStrictEqualStringToAllTypes(left, right) { - return left === right; -} -noInline(opaqueStrictEqualStringToAllTypes); -noOSRExitFuzzing(opaqueStrictEqualStringToAllTypes); - -function opaqueStrictEqualAllTypesToString(left, right) { - return left === right; -} -noInline(opaqueStrictEqualAllTypesToString); -noOSRExitFuzzing(opaqueStrictEqualAllTypesToString); - -function opaqueStrictNotEqualStringToAllTypes(left, right) { - return left !== right; -} -noInline(opaqueStrictNotEqualStringToAllTypes); -noOSRExitFuzzing(opaqueStrictNotEqualStringToAllTypes); - -function opaqueStrictNotEqualAllTypesToString(left, right) { - return left !== right; -} -noInline(opaqueStrictNotEqualAllTypesToString); -noOSRExitFuzzing(opaqueStrictNotEqualAllTypesToString); - -function testStringToAllCompare() { - const leftStringIndex = leftCases.indexOf("WebKit"); - for (let i = 0; i < 1e3; ++i) { - for (let rightCaseIndex = 0; rightCaseIndex < rightCases.length; ++rightCaseIndex) { - let rightCase = rightCases[rightCaseIndex]; - let strictEqualOutput = opaqueStrictEqualStringToAllTypes("Web" + opaqueKitString(), rightCase); - if (!isIdentical(strictEqualOutput, expectedEqualResults[leftStringIndex][rightCaseIndex])) { - throw "Failed opaqueStrictEqualStringToAllTypes() with right = " + rightCase; - } - let strictNotEqualOutput = opaqueStrictNotEqualStringToAllTypes("Web" + opaqueKitString(), rightCase); - if (!isIdentical(strictNotEqualOutput, expectedNotEqualResults[leftStringIndex][rightCaseIndex])) { - throw "Failed opaqueStrictNotEqualStringToAllTypes() with right = " + rightCase; - } - } - } - - const rightStringIndex = leftCases.lastIndexOf("WebKit"); - for (let i = 0; i < 1e3; ++i) { - for (let leftCaseIndex = 0; leftCaseIndex < leftCases.length; ++leftCaseIndex) { - let leftCase = leftCases[leftCaseIndex]; - let strictEqualOutput = opaqueStrictEqualAllTypesToString(leftCase, "Web" + opaqueKitString()); - if (!isIdentical(strictEqualOutput, expectedEqualResults[leftCaseIndex][rightStringIndex])) { - throw "Failed opaqueStrictEqualAllTypesToString() with left = " + leftCase; - } - let strictNotEqualOutput = opaqueStrictNotEqualAllTypesToString(leftCase, "Web" + opaqueKitString()); - if (!isIdentical(strictNotEqualOutput, expectedNotEqualResults[leftCaseIndex][rightStringIndex])) { - throw "Failed opaqueStrictNotEqualAllTypesToString() with left = " + leftCase; - } - } - } - - if (numberOfDFGCompiles(opaqueStrictEqualStringToAllTypes) > 2) - throw "opaqueStrictEqualStringToAllTypes() should quickly converge its types."; - if (numberOfDFGCompiles(opaqueStrictEqualAllTypesToString) > 2) - throw "opaqueStrictEqualAllTypesToString() should quickly converge its types."; - if (numberOfDFGCompiles(opaqueStrictNotEqualStringToAllTypes) > 2) - throw "opaqueStrictNotEqualStringToAllTypes() should quickly converge its types."; - if (numberOfDFGCompiles(opaqueStrictNotEqualAllTypesToString) > 2) - throw "opaqueStrictNotEqualAllTypesToString() should quickly converge its types."; -} -testStringToAllCompare(); - - -// Compare one type to all the others. -function compareOneTypeToAll() { - for (let leftCaseIndex = 0; leftCaseIndex < validInputTestCases.length; ++leftCaseIndex) { - let leftCase = validInputTestCases[leftCaseIndex]; - eval(` - function opaqueStrictEqualOneTypeToAll(left, right) { - return left === right; - } - noInline(opaqueStrictEqualOneTypeToAll); - noOSRExitFuzzing(opaqueStrictEqualOneTypeToAll); - - function opaqueStrictNotEqualOneTypeToAll(left, right) { - return left !== right; - } - noInline(opaqueStrictNotEqualOneTypeToAll); - noOSRExitFuzzing(opaqueStrictNotEqualOneTypeToAll); - - for (let i = 0; i < 1e3; ++i) { - for (let rightCaseIndex = 0; rightCaseIndex < rightCases.length; ++rightCaseIndex) { - let strictEqualOutput = opaqueStrictEqualOneTypeToAll(${leftCase}, rightCases[rightCaseIndex]); - if (!isIdentical(strictEqualOutput, expectedEqualResults[${leftCaseIndex}][rightCaseIndex])) { - throw "Failed opaqueStrictEqualOneTypeToAll() with left case = " + ${leftCase} + ", right case = " + rightCases[rightCaseIndex]; - } - let strictNotEqualOutput = opaqueStrictNotEqualOneTypeToAll(${leftCase}, rightCases[rightCaseIndex]); - if (!isIdentical(strictNotEqualOutput, expectedNotEqualResults[${leftCaseIndex}][rightCaseIndex])) { - throw "Failed opaqueStrictNotEqualOneTypeToAll() with left case = " + ${leftCase} + ", right case = " + rightCases[rightCaseIndex]; - } - } - } - `); - } -} -compareOneTypeToAll(); - -function compareAllTypesToOne() { - for (let rightCaseIndex = 0; rightCaseIndex < validInputTestCases.length; ++rightCaseIndex) { - let rightCase = validInputTestCases[rightCaseIndex]; - eval(` - function opaqueStrictEqualAllToOne(left, right) { - return left === right; - } - noInline(opaqueStrictEqualAllToOne); - noOSRExitFuzzing(opaqueStrictEqualAllToOne); - - function opaqueStrictNotEqualAllToOne(left, right) { - return left !== right; - } - noInline(opaqueStrictNotEqualAllToOne); - noOSRExitFuzzing(opaqueStrictNotEqualAllToOne); - - for (let i = 0; i < 1e3; ++i) { - for (let leftCaseIndex = 0; leftCaseIndex < leftCases.length; ++leftCaseIndex) { - let strictEqualOutput = opaqueStrictEqualAllToOne(leftCases[leftCaseIndex], ${rightCase}); - if (!isIdentical(strictEqualOutput, expectedEqualResults[leftCaseIndex][${rightCaseIndex}])) { - throw "Failed opaqueStrictEqualAllToOne() with left case = " + leftCases[leftCaseIndex] + ", right case = " + ${rightCase}; - } - let strictNotEqualOutput = opaqueStrictNotEqualAllToOne(leftCases[leftCaseIndex], ${rightCase}); - if (!isIdentical(strictNotEqualOutput, expectedNotEqualResults[leftCaseIndex][${rightCaseIndex}])) { - throw "Failed opaqueStrictNotEqualAllToOne() with left case = " + leftCases[leftCaseIndex] + ", right case = " + ${rightCase}; - } - } - } - `); - } -} -compareAllTypesToOne(); diff --git a/implementation-contributed/javascriptcore/stress/constant-closure-var-with-dynamic-invalidation.js b/implementation-contributed/javascriptcore/stress/constant-closure-var-with-dynamic-invalidation.js deleted file mode 100644 index 42ae9e1d5b..0000000000 --- a/implementation-contributed/javascriptcore/stress/constant-closure-var-with-dynamic-invalidation.js +++ /dev/null @@ -1,17 +0,0 @@ -(function() { - var x = 42; - var result = 0; - var n = 100000; - var m = 100; - for (var i = 0; i < n; ++i) { - result += x; - (function() { - with ({}) { - if (i == n - m - 1) - x = 53; - } - })(); - } - if (result != 42 * (n - m) + 53 * m) - throw "Error: bad result: " + result; -})(); diff --git a/implementation-contributed/javascriptcore/stress/constant-fold-multi-get-by-offset-to-get-by-offset-on-prototype-and-sink-allocation.js b/implementation-contributed/javascriptcore/stress/constant-fold-multi-get-by-offset-to-get-by-offset-on-prototype-and-sink-allocation.js deleted file mode 100644 index c233d601d2..0000000000 --- a/implementation-contributed/javascriptcore/stress/constant-fold-multi-get-by-offset-to-get-by-offset-on-prototype-and-sink-allocation.js +++ /dev/null @@ -1,38 +0,0 @@ -function ThingA() { -} - -ThingA.prototype = {f:1}; - -function ThingB() { -} - -ThingB.prototype = {f:2}; - -function foo(o, p) { - return p ? o.f : -1; -} - -for (var i = 0; i < 10000; ++i) { - foo(new ThingA(), true); - foo(new ThingB(), true); - ThingA.prototype.f = i; - ThingB.prototype.f = i + 1; -} - -function bar(p) { - return foo(new ThingA(), p); -} - -ThingA.prototype.f = 42; - -for (var i = 0; i < 10000; ++i) { - var result = bar(false); - if (result != -1) - throw new Error("Bad result in loop: " + result); -} - -var result = bar(true); -if (result != 42) - throw new Error("Bad result: " + result); - - diff --git a/implementation-contributed/javascriptcore/stress/constant-folding-osr-exit.js b/implementation-contributed/javascriptcore/stress/constant-folding-osr-exit.js deleted file mode 100644 index 12bbe18d07..0000000000 --- a/implementation-contributed/javascriptcore/stress/constant-folding-osr-exit.js +++ /dev/null @@ -1,132 +0,0 @@ -var foo = [ - function(o) { - var x = true; - o.f.f; - if (x) - return; - throw new Error(); - }, - function(o) { - var x = true; - o.f.f; - if (!x) - throw new Error(); - return; - }, - function(o) { - var x = 0; - var y = 1; - o.f.f; - if (x < y) - return; - throw new Error(); - }, - function(o) { - var x = 1; - var y = 0; - o.f.f; - if (x > y) - return; - throw new Error(); - }, - function(o) { - var x = 0; - var y = 1; - o.f.f; - if (x <= y) - return; - throw new Error(); - }, - function(o) { - var x = 1; - var y = 0; - o.f.f; - if (x >= y) - return; - throw new Error(); - }, - function(o) { - var x = 0; - var y = 1; - o.f.f; - if (x >= y) - throw new Error(); - return; - }, - function(o) { - var x = 1; - var y = 0; - o.f.f; - if (x <= y) - throw new Error(); - return; - }, - function(o) { - var x = 0; - var y = 1; - o.f.f; - if (x > y) - throw new Error(); - return; - }, - function(o) { - var x = 1; - var y = 0; - o.f.f; - if (x < y) - throw new Error(); - return; - }, - function(o) { - var x = 42; - o.f.f; - if (x == 42) - return; - throw new Error(); - }, - function(o) { - var x = 42; - o.f.f; - if (x != 42) - throw new Error(); - return; - }, - function(o) { - var x = 42; - o.f.f; - if (x === 42) - return; - throw new Error(); - }, - function(o) { - var x = 42; - o.f.f; - if (x !== 42) - throw new Error(); - return; - }, -]; -for (var i = 0; i < foo.length; ++i) - noInline(foo[i]); - -function test(o) { - var failed = []; - for (var i = 0; i < foo.length; ++i) { - try { - foo[i](o); - } catch (e) { - failed.push("Failed " + foo[i] + " with " + e); - } - } - if (failed.length) - throw failed; -} - -var object = {f:{f:42}}; - -for (var i = 0; i < 10000; ++i) { - test(object); -} - -test({f:{g:43}}); - diff --git a/implementation-contributed/javascriptcore/stress/constant-folding-phase-insert-check-handle-varargs.js b/implementation-contributed/javascriptcore/stress/constant-folding-phase-insert-check-handle-varargs.js deleted file mode 100644 index 0d30a95da9..0000000000 --- a/implementation-contributed/javascriptcore/stress/constant-folding-phase-insert-check-handle-varargs.js +++ /dev/null @@ -1,151 +0,0 @@ -function __getRandomObject() { - for (let obj of __getObjects()) { - } -} -function __getRandomProperty() { - let properties = __getproperties(obj); - return properties[seed % properties.length]; -} -try { -} catch (e) { - this.WScript = new Proxy({}, { }); -} -(function () { function ValueOf() { switch (value) { } } })(this); - -(function (global) { })(this); - -function f1() { - v = v.map(() => { }) -} - -try { - f1(); -} catch (e) {} - -try { - f1(); -} catch (e) {} - -try { - __getRandomObject(983831)[__getRandomProperty(__getRandomObject(983831))](); -} catch (e) {} - -if (!'next') throw "Error: iterator prototype should have next method."; - -function f2() { - var v = a[0]; - if (v.next !== a[randoF2].next) throw "Error: next method is not the same."; -} -var a1 = []; -var sym = a1[Symbol.iterator](); -try { - __callRandomFunction(keys, 457796, keys, __getRandomObject(860068), keys, true, __getRandomObject(32567), -1073741825, null); - Object.defineProperty(keys, __getRandomProperty(), { }); - f2([a1[Symbol.iterator](), - keys.keys(), a1.entries()]); -} catch (e) {} - -var set1 = new Set([]); -var sym = set1[Symbol.iterator](); -var keys = set1.keys(); -var entries = set1.entries(); -try { - f2([set1[Symbol.iterator](), set1.keys(), set1.entries()]); -} catch (e) {} - -var map1 = new Map(); -try { - [[][ -10], [][ 2][ 1]].forEach(); -} catch (e) {} -var sym = map1[Symbol.iterator](); -var keys = map1.keys(); -var entries = map1.entries(); -try { - f2([map1[Symbol.iterator](), map1.keys(), map1.entries()]); -} catch (e) {} - -function f3() { - if (vl !== vl) throw new Error('bad value: ' + JSON.stringify(__v_19176)); -} - -var arr2 = []; -function f4() { - arr2.push(randov) - arr2.push(randov) -} -try { - f4`Hello`; -} catch (e) {} -try { - f4`World`; - f4`Hello`; -} catch (e) {} -try { - __callRandomFunction(arr2, 247938, set1, new Boolean(true), __getRandomObject(692620), -1e-15, __getRandomObject(276888)); -} catch (e) {} -if (set1 != null && typeof set1 == "object") try { - Object.defineProperty(set1, __getRandomProperty(), { - }); - f3(); - f3(arr2[0] !== arr2[1]); - f3(arr2[0] !== arr2[2]); - f4`Hello\n`; - f4`Hello\r`; -} catch (e) {} -try { - f3(arr2[1] !== arr2[2]); -} catch (e) {} -if (a1 != null && typeof a1 == "object") try { - Object.defineProperty(a1, __getRandomProperty(), { - }); -} catch (e) {} -try { - f3(arr2[1] !== arr2[3]); -} catch (e) {} -try { - f3(arr2[2] !== arr2[3]); -} catch (e) {} -try { - eval("tag`Hello\n${v}world`"); - eval("tag`Hello\n${v}world`"); - f3(); - f3(arr2[0] !== arr2[1]); -} catch (e) {} -try { - arr10[1][1] = set1 * 100 + 1 * 10 + 1; -} catch (e) {} -try { - arr10[1][1] = set1 * 100 + 1 * 10 + 1; -} catch (e) {} -try { - eval("tag`Hello${v}\nworld`"); - eval("tag`Hello${v}\nworld`"); - eval("tag`Hello\n${v}world`"); - delete a1[__getRandomProperty()](); -} catch (e) {} -try { - 106779[__getRandomProperty()](); -} catch (e) {} -try { - entries[__getRandomProperty()](); -} catch (e) {} -try { - set1[__getRandomProperty()](); -} catch (e) {} -try { - f3(); -} catch (e) {} -arr2[0] !== arr2[1] -gc(); -for (arr10 = 0; arr10 < 3; ++arr10) { - try { - } catch (e) {} - -} -try { - f4`Hello${ - 4}world`; -} catch (e) {} -for (var counter = 0x10000; counter < 0x10ffff; ++counter) { - var charCode = String.fromCharCode(); -} diff --git a/implementation-contributed/javascriptcore/stress/constant-folding-should-fold-make-rope-with-empty-strings.js b/implementation-contributed/javascriptcore/stress/constant-folding-should-fold-make-rope-with-empty-strings.js deleted file mode 100644 index 953862ebfb..0000000000 --- a/implementation-contributed/javascriptcore/stress/constant-folding-should-fold-make-rope-with-empty-strings.js +++ /dev/null @@ -1,61 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function unknown() -{ - return "OK"; -} -noInline(unknown); - -function readWord1(flag) -{ - var word = ""; - if (flag) { - word += unknown(); - } - return word + "HelloWorld"; -} -noInline(readWord1); - -function readWord2(flag) -{ - var word = ""; - if (flag) { - word += unknown(); - } - return "HelloWorld" + word; -} -noInline(readWord2); - -function readWord3(flag) -{ - var word = ""; - if (flag) { - word += unknown(); - } - return "" + word; -} -noInline(readWord3); - -function readWord4(flag) -{ - var word = ""; - if (flag) { - word += unknown(); - } - return "HelloWorld" + word + word; -} -noInline(readWord4); - -for (var i = 0; i < 1e6; ++i) { - shouldBe(readWord1(false), "HelloWorld"); - shouldBe(readWord2(false), "HelloWorld"); - shouldBe(readWord3(false), ""); - shouldBe(readWord4(false), "HelloWorld"); -} -shouldBe(readWord1(true), "OKHelloWorld"); -shouldBe(readWord2(true), "HelloWorldOK"); -shouldBe(readWord3(true), "OK"); -shouldBe(readWord4(true), "HelloWorldOKOK"); diff --git a/implementation-contributed/javascriptcore/stress/construct-forward-varargs-for-inlined-escaped-arguments.js b/implementation-contributed/javascriptcore/stress/construct-forward-varargs-for-inlined-escaped-arguments.js deleted file mode 100644 index 3c17f4239d..0000000000 --- a/implementation-contributed/javascriptcore/stress/construct-forward-varargs-for-inlined-escaped-arguments.js +++ /dev/null @@ -1,23 +0,0 @@ -function foo() { - return arguments; -} - -function Baz(a, b, c) { - this.f = a + b + c; -} - -noInline(Baz); - -function bar(a, b, c) { - var args = foo(b, c, 42); - return new Baz(...args); -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var result = bar(1, 2, 3); - if (result.f != 47) - throw "Error: bad result: " + result.f; -} - diff --git a/implementation-contributed/javascriptcore/stress/construct-overwritten-variable.js b/implementation-contributed/javascriptcore/stress/construct-overwritten-variable.js deleted file mode 100644 index 11e28d9c2f..0000000000 --- a/implementation-contributed/javascriptcore/stress/construct-overwritten-variable.js +++ /dev/null @@ -1,6 +0,0 @@ -//@ runDefault - -(function(){ - var x = 42; - new x(x = function(){ }); -})(); diff --git a/implementation-contributed/javascriptcore/stress/construct-spread-overwritten-variable-2.js b/implementation-contributed/javascriptcore/stress/construct-spread-overwritten-variable-2.js deleted file mode 100644 index 4d7976219c..0000000000 --- a/implementation-contributed/javascriptcore/stress/construct-spread-overwritten-variable-2.js +++ /dev/null @@ -1,6 +0,0 @@ -//@ runDefault - -(function(){ - var x = 42; - new x(...[x = function(){ }]); -})(); diff --git a/implementation-contributed/javascriptcore/stress/construct-spread-overwritten-variable.js b/implementation-contributed/javascriptcore/stress/construct-spread-overwritten-variable.js deleted file mode 100644 index 0a5b9b0d2e..0000000000 --- a/implementation-contributed/javascriptcore/stress/construct-spread-overwritten-variable.js +++ /dev/null @@ -1,7 +0,0 @@ -//@ runDefault - -(function(){ - var x = 42; - var a = [1, 2, 3]; - new x(x = function(){ }, ...a); -})(); diff --git a/implementation-contributed/javascriptcore/stress/construct-varargs-inline-smaller-Foo.js b/implementation-contributed/javascriptcore/stress/construct-varargs-inline-smaller-Foo.js deleted file mode 100644 index 77b5b3df0b..0000000000 --- a/implementation-contributed/javascriptcore/stress/construct-varargs-inline-smaller-Foo.js +++ /dev/null @@ -1,35 +0,0 @@ -function Foo(a, b) { - var array = []; - for (var i = 0; i < arguments.length; ++i) - array.push(arguments[i]); - this.f = array; -} - -function bar(array) { - return new Foo(...array); -} - -noInline(bar); - -function checkEqual(a, b) { - if (a.length != b.length) - throw "Error: bad value of c, length mismatch: " + a + " versus " + b; - for (var i = a.length; i--;) { - if (a[i] != b[i]) - throw "Error: bad value of c, mismatch at i = " + i + ": " + a + " versus " + b; - } -} - -function test(array) { - var expected = array; - var actual = bar(array).f; - checkEqual(actual, expected); -} - -for (var i = 0; i < 10000; ++i) { - var array = []; - for (var j = 0; j < i % 6; ++j) - array.push(j); - test(array); -} - diff --git a/implementation-contributed/javascriptcore/stress/construct-varargs-inline.js b/implementation-contributed/javascriptcore/stress/construct-varargs-inline.js deleted file mode 100644 index ff4ccce952..0000000000 --- a/implementation-contributed/javascriptcore/stress/construct-varargs-inline.js +++ /dev/null @@ -1,39 +0,0 @@ -function Foo(a, b) { - var array = []; - for (var i = 0; i < arguments.length; ++i) - array.push(arguments[i]); - this.f = {a:a, b:b, c:array}; -} - -function bar(array) { - return new Foo(...array); -} - -noInline(bar); - -function checkEqual(a, b) { - if (a.a != b.a) - throw "Error: bad value of a: " + a.a + " versus " + b.a; - if (a.b != b.b) - throw "Error: bad value of b: " + a.b + " versus " + b.b; - if (a.c.length != b.c.length) - throw "Error: bad value of c, length mismatch: " + a.c + " versus " + b.c; - for (var i = a.c.length; i--;) { - if (a.c[i] != b.c[i]) - throw "Error: bad value of c, mismatch at i = " + i + ": " + a.c + " versus " + b.c; - } -} - -function test(array) { - var expected = {a:array[0], b:array[1], c:array}; - var actual = bar(array).f; - checkEqual(actual, expected); -} - -for (var i = 0; i < 10000; ++i) { - var array = []; - for (var j = 0; j < i % 6; ++j) - array.push(j); - test(array); -} - diff --git a/implementation-contributed/javascriptcore/stress/construct-varargs-no-inline.js b/implementation-contributed/javascriptcore/stress/construct-varargs-no-inline.js deleted file mode 100644 index 333646eedf..0000000000 --- a/implementation-contributed/javascriptcore/stress/construct-varargs-no-inline.js +++ /dev/null @@ -1,41 +0,0 @@ -function Foo(a, b) { - var array = []; - for (var i = 0; i < arguments.length; ++i) - array.push(arguments[i]); - this.f = {a:a, b:b, c:array}; -} - -noInline(Foo); - -function bar(array) { - return new Foo(...array); -} - -noInline(bar); - -function checkEqual(a, b) { - if (a.a != b.a) - throw "Error: bad value of a: " + a.a + " versus " + b.a; - if (a.b != b.b) - throw "Error: bad value of b: " + a.b + " versus " + b.b; - if (a.c.length != b.c.length) - throw "Error: bad value of c, length mismatch: " + a.c + " versus " + b.c; - for (var i = a.c.length; i--;) { - if (a.c[i] != b.c[i]) - throw "Error: bad value of c, mismatch at i = " + i + ": " + a.c + " versus " + b.c; - } -} - -function test(array) { - var expected = {a:array[0], b:array[1], c:array}; - var actual = bar(array).f; - checkEqual(actual, expected); -} - -for (var i = 0; i < 10000; ++i) { - var array = []; - for (var j = 0; j < i % 6; ++j) - array.push(j); - test(array); -} - diff --git a/implementation-contributed/javascriptcore/stress/constructor-with-return.js b/implementation-contributed/javascriptcore/stress/constructor-with-return.js deleted file mode 100644 index d0a895b073..0000000000 --- a/implementation-contributed/javascriptcore/stress/constructor-with-return.js +++ /dev/null @@ -1,41 +0,0 @@ -function Test(value, returnIt) { - this.value = value; - this.returnIt = returnIt; -} - -var tests = [ - new Test("string", false), - new Test(5, false), - new Test(6.5, false), - new Test(void(0), false), - new Test(null, false), - new Test(true, false), - new Test(false, false), - new Test(Symbol.iterator, false), - new Test({f:42}, true), - new Test([1, 2, 3], true), - new Test(new String("string"), true), - new Test(new Number(42), true), - new Test(new Boolean(false), true), - new Test(new Boolean(false), true), - new Test(Object(Symbol.iterator), true), -]; - -for (let i = 0; i < 1000; ++i) { - tests.forEach(function (test) { - function Constructor() { - return test.value; - } - - var result = new Constructor(); - if (test.returnIt) { - if (test.value !== result) { - throw "Bad result: " + result; - } - } else { - if (!(result instanceof Constructor)) { - throw "Bad result: " + result; - } - } - }); -} diff --git a/implementation-contributed/javascriptcore/stress/contiguous-array-unshift.js b/implementation-contributed/javascriptcore/stress/contiguous-array-unshift.js deleted file mode 100644 index 2509d9c3a4..0000000000 --- a/implementation-contributed/javascriptcore/stress/contiguous-array-unshift.js +++ /dev/null @@ -1,6 +0,0 @@ -//@ runDefault -var x = ['b', 'a']; -Array.prototype.unshift.call(x, 'c'); -if (x.toString() != "c,b,a") - throw "Error: bad result: " + describe(x); - diff --git a/implementation-contributed/javascriptcore/stress/date-negative-zero.js b/implementation-contributed/javascriptcore/stress/date-negative-zero.js deleted file mode 100644 index 08b71e37a7..0000000000 --- a/implementation-contributed/javascriptcore/stress/date-negative-zero.js +++ /dev/null @@ -1,7 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var date = new Date(-0); -shouldBe(Object.is(date.getTime(), 0), true); diff --git a/implementation-contributed/javascriptcore/stress/date-parse-ranges.js b/implementation-contributed/javascriptcore/stress/date-parse-ranges.js deleted file mode 100644 index 11772ffe02..0000000000 --- a/implementation-contributed/javascriptcore/stress/date-parse-ranges.js +++ /dev/null @@ -1,145 +0,0 @@ -// This test checks that dates follow the range described in ecma262/#sec-date-time-string-format - -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error(`bad value: ${actual}`); -} - -function shouldBeNaN(actual) -{ - if (!Number.isNaN(actual)) - throw new Error(`bad value: ${actual}`); -} - -{ - let dateValue = Date.parse("275760-09-13T00:00:00.000Z"); - shouldBe(dateValue, 8640000000000000); - - let date = new Date(dateValue); - shouldBe(date.getUTCFullYear(), 275760); - shouldBe(date.getUTCMonth(), 8); - shouldBe(date.getUTCDate(), 13); - shouldBe(date.getUTCHours(), 0); - shouldBe(date.getUTCMinutes(), 0); - shouldBe(date.getUTCSeconds(), 0); - shouldBe(date.getUTCMilliseconds(), 0); -} - -{ - let dateValue = Date.UTC(275760, 8, 13, 0, 0, 0, 0); - shouldBe(dateValue, 8640000000000000); - - let date = new Date(dateValue); - shouldBe(date.getUTCFullYear(), 275760); - shouldBe(date.getUTCMonth(), 8); - shouldBe(date.getUTCDate(), 13); - shouldBe(date.getUTCHours(), 0); - shouldBe(date.getUTCMinutes(), 0); - shouldBe(date.getUTCSeconds(), 0); - shouldBe(date.getUTCMilliseconds(), 0); -} - -{ - let dateValue = Date.parse("275760-09-12T23:59:59.999Z"); - shouldBe(dateValue, 8639999999999999); - - let date = new Date(dateValue); - shouldBe(date.getUTCFullYear(), 275760); - shouldBe(date.getUTCMonth(), 8); - shouldBe(date.getUTCDate(), 12); - shouldBe(date.getUTCHours(), 23); - shouldBe(date.getUTCMinutes(), 59); - shouldBe(date.getUTCSeconds(), 59); - shouldBe(date.getUTCMilliseconds(), 999); -} - -{ - let dateValue = Date.UTC(275760, 8, 12, 23, 59, 59, 999); - shouldBe(dateValue, 8639999999999999); - - let date = new Date(dateValue); - shouldBe(date.getUTCFullYear(), 275760); - shouldBe(date.getUTCMonth(), 8); - shouldBe(date.getUTCDate(), 12); - shouldBe(date.getUTCHours(), 23); - shouldBe(date.getUTCMinutes(), 59); - shouldBe(date.getUTCSeconds(), 59); - shouldBe(date.getUTCMilliseconds(), 999); -} - -{ - let dateValue = Date.parse("275760-09-13T00:00:00.001Z"); - shouldBeNaN(dateValue); -} - -{ - let dateValue = Date.UTC(275760, 8, 13, 0, 0, 0, 1); - shouldBeNaN(dateValue); -} - -{ - let dateValue = Date.parse("-271821-04-20T00:00:00.000Z"); - shouldBe(dateValue, -8640000000000000); - - let date = new Date(dateValue); - shouldBe(date.getUTCFullYear(), -271821); - shouldBe(date.getUTCMonth(), 3); - shouldBe(date.getUTCDate(), 20); - shouldBe(date.getUTCHours(), 0); - shouldBe(date.getUTCMinutes(), 0); - shouldBe(date.getUTCSeconds(), 0); - shouldBe(date.getUTCMilliseconds(), 0); -} - -{ - let dateValue = Date.UTC(-271821, 3, 20, 0, 0, 0, 0); - shouldBe(dateValue, -8640000000000000); - - let date = new Date(dateValue); - shouldBe(date.getUTCFullYear(), -271821); - shouldBe(date.getUTCMonth(), 3); - shouldBe(date.getUTCDate(), 20); - shouldBe(date.getUTCHours(), 0); - shouldBe(date.getUTCMinutes(), 0); - shouldBe(date.getUTCSeconds(), 0); - shouldBe(date.getUTCMilliseconds(), 0); -} - -{ - let dateValue = Date.parse("-271821-04-20T00:00:00.001Z"); - shouldBe(dateValue, -8639999999999999); - - let date = new Date(dateValue); - shouldBe(date.getUTCFullYear(), -271821); - shouldBe(date.getUTCMonth(), 3); - shouldBe(date.getUTCDate(), 20); - shouldBe(date.getUTCHours(), 0); - shouldBe(date.getUTCMinutes(), 0); - shouldBe(date.getUTCSeconds(), 0); - shouldBe(date.getUTCMilliseconds(), 1); -} - -{ - let dateValue = Date.UTC(-271821, 3, 20, 0, 0, 0, 1); - shouldBe(dateValue, -8639999999999999); - - let date = new Date(dateValue); - shouldBe(date.getUTCFullYear(), -271821); - shouldBe(date.getUTCMonth(), 3); - shouldBe(date.getUTCDate(), 20); - shouldBe(date.getUTCHours(), 0); - shouldBe(date.getUTCMinutes(), 0); - shouldBe(date.getUTCSeconds(), 0); - shouldBe(date.getUTCMilliseconds(), 1); -} - -{ - let dateValue = Date.parse("-271821-04-19T23:59:59.999Z"); - shouldBeNaN(dateValue); -} - -{ - let dateValue = Date.UTC(-271821, 3, 19, 23, 59, 59, 999); - shouldBeNaN(dateValue); -} diff --git a/implementation-contributed/javascriptcore/stress/date-relaxed.js b/implementation-contributed/javascriptcore/stress/date-relaxed.js deleted file mode 100644 index 06bb0d5b35..0000000000 --- a/implementation-contributed/javascriptcore/stress/date-relaxed.js +++ /dev/null @@ -1,64 +0,0 @@ -//@ skip if $hostOS == "windows" -// FIXME: unskip this test when https://bugs.webkit.org/show_bug.cgi?id=176538 is fixed. - -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error(`bad value: ${actual}`); -} - -{ - let date = new Date("May 8"); - shouldBe(date.getFullYear(), 2000); - shouldBe(date.getMonth(), 4); - shouldBe(date.getDate(), 8); -} -{ - let date = new Date("Feb 29"); - shouldBe(date.getFullYear(), 2000); - shouldBe(date.getMonth(), 1); - shouldBe(date.getDate(), 29); -} -{ - let date = new Date(" May 8 "); - shouldBe(date.getFullYear(), 2000); - shouldBe(date.getMonth(), 4); - shouldBe(date.getDate(), 8); -} -{ - let date = new Date(" Feb 29 "); - shouldBe(date.getFullYear(), 2000); - shouldBe(date.getMonth(), 1); - shouldBe(date.getDate(), 29); -} -{ - let date = new Date("May/8"); - shouldBe(date.getFullYear(), 2000); - shouldBe(date.getMonth(), 4); - shouldBe(date.getDate(), 8); -} -{ - let date = new Date("Feb/29"); - shouldBe(date.getFullYear(), 2000); - shouldBe(date.getMonth(), 1); - shouldBe(date.getDate(), 29); -} -{ - let date = new Date("May8"); - shouldBe(date.getFullYear(), 2000); - shouldBe(date.getMonth(), 4); - shouldBe(date.getDate(), 8); -} -{ - let date = new Date("Feb29"); - shouldBe(date.getFullYear(), 2000); - shouldBe(date.getMonth(), 1); - shouldBe(date.getDate(), 29); -} - -{ - let date = new Date("May 8 -1"); - shouldBe(date.getFullYear(), -1); - shouldBe(date.getMonth(), 4); - shouldBe(date.getDate(), 8); -} diff --git a/implementation-contributed/javascriptcore/stress/date-symbol-toprimitive.js b/implementation-contributed/javascriptcore/stress/date-symbol-toprimitive.js deleted file mode 100644 index fb5ea3d574..0000000000 --- a/implementation-contributed/javascriptcore/stress/date-symbol-toprimitive.js +++ /dev/null @@ -1,6 +0,0 @@ -delete Date.prototype[Symbol.toPrimitive] - -let date = new Date(); - -if (typeof (date + 1) !== "number") - throw "symbol was not deleted"; diff --git a/implementation-contributed/javascriptcore/stress/dead-access-to-captured-variable-preceded-by-a-live-store-in-function-with-multiple-basic-blocks.js b/implementation-contributed/javascriptcore/stress/dead-access-to-captured-variable-preceded-by-a-live-store-in-function-with-multiple-basic-blocks.js deleted file mode 100644 index ab8e3f3a7b..0000000000 --- a/implementation-contributed/javascriptcore/stress/dead-access-to-captured-variable-preceded-by-a-live-store-in-function-with-multiple-basic-blocks.js +++ /dev/null @@ -1,26 +0,0 @@ -function foo(p) { - if (p) { - var x = 42; - (function() { x = 43; })(); - x++; - var realResult = x; - (function() { x = 44; })(); - var fakeResult = x; - return realResult; - } - var y = 45; - (function() { y = 46; })(); - y++; - var realResult2 = y; - (function() { y = 47; })(); - var fakeResult2 = y; - return realResult2; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(i & 1); - if (result != ((i & 1) ? 44 : 47)) - throw "Error: bad result with i = " + i + ": " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/dead-access-to-captured-variable-preceded-by-a-live-store.js b/implementation-contributed/javascriptcore/stress/dead-access-to-captured-variable-preceded-by-a-live-store.js deleted file mode 100644 index effa6f2a69..0000000000 --- a/implementation-contributed/javascriptcore/stress/dead-access-to-captured-variable-preceded-by-a-live-store.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo() { - var x = 42; - (function() { x = 43; })(); - x++; - var realResult = x; - (function() { x = 44; })(); - var fakeResult = x; - return realResult; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(); - if (result != 44) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/dead-fiat-double-to-int52-then-exit-not-int52.js b/implementation-contributed/javascriptcore/stress/dead-fiat-double-to-int52-then-exit-not-int52.js deleted file mode 100644 index b422c1b4d3..0000000000 --- a/implementation-contributed/javascriptcore/stress/dead-fiat-double-to-int52-then-exit-not-int52.js +++ /dev/null @@ -1,15 +0,0 @@ -var array = new Float64Array(1); -array[0] = 42; - -function foo() { - fiatInt52(array[0]); - fiatInt52(array[0]); -} - -noInline(foo); - -for (var i = 0; i < 1000000; ++i) - foo(); - -array[0] = 5.5; -foo(); diff --git a/implementation-contributed/javascriptcore/stress/dead-fiat-double-to-int52.js b/implementation-contributed/javascriptcore/stress/dead-fiat-double-to-int52.js deleted file mode 100644 index fc5e60566a..0000000000 --- a/implementation-contributed/javascriptcore/stress/dead-fiat-double-to-int52.js +++ /dev/null @@ -1,12 +0,0 @@ -var array = new Float64Array(1); -array[0] = 42; - -function foo() { - fiatInt52(array[0]); - fiatInt52(array[0]); -} - -noInline(foo); - -for (var i = 0; i < 1000000; ++i) - foo(); diff --git a/implementation-contributed/javascriptcore/stress/dead-fiat-int32-to-int52.js b/implementation-contributed/javascriptcore/stress/dead-fiat-int32-to-int52.js deleted file mode 100644 index 5c154f44e9..0000000000 --- a/implementation-contributed/javascriptcore/stress/dead-fiat-int32-to-int52.js +++ /dev/null @@ -1,11 +0,0 @@ -function foo(o) { - fiatInt52(o.f); - fiatInt52(o.f); -} - -noInline(foo); - -var o = {f:42}; - -for (var i = 0; i < 1000000; ++i) - foo(o); diff --git a/implementation-contributed/javascriptcore/stress/dead-fiat-value-to-int52-double-path.js b/implementation-contributed/javascriptcore/stress/dead-fiat-value-to-int52-double-path.js deleted file mode 100644 index 083a5f63c7..0000000000 --- a/implementation-contributed/javascriptcore/stress/dead-fiat-value-to-int52-double-path.js +++ /dev/null @@ -1,19 +0,0 @@ -var array = new Float64Array(1); -array[0] = 42; - -function foo() { - var value = bar(); - fiatInt52(value); - fiatInt52(value); -} - -function bar() { - return array[0]; -} - -noInline(foo); -noInline(bar); - -for (var i = 0; i < 1000000; ++i) - foo(); - diff --git a/implementation-contributed/javascriptcore/stress/dead-get-closure-var.js b/implementation-contributed/javascriptcore/stress/dead-get-closure-var.js deleted file mode 100644 index 7622fb0841..0000000000 --- a/implementation-contributed/javascriptcore/stress/dead-get-closure-var.js +++ /dev/null @@ -1,23 +0,0 @@ -var global; - -function foo(a) { - var x = a.f; - var f = function() { global = x; }; - noInline(f); - f(); - var tmp1 = a.g + 1; - var tmp2 = x; - return global; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo({f:i, g:i + 1}); - if (result != i) - throw "Error: bad result: " + result; -} - -var result = foo({f:42, g:4.2}); -if (result != 42) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/dead-int32-to-double.js b/implementation-contributed/javascriptcore/stress/dead-int32-to-double.js deleted file mode 100644 index 0713fd6781..0000000000 --- a/implementation-contributed/javascriptcore/stress/dead-int32-to-double.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(int, o) { - var x = int; - o.f = x; - for (var i = 0; i < 100; ++i) - x += 0.5; -} - -noInline(foo); - -for (var i = 0; i < 100; ++i) - foo(42, {}); - -var o = {g: 43}; -foo(47, o); -if (o.f != 47) - throw "Error: o.f is " + o.f; diff --git a/implementation-contributed/javascriptcore/stress/dead-speculating-argument-use.js b/implementation-contributed/javascriptcore/stress/dead-speculating-argument-use.js deleted file mode 100644 index 5f3ebfcb52..0000000000 --- a/implementation-contributed/javascriptcore/stress/dead-speculating-argument-use.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo(x) { - var tmp = x + 1; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) - foo(i); - -var didCall = false; -var o = { - valueOf: function() { didCall = true; } -}; - -foo(o); -if (!didCall) - throw "Error: didn't call valueOf"; diff --git a/implementation-contributed/javascriptcore/stress/dead-uint32-to-number.js b/implementation-contributed/javascriptcore/stress/dead-uint32-to-number.js deleted file mode 100644 index 4e3987868f..0000000000 --- a/implementation-contributed/javascriptcore/stress/dead-uint32-to-number.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, o) { - var x = a >>> 0; - o.f = x | 0; - for (var i = 0; i < 100; ++i) - x++; -} - -noInline(foo); - -for (var i = 0; i < 100; ++i) - foo(42, {}); - -var o = {g: 43}; -foo(47, o); -if (o.f != 47) - throw "Error: o.f is " + o.f; diff --git a/implementation-contributed/javascriptcore/stress/dead-value-with-mov-hint-in-another-block.js b/implementation-contributed/javascriptcore/stress/dead-value-with-mov-hint-in-another-block.js deleted file mode 100644 index ae745077df..0000000000 --- a/implementation-contributed/javascriptcore/stress/dead-value-with-mov-hint-in-another-block.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo(a, b, p, o) { - var x = a + b; - if (p) { - var y = x; - var result = o.f.f; - var z = y + 1; - return result; - } -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(1, 2, true, {f:{f:42}}); - if (result != 42) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/deep-StructureStubClearingWatchpoint-destructor-recursion.js b/implementation-contributed/javascriptcore/stress/deep-StructureStubClearingWatchpoint-destructor-recursion.js deleted file mode 100644 index e07f31db35..0000000000 --- a/implementation-contributed/javascriptcore/stress/deep-StructureStubClearingWatchpoint-destructor-recursion.js +++ /dev/null @@ -1,8 +0,0 @@ -//@ skip -// This test should not crash. Note: it takes about 14 minutes to run on a debug build. - -C = class {}; -for (var i = 0; i < 50000; ++i) - C = class extends C {}; -gc(); - diff --git a/implementation-contributed/javascriptcore/stress/deeply-nested-finallys.js b/implementation-contributed/javascriptcore/stress/deeply-nested-finallys.js deleted file mode 100644 index f7ff5fea29..0000000000 --- a/implementation-contributed/javascriptcore/stress/deeply-nested-finallys.js +++ /dev/null @@ -1,78 +0,0 @@ -// This test should finish almost instantly. - -function exp() { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - try { - } finally {return 1;} - } finally { return 1; } - } finally {return 1;} - } finally { return 1; } - } finally {return 1;} - } finally {return 1;} - } finally {return 1;} - } finally {return 1;} - } finally { return 1; } - } finally {return 1;} - } finally { return 1; } - } finally {return 1;} - } finally { return 1; } - } finally {return 1;} - } finally {return 1;} - } finally {return 1;} - } finally {return 1;} - } finally { return 1; } - } finally {return 1;} - } finally { return 1; } - } finally {return 1;} - } finally { return 1; } - } finally {return 1;} - } finally {return 1;} - } finally {return 1;} - } finally {return 1;} - } finally { return 1; } - } finally {return 1;} - } finally { return 1; } - } finally {return 1;} - } finally { return 1; } - } finally {return 1;} - } finally {return 1;} - } finally {return 1;} - } finally {return 1;} - } finally { return 1; } -} - -exp(); diff --git a/implementation-contributed/javascriptcore/stress/default-proto-for-async-generator.js b/implementation-contributed/javascriptcore/stress/default-proto-for-async-generator.js deleted file mode 100644 index d23b9e6804..0000000000 --- a/implementation-contributed/javascriptcore/stress/default-proto-for-async-generator.js +++ /dev/null @@ -1,11 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -async function* asyncGenerator() { } - -var AsyncGeneratorPrototype = Object.getPrototypeOf(asyncGenerator).prototype; -asyncGenerator.prototype = null; - -shouldBe(Object.getPrototypeOf(asyncGenerator()), AsyncGeneratorPrototype); diff --git a/implementation-contributed/javascriptcore/stress/default-proto-for-generator.js b/implementation-contributed/javascriptcore/stress/default-proto-for-generator.js deleted file mode 100644 index c1c5cd08e1..0000000000 --- a/implementation-contributed/javascriptcore/stress/default-proto-for-generator.js +++ /dev/null @@ -1,11 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function* generator() { } - -var GeneratorPrototype = Object.getPrototypeOf(generator).prototype; -generator.prototype = null; - -shouldBe(Object.getPrototypeOf(generator()), GeneratorPrototype); diff --git a/implementation-contributed/javascriptcore/stress/default-value-parsing-should-propagate-error.js b/implementation-contributed/javascriptcore/stress/default-value-parsing-should-propagate-error.js deleted file mode 100644 index 6bc7ad99c9..0000000000 --- a/implementation-contributed/javascriptcore/stress/default-value-parsing-should-propagate-error.js +++ /dev/null @@ -1,21 +0,0 @@ -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - - -testSyntaxError(` -function f() -{ - ({v = (++new.target)} = {}) -} -`, `SyntaxError: Unexpected token '='. Expected a ':' following the property name 'v'.`); diff --git a/implementation-contributed/javascriptcore/stress/delete-by-id.js b/implementation-contributed/javascriptcore/stress/delete-by-id.js deleted file mode 100644 index 516f01be74..0000000000 --- a/implementation-contributed/javascriptcore/stress/delete-by-id.js +++ /dev/null @@ -1,28 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test1(object) -{ - return delete object.cocoa; -} -noInline(test1); - -function test2(object) -{ - return delete object.cappuccino; -} -noInline(test2); - -for (var i = 0; i < 1e5; ++i) { - var object = { - cocoa: 42 - }; - Object.defineProperty(object, "cappuccino", { - value: 42 - }); - shouldBe(test1(object), true); - shouldBe(test2(object), false); -} diff --git a/implementation-contributed/javascriptcore/stress/delete-by-val-ftl.js b/implementation-contributed/javascriptcore/stress/delete-by-val-ftl.js deleted file mode 100644 index 674eab9f82..0000000000 --- a/implementation-contributed/javascriptcore/stress/delete-by-val-ftl.js +++ /dev/null @@ -1,28 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test1(object, key) -{ - return delete object[key]; -} -noInline(test1); - -function test2(object, key) -{ - return delete object[key]; -} -noInline(test2); - -for (var i = 0; i < 1e5; ++i) { - var object = { - cocoa: 42 - }; - Object.defineProperty(object, "cappuccino", { - value: 42 - }); - shouldBe(test1(object, "cocoa"), true); - shouldBe(test2(object, "cappuccino"), false); -} diff --git a/implementation-contributed/javascriptcore/stress/delete-by-val.js b/implementation-contributed/javascriptcore/stress/delete-by-val.js deleted file mode 100644 index 327d889b39..0000000000 --- a/implementation-contributed/javascriptcore/stress/delete-by-val.js +++ /dev/null @@ -1,15 +0,0 @@ -function assert(condition) { - if (!condition) - throw new Error("assertion failed"); -} - -function test(i) { - let foo = {}; - foo["bar" + i] = 1; - assert(foo["bar" + i] === 1) - assert(delete foo["bar" + i]); - assert(!("bar" + i in foo)); -} - -for (let i = 0; i < 100000; ++i) - test(i); diff --git a/implementation-contributed/javascriptcore/stress/delete-to-object-exception.js b/implementation-contributed/javascriptcore/stress/delete-to-object-exception.js deleted file mode 100644 index 3421003c12..0000000000 --- a/implementation-contributed/javascriptcore/stress/delete-to-object-exception.js +++ /dev/null @@ -1,24 +0,0 @@ -function assert(condition) { - if (!condition) - throw new Error("assertion failed"); -} - -function test(i) { - let value = null; - let passed = true; - - try { - delete value.bar; - passed = false; - } catch(e) {} - try { - delete value["bar" + i]; - passed = false; - } catch(e) {} - if (!passed) - throw new Error("didn't throw"); -} -noInline(test); - -for (let i = 0; i < 10000; ++i) - test(); diff --git a/implementation-contributed/javascriptcore/stress/destructuring-assignment-accepts-iterables.js b/implementation-contributed/javascriptcore/stress/destructuring-assignment-accepts-iterables.js deleted file mode 100644 index cd32492e28..0000000000 --- a/implementation-contributed/javascriptcore/stress/destructuring-assignment-accepts-iterables.js +++ /dev/null @@ -1,441 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -(function () { - var [a, b, c] = [1, 2, 3]; - shouldBe(a, 1); - shouldBe(b, 2); - shouldBe(c, 3); -}()); - -(function () { - var [a, b, c] = [1, 2, 3].keys(); - shouldBe(a, 0); - shouldBe(b, 1); - shouldBe(c, 2); -}()); - -(function () { - var [a, b, c] = [1, 2, 3].values(); - shouldBe(a, 1); - shouldBe(b, 2); - shouldBe(c, 3); -}()); - -(function () { - var [a, , c] = [1, 2, 3].values(); - shouldBe(a, 1); - shouldBe(c, 3); -}()); - -(function () { - var [a, b, c] = [1, , 3].values(); - shouldBe(a, 1); - shouldBe(b, undefined); - shouldBe(c, 3); -}()); - -(function () { - var [, b, c] = [1, 2, 3, 4, 5, 6].values(); - shouldBe(b, 2); - shouldBe(c, 3); -}()); - -(function () { - var [a, b, c] = [1].values(); - shouldBe(a, 1); - shouldBe(b, undefined); - shouldBe(c, undefined); -}()); - -(function ([a, b, c]) { - shouldBe(a, 1); - shouldBe(b, undefined); - shouldBe(c, undefined); -}([1].values())); - -(function () { - var [a = 0, b = 2, c = 3] = [1].values(); - shouldBe(a, 1); - shouldBe(b, 2); - shouldBe(c, 3); -}()); - -(function () { - var [a = 1, b = 2, c = 3] = [undefined, undefined, undefined]; - shouldBe(a, 1); - shouldBe(b, 2); - shouldBe(c, 3); -}()); - -// String with a surrogate pair. -(function () { - var string = "𠮷野家"; - var [a, b, c] = string; - shouldBe(string.length, 4); - shouldBe(a, '𠮷'); - shouldBe(b, '野'); - shouldBe(c, '家'); -}()); - -(function () { - var set = new Set([1, 2, 3]); - var [a, b, c] = set; - shouldBe(set.has(a), true); - shouldBe(set.has(b), true); - shouldBe(set.has(c), true); -}()); - -(function () { - var map = new Map([[1, 1], [2, 2], [3, 3]]); - var [a, b, c] = map; - shouldBe(Array.isArray(a), true); - shouldBe(Array.isArray(b), true); - shouldBe(Array.isArray(c), true); - shouldBe(map.has(a[0]), true); - shouldBe(map.has(b[0]), true); - shouldBe(map.has(c[0]), true); -}()); - -// Errors - -shouldThrow(function () { - var [a, b, c] = { - [Symbol.iterator]() { - return 42; - } - }; -}, "TypeError: undefined is not a function (near '...[a, b, c]...')"); - -shouldThrow(function () { - var [a, b, c] = { - [Symbol.iterator]() { - return {}; - } - }; -}, "TypeError: undefined is not a function (near '...[a, b, c]...')"); - -shouldThrow(function () { - var [a, b, c] = { - [Symbol.iterator]() { - return this; - }, - - next() { - throw new Error('out'); - } - }; -}, 'Error: out'); - -shouldThrow(function () { - var [a, b, c] = { - [Symbol.iterator]() { - return this; - }, - - next() { - return 42; - } - }; -}, 'TypeError: Iterator result interface is not an object.'); - -(function () { - var ok = 0; - shouldThrow(function () { - var [a, b, c] = { - [Symbol.iterator]() { - return this; - }, - - return() { - ok++; - }, - - next() { - return 42; - } - }; - }, 'TypeError: Iterator result interface is not an object.'); - - shouldBe(ok, 0); -}()); - -(function () { - var ok = 0; - shouldThrow(function () { - var [a, b, c] = { - [Symbol.iterator]() { - return this; - }, - - return() { - ok++; - }, - - next() { - return { value: 20, done: false }; - } - }; - }, 'TypeError: Iterator result interface is not an object.'); - - shouldBe(ok, 1); -}()); - -(function () { - var ok = 0; - - var [a, b, c] = { - [Symbol.iterator]() { - return this; - }, - - return() { - ok++; - }, - - next() { - return { value: 20, done: true }; - } - }; - - shouldBe(a, undefined); - shouldBe(b, undefined); - shouldBe(c, undefined); - shouldBe(ok, 0); -}()); - -(function () { - var ok = 0; - var n = 0; - - var done = false; - var [a, b, c] = { - [Symbol.iterator]() { - return this; - }, - - return() { - ok++; - }, - - next() { - var prev = done; - done = true; - ++n; - return { value: 20, done: prev }; - } - }; - - shouldBe(a, 20); - shouldBe(b, undefined); - shouldBe(c, undefined); - shouldBe(n, 2); - shouldBe(ok, 0); -}()); - -(function () { - var ok = 0; - var n = 0; - - var done = false; - var [a, b, c] = { - [Symbol.iterator]() { - return this; - }, - - return() { - ++ok; - return { done: true }; - }, - - next() { - ++n; - return { value: 20, done: false }; - } - }; - - shouldBe(a, 20); - shouldBe(b, 20); - shouldBe(c, 20); - shouldBe(n, 3); - shouldBe(ok, 1); -}()); - -(function () { - var ok = 0; - var n = 0; - - var done = false; - var [a, b, c] = { - [Symbol.iterator]() { - return this; - }, - - return() { - ++ok; - return { done: true }; - }, - - count: 0, - - next() { - ++n; - var done = ++this.count === 3; - return { value: 20, done }; - } - }; - - shouldBe(a, 20); - shouldBe(b, 20); - shouldBe(c, undefined); - shouldBe(n, 3); - shouldBe(ok, 0); -}()); - -(function () { - var ok = 0; - var n = 0; - - var done = false; - var [a, b, c] = { - [Symbol.iterator]() { - return this; - }, - - return() { - ++ok; - return { done: true }; - }, - - count: 0, - - next() { - ++n; - var done = ++this.count === 4; - return { value: 20, done }; - } - }; - - shouldBe(a, 20); - shouldBe(b, 20); - shouldBe(c, 20); - shouldBe(n, 3); - shouldBe(ok, 1); -}()); - -(function () { - var ok = 0; - var n = 0; - shouldThrow(function () { - var [a, b, c] = { - [Symbol.iterator]() { - return this; - }, - - return() { - ok++; - throw new Error('out'); - }, - - next() { - n++; - return { value: 20, done: false }; - } - }; - }, 'Error: out'); - - shouldBe(n, 3); - shouldBe(ok, 1); -}()); - -(function () { - var ok = 0; - var n = 0; - shouldThrow(function () { - var [a, b, c] = { - [Symbol.iterator]() { - return this; - }, - - get return() { - ok++; - throw new Error('out'); - }, - - next() { - n++; - return { value: 20, done: false }; - } - }; - }, 'Error: out'); - - shouldBe(n, 3); - shouldBe(ok, 1); -}()); - -(function () { - var ok = 0; - var n = 0; - shouldThrow(function () { - var [a, b, c] = { - [Symbol.iterator]() { - return this; - }, - - get return() { - ok++; - throw new Error('ng'); - }, - - next() { - n++; - throw new Error('out'); - } - }; - }, 'Error: out'); - - shouldBe(n, 1); - shouldBe(ok, 0); -}()); - -(function () { - var ok = 0; - var n = 0; - shouldThrow(function () { - var [a, b, c] = { - [Symbol.iterator]() { - return this; - }, - - get return() { - ok++; - throw new Error('ng'); - }, - - get next() { - ++n; - throw new Error('out'); - } - }; - }, 'Error: out'); - - shouldBe(n, 1); - shouldBe(ok, 0); -}()); diff --git a/implementation-contributed/javascriptcore/stress/destructuring-assignment-require-object-coercible.js b/implementation-contributed/javascriptcore/stress/destructuring-assignment-require-object-coercible.js deleted file mode 100644 index c25bb1b572..0000000000 --- a/implementation-contributed/javascriptcore/stress/destructuring-assignment-require-object-coercible.js +++ /dev/null @@ -1,68 +0,0 @@ -function testTypeError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected type error not thrown by `" + script + "`"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -function testOK(script) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (error) - throw new Error("Bad error: " + String(error)); -} - -testTypeError(`({ } = null)`, "TypeError: Right side of assignment cannot be destructured"); -testTypeError(`({ a } = null)`, "TypeError: Right side of assignment cannot be destructured"); -testTypeError(`({ a: { b } = null } = { })`, "TypeError: Right side of assignment cannot be destructured"); -testTypeError(`({ a: { b } } = { a: null })`, "TypeError: Right side of assignment cannot be destructured"); -testTypeError(`({ } = undefined)`, "TypeError: Right side of assignment cannot be destructured"); -testTypeError(`({ a } = undefined)`, "TypeError: Right side of assignment cannot be destructured"); -testTypeError(`({ a: { b } = undefined } = { })`, "TypeError: Right side of assignment cannot be destructured"); -testTypeError(`({ a: { b } } = { a: undefined })`, "TypeError: Right side of assignment cannot be destructured"); - -testOK(`({ } = 123)`); -testOK(`({ a } = 123)`); -testOK(`({ a: { b } = 123 } = { })`); -testOK(`({ a: { b } } = { a: 123 })`); - -testOK(`({ } = 0.5)`); -testOK(`({ a } = 0.5)`); -testOK(`({ a: { b } = 0.5 } = { })`); -testOK(`({ a: { b } } = { a: 0.5 })`); - -testOK(`({ } = NaN)`); -testOK(`({ a } = NaN)`); -testOK(`({ a: { b } = NaN } = { })`); -testOK(`({ a: { b } } = { a: NaN })`); - -testOK(`({ } = true)`); -testOK(`({ a } = true)`); -testOK(`({ a: { b } = true } = { })`); -testOK(`({ a: { b } } = { a: true })`); - -testOK(`({ } = {})`); -testOK(`({ a } = {})`); -testOK(`({ a: { b } = {} } = { })`); -testOK(`({ a: { b } } = { a: {} })`); - -testOK(`({ } = [])`); -testOK(`({ a } = [])`); -testOK(`({ a: { b } = [] } = { })`); -testOK(`({ a: { b } } = { a: [] })`); - -testOK(`({ } = /1/)`); -testOK(`({ a } = /1/)`); -testOK(`({ a: { b } = /1/ } = { })`); -testOK(`({ a: { b } } = { a: /1/ })`); diff --git a/implementation-contributed/javascriptcore/stress/destructuring-assignment-syntax.js b/implementation-contributed/javascriptcore/stress/destructuring-assignment-syntax.js deleted file mode 100644 index 4567da25e2..0000000000 --- a/implementation-contributed/javascriptcore/stress/destructuring-assignment-syntax.js +++ /dev/null @@ -1,72 +0,0 @@ - -function testSyntax(script) { - try { - eval(script); - } catch (error) { - if (error instanceof SyntaxError) - throw new Error("Bad error: " + String(error)); - } -} - -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -testSyntax("({ a: this.a } = {})"); -testSyntax("({ a: this['a'] } = {})"); -testSyntax("({ a: this[\"a\"] } = {})"); -testSyntax("[this.a ] = []"); -testSyntax("[this['a']] = []"); -testSyntax("[this[0]] = []"); -testSyntax("[...this[0]] = []"); -testSyntax("[...[function f() {}.prop]] = []"); -testSyntax("[...[{prop: 1}.prop]] = []"); -testSyntax("[...[this[0], ...this[1]]] = []"); -testSyntax("({ a: obj.a } = {})"); -testSyntax("({ a: obj['a'] } = {})"); -testSyntax("({ a: obj[\"a\"] } = {})"); -testSyntax("({ a: function() {}['prop'] } = {})"); -testSyntax("({ a: {prop: 1}.prop } = {})"); -testSyntax("[obj.a ] = []"); -testSyntax("[obj['a']] = []"); -testSyntax("[obj[0]] = []"); -testSyntax("[function(){}.prop] = []"); -testSyntax("[{prop: 1}.prop] = []"); - - -testSyntaxError("[...c = 1] = []", "SyntaxError: Unexpected token '='. Expected a closing ']' following a rest element destructuring pattern."); -testSyntaxError("[...c, d] = []", "SyntaxError: Unexpected token ','. Expected a closing ']' following a rest element destructuring pattern."); -testSyntaxError("[this] = []", "SyntaxError: Invalid destructuring assignment target."); -testSyntaxError("[th\\u{69}s] = []", "SyntaxError: Unexpected escaped characters in keyword token: 'th\\u{69}s'"); -testSyntaxError("[function() {}] = []", "SyntaxError: Invalid destructuring assignment target."); -testSyntaxError("['string'] = []", "SyntaxError: Invalid destructuring assignment target."); -testSyntaxError("[123] = []", "SyntaxError: Invalid destructuring assignment target."); -testSyntaxError("[true] = []", "SyntaxError: Invalid destructuring assignment target."); -testSyntaxError("[tru\\u0065] = []", "SyntaxError: Unexpected escaped characters in keyword token: 'tru\\u0065'"); -testSyntaxError("[false] = []", "SyntaxError: Invalid destructuring assignment target."); -testSyntaxError("[f\\u0061lse] = []", "SyntaxError: Unexpected escaped characters in keyword token: 'f\\u0061lse'"); -testSyntaxError("[null] = []", "SyntaxError: Invalid destructuring assignment target."); -testSyntaxError("[n\\u{75}ll] = []", "SyntaxError: Unexpected escaped characters in keyword token: 'n\\u{75}ll'"); - -testSyntaxError("'use strict'; ({ eval } = {})", "SyntaxError: Cannot modify 'eval' in strict mode."); -testSyntaxError("'use strict'; ({ eval = 0 } = {})", "SyntaxError: Cannot modify 'eval' in strict mode."); -testSyntaxError("'use strict'; ({ a: eval } = {})", "SyntaxError: Cannot modify 'eval' in strict mode."); -testSyntaxError("'use strict'; ({ a: eval = 0 } = {})", "SyntaxError: Cannot modify 'eval' in strict mode."); -testSyntaxError("'use strict'; ({ arguments } = {})", "SyntaxError: Cannot modify 'arguments' in strict mode."); -testSyntaxError("'use strict'; ({ arguments = 0 } = {})", "SyntaxError: Cannot modify 'arguments' in strict mode."); -testSyntaxError("'use strict'; ({ a: arguments } = {})", "SyntaxError: Cannot modify 'arguments' in strict mode."); -testSyntaxError("'use strict'; ({ a: arguments = 0 } = {})", "SyntaxError: Cannot modify 'arguments' in strict mode."); -testSyntaxError("'use strict'; ([ eval ] = [])", "SyntaxError: Cannot modify 'eval' in strict mode."); -testSyntaxError("'use strict'; ([ eval = 0 ] = [])", "SyntaxError: Cannot modify 'eval' in strict mode."); -testSyntaxError("'use strict'; ([ arguments ] = [])", "SyntaxError: Cannot modify 'arguments' in strict mode."); -testSyntaxError("'use strict'; ([ arguments = 0 ] = [])", "SyntaxError: Cannot modify 'arguments' in strict mode."); diff --git a/implementation-contributed/javascriptcore/stress/destructuring-rest-element.js b/implementation-contributed/javascriptcore/stress/destructuring-rest-element.js deleted file mode 100644 index 7784e4a37a..0000000000 --- a/implementation-contributed/javascriptcore/stress/destructuring-rest-element.js +++ /dev/null @@ -1,107 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} -noInline(assert); - -function test(f, count = 1000) { - for (let i = 0; i < count; i++) - f(); -} - -function arr() { - return [10, 20, 30, 40]; -} -noInline(arr); - -let o = {}; -function arr2() { - return [10, 20, 30, [40, 50, o]]; -} -noInline(arr); - -function eq(a, b) { - // This only works for arrays with nested arrays in them, and numbers or anything else strict equal to each other. - if (!(a instanceof Array)) - return a === b; - - if (a.length !== b.length) - return false; - - for (let i = 0; i < a.length; i++) { - let e1 = a[i]; - let e2 = b[i]; - if (!eq(e1, e2)) - return false; - } - - return true; -} - -test(function() { - let [...[...x]] = arr(); - assert(eq(x, arr())); -}); - -test(function() { - let [ , , , [...e]] = arr2(); - assert(eq(e, [40, 50, o])); -}); - -test(function() { - let [ , , , ...e] = arr2(); - assert(eq(e[0], [40, 50, o])); -}); - -test(function() { - let [ , , , ...e] = arr2(); - assert(eq(e[0], [40, 50, o])); -}); - -function* gen() { - yield [1,2,3]; - yield 20; - yield 30; - yield 40; -} - -test(function() { - let [a, b, ...[...c]] = gen(); - assert(eq(a, [1,2,3])); - assert(b === 20); - assert(eq(c, [30, 40])); -}); - -test(function() { - let [[a, ...d], b, ...[...c]] = gen(); - assert(a === 1); - assert(eq(d, [2,3])); - assert(b === 20); - assert(eq(c, [30, 40])); -}); - -let called = false; -function fakeGen() { - return { - [Symbol.iterator]: function() { - let count = 0; - return { - next() { - called = true; - count++; - if (count === 1) - return {done: false, value: 50}; - return {done: true}; - } - }; - } - }; -} - -test(function() { - called = false; - let [...x] = fakeGen(); - assert(eq(x, [50])); - assert(called); - called = false; -}); diff --git a/implementation-contributed/javascriptcore/stress/dfg-call-class-constructor.js b/implementation-contributed/javascriptcore/stress/dfg-call-class-constructor.js deleted file mode 100644 index 6db3c51b58..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-call-class-constructor.js +++ /dev/null @@ -1,14 +0,0 @@ -class Foo extends Promise { } - -noInline(Foo); - -for (var i = 0; i < 10000; ++i) { - var completed = false; - try { - Foo(); - completed = true; - } catch (e) { - } - if (completed) - throw "Error: completed without throwing"; -} diff --git a/implementation-contributed/javascriptcore/stress/dfg-create-arguments-inline-alloc.js b/implementation-contributed/javascriptcore/stress/dfg-create-arguments-inline-alloc.js deleted file mode 100644 index 175a2f21d3..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-create-arguments-inline-alloc.js +++ /dev/null @@ -1,19 +0,0 @@ -var foo = function(o) { - var a = Array.prototype.slice.call(arguments); - var sum = 0; - for (var i = 0; i < a.length; ++i) - sum += a[i].x; - return sum; -}; - -noInline(foo); - -var niters = 10000; -var total = 0; -var o = {x: 42}; -for (var i = 0; i < niters; ++i) { - total += foo(o, o, o); -} - -if (total != 42 * 3 * niters) - throw new Error("Incorrect result!"); diff --git a/implementation-contributed/javascriptcore/stress/dfg-del-by-id.js b/implementation-contributed/javascriptcore/stress/dfg-del-by-id.js deleted file mode 100644 index 66f2f0bd15..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-del-by-id.js +++ /dev/null @@ -1,14 +0,0 @@ -function foo(o) { - return delete o.f; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var o = {f:42}; - var result = foo(o); - if (result !== true) - throw "Error: bad result: " + result; - if ("f" in o) - throw "Error: \"f\" still in ok"; -} diff --git a/implementation-contributed/javascriptcore/stress/dfg-exception-try-catch-in-constructor-with-inlined-throw.js b/implementation-contributed/javascriptcore/stress/dfg-exception-try-catch-in-constructor-with-inlined-throw.js deleted file mode 100644 index 1346cefe3c..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-exception-try-catch-in-constructor-with-inlined-throw.js +++ /dev/null @@ -1,27 +0,0 @@ -function f() { - return 20; -} -noInline(f); - -function bar(b) { - if (b) - throw new Error("blah!"); -} - -function Foo(b) { - try { - this.value = bar(b); - } catch(e) { - this.value = e.toString(); - } - - f(this.value, b); -} -noInline(Foo); - - -for (var i = 1; i < 1000; i++) { - let value = new Foo(i % 3 === 0); - if (i % 3 === 0 && value.value !== "Error: blah!") - throw new Error("bad value: " + value.value); -} diff --git a/implementation-contributed/javascriptcore/stress/dfg-get-by-id-should-not-assert-non-null-prediction.js b/implementation-contributed/javascriptcore/stress/dfg-get-by-id-should-not-assert-non-null-prediction.js deleted file mode 100644 index b6fac0243b..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-get-by-id-should-not-assert-non-null-prediction.js +++ /dev/null @@ -1,18 +0,0 @@ -//@ runDefault -// This test should not crash. - -function foo() { - "use strict"; - return --arguments["callee"]; -}; - -function test() { - for (var i = 0; i < 10000; i++) { - try { - foo(); - } catch(e) { - } - } -} - -test(); diff --git a/implementation-contributed/javascriptcore/stress/dfg-internal-function-call.js b/implementation-contributed/javascriptcore/stress/dfg-internal-function-call.js deleted file mode 100644 index d04852aaea..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-internal-function-call.js +++ /dev/null @@ -1,14 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} -noInline(shouldBe); - -function target(func) -{ - return func(); -} -noInline(target); - -for (var i = 0; i < 1e4; ++i) - shouldBe(target(Array).length, 0); diff --git a/implementation-contributed/javascriptcore/stress/dfg-internal-function-construct.js b/implementation-contributed/javascriptcore/stress/dfg-internal-function-construct.js deleted file mode 100644 index 671942efbb..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-internal-function-construct.js +++ /dev/null @@ -1,14 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} -noInline(shouldBe); - -function target(func) -{ - return new func(); -} -noInline(target); - -for (var i = 0; i < 1e4; ++i) - shouldBe(target(Array).length, 0); diff --git a/implementation-contributed/javascriptcore/stress/dfg-node-convert-to-constant-must-clear-varargs-flags.js b/implementation-contributed/javascriptcore/stress/dfg-node-convert-to-constant-must-clear-varargs-flags.js deleted file mode 100644 index dab790b87c..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-node-convert-to-constant-must-clear-varargs-flags.js +++ /dev/null @@ -1,14 +0,0 @@ -function doIndexOf(a) { - a.indexOf(a); -} - -function bar(f) { - f(); -} - -let array = [20]; -for (let i = 0; i < 100000; ++i) { - bar(() => { - return doIndexOf(array.concat()); - }); -} diff --git a/implementation-contributed/javascriptcore/stress/dfg-object-proto-accessor.js b/implementation-contributed/javascriptcore/stress/dfg-object-proto-accessor.js deleted file mode 100644 index 0f6db7b74e..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-object-proto-accessor.js +++ /dev/null @@ -1,115 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -(function () { - function target(object) - { - return object.__proto__; - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target({}), Object.prototype); -}()); - -(function () { - function target(object) - { - return object.__proto__; - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) { - shouldThrow(() => target(null), `TypeError: null is not an object (evaluating 'object.__proto__')`); - shouldThrow(() => target(undefined), `TypeError: undefined is not an object (evaluating 'object.__proto__')`); - } -}()); - -(function () { - function target(object) - { - return object.__proto__; - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target("Cocoa"), String.prototype); -}()); - -(function () { - function target(object) - { - return object.__proto__; - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target(42), Number.prototype); -}()); - -(function () { - function target(object) - { - return object.__proto__; - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target(42.195), Number.prototype); -}()); - -(function () { - function target(object) - { - return object.__proto__; - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target(true), Boolean.prototype); -}()); - -(function () { - function target(object) - { - return object.__proto__; - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target(Symbol("Cocoa")), Symbol.prototype); -}()); - -(function () { - function target(object) - { - return object.__proto__; - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) { - shouldBe(target("Cocoa"), String.prototype); - shouldBe(target(42), Number.prototype); - shouldBe(target(42.195), Number.prototype); - shouldBe(target(true), Boolean.prototype); - shouldBe(target(Symbol("Cocoa")), Symbol.prototype); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/dfg-object-proto-getter.js b/implementation-contributed/javascriptcore/stress/dfg-object-proto-getter.js deleted file mode 100644 index 9a0716d5aa..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-object-proto-getter.js +++ /dev/null @@ -1,117 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -var protoFunction = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").get; - -(function () { - function target(object) - { - return protoFunction.call(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target({}), Object.prototype); -}()); - -(function () { - function target(object) - { - return protoFunction.call(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) { - shouldThrow(() => target(null), `TypeError: null is not an object (evaluating 'protoFunction.call(object)')`); - shouldThrow(() => target(undefined), `TypeError: undefined is not an object (evaluating 'protoFunction.call(object)')`); - } -}()); - -(function () { - function target(object) - { - return protoFunction.call(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target("Cocoa"), String.prototype); -}()); - -(function () { - function target(object) - { - return protoFunction.call(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target(42), Number.prototype); -}()); - -(function () { - function target(object) - { - return protoFunction.call(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target(42.195), Number.prototype); -}()); - -(function () { - function target(object) - { - return protoFunction.call(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target(true), Boolean.prototype); -}()); - -(function () { - function target(object) - { - return protoFunction.call(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target(Symbol("Cocoa")), Symbol.prototype); -}()); - -(function () { - function target(object) - { - return protoFunction.call(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) { - shouldBe(target("Cocoa"), String.prototype); - shouldBe(target(42), Number.prototype); - shouldBe(target(42.195), Number.prototype); - shouldBe(target(true), Boolean.prototype); - shouldBe(target(Symbol("Cocoa")), Symbol.prototype); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/dfg-object-prototype-of.js b/implementation-contributed/javascriptcore/stress/dfg-object-prototype-of.js deleted file mode 100644 index 4e2684d798..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-object-prototype-of.js +++ /dev/null @@ -1,115 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -(function () { - function target(object) - { - return Object.getPrototypeOf(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target({}), Object.prototype); -}()); - -(function () { - function target(object) - { - return Object.getPrototypeOf(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) { - shouldThrow(() => target(null), `TypeError: null is not an object (evaluating 'Object.getPrototypeOf(object)')`); - shouldThrow(() => target(undefined), `TypeError: undefined is not an object (evaluating 'Object.getPrototypeOf(object)')`); - } -}()); - -(function () { - function target(object) - { - return Object.getPrototypeOf(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target("Cocoa"), String.prototype); -}()); - -(function () { - function target(object) - { - return Object.getPrototypeOf(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target(42), Number.prototype); -}()); - -(function () { - function target(object) - { - return Object.getPrototypeOf(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target(42.195), Number.prototype); -}()); - -(function () { - function target(object) - { - return Object.getPrototypeOf(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target(true), Boolean.prototype); -}()); - -(function () { - function target(object) - { - return Object.getPrototypeOf(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target(Symbol("Cocoa")), Symbol.prototype); -}()); - -(function () { - function target(object) - { - return Object.getPrototypeOf(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) { - shouldBe(target("Cocoa"), String.prototype); - shouldBe(target(42), Number.prototype); - shouldBe(target(42.195), Number.prototype); - shouldBe(target(true), Boolean.prototype); - shouldBe(target(Symbol("Cocoa")), Symbol.prototype); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/dfg-put-accessors-by-id-class.js b/implementation-contributed/javascriptcore/stress/dfg-put-accessors-by-id-class.js deleted file mode 100644 index 3b7ac5b53f..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-put-accessors-by-id-class.js +++ /dev/null @@ -1,82 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testAttribute(object, name, type) { - shouldBe(Reflect.has(object, name), true); - let desc = Reflect.getOwnPropertyDescriptor(object, name); - shouldBe(desc.configurable, true); - shouldBe(desc.enumerable, false); - if (type === 'get') { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'undefined'); - } else if (type === 'set') { - shouldBe(typeof desc.get, 'undefined'); - shouldBe(typeof desc.set, 'function'); - } else { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'function'); - } -} -noInline(testAttribute); - -function getter() -{ - class Cocoa { - get hello() { - return 42; - } - } - - let object = new Cocoa(); - testAttribute(object.__proto__, 'hello', 'get'); - return object.hello; -} -noInline(getter); - -function setter() -{ - class Cocoa { - constructor() { - this.value = 0; - } - set hello(value) { - this.value = value; - } - } - - let object = new Cocoa(); - testAttribute(object.__proto__, 'hello', 'set'); - object.hello = 42; - return object.value; - -} -noInline(setter); - -function accessors() -{ - class Cocoa { - constructor() { - this.value = 0; - } - get hello() { - return this.value; - } - set hello(value) { - this.value = value; - } - } - - let object = new Cocoa(); - testAttribute(object.__proto__, 'hello', 'getset'); - object.hello = 42; - return object.hello; -} -noInline(accessors); - -for (var i = 0; i < 10000; ++i) { - shouldBe(getter(), 42); - shouldBe(setter(), 42); - shouldBe(accessors(), 42); -} diff --git a/implementation-contributed/javascriptcore/stress/dfg-put-accessors-by-id.js b/implementation-contributed/javascriptcore/stress/dfg-put-accessors-by-id.js deleted file mode 100644 index b46dc78d59..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-put-accessors-by-id.js +++ /dev/null @@ -1,75 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testAttribute(object, name, type) { - shouldBe(Reflect.has(object, name), true); - let desc = Reflect.getOwnPropertyDescriptor(object, name); - shouldBe(desc.configurable, true); - shouldBe(desc.enumerable, true); - if (type === 'get') { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'undefined'); - } else if (type === 'set') { - shouldBe(typeof desc.get, 'undefined'); - shouldBe(typeof desc.set, 'function'); - } else { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'function'); - } -} -noInline(testAttribute); - -function getter() -{ - var object = { - get hello() { - return 42; - } - }; - - testAttribute(object, 'hello', 'get'); - return object.hello; -} -noInline(getter); - -function setter() -{ - var object = { - value: 0, - set hello(value) { - this.value = value; - } - }; - - testAttribute(object, 'hello', 'set'); - object.hello = 42; - return object.value; - -} -noInline(setter); - -function accessors() -{ - var object = { - value: 0, - get hello() { - return this.value; - }, - set hello(value) { - this.value = value; - } - }; - - testAttribute(object, 'hello', 'getset'); - object.hello = 42; - return object.hello; -} -noInline(accessors); - -for (var i = 0; i < 10000; ++i) { - shouldBe(getter(), 42); - shouldBe(setter(), 42); - shouldBe(accessors(), 42); -} diff --git a/implementation-contributed/javascriptcore/stress/dfg-put-by-val-direct-with-edge-numbers.js b/implementation-contributed/javascriptcore/stress/dfg-put-by-val-direct-with-edge-numbers.js deleted file mode 100644 index ebf21e2334..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-put-by-val-direct-with-edge-numbers.js +++ /dev/null @@ -1,104 +0,0 @@ -// Test that a object accepts DFG PutByValueDirect operation with edge numbers. - -function lookupWithKey(key) { - var object = { - [key]: 42 - }; - return object[key]; -} -noInline(lookupWithKey); - -for (var i = 0; i < 10000; ++i) { - [ - // integers - -0x80000001, // out of int32_t - -0x80000000, // int32_t min - -1, // negative - 0, // zero - 1, // positive - 0x7fffffff, // int32_t max - 0x80000000, // out of int32_t - 0xfffffffd, // less than array max in JSObject - 0xfffffffe, // array max in JSObject - 0xffffffff, // uint32_t max, not array index - 0x100000000, // out of uint32_t - - // stringified integers - (-0x80000001).toString(), // out of int32_t - (-0x80000000).toString(), // int32_t min - (-1).toString(), // negative - (0).toString(), // zero - (1).toString(), // positive - (0x7fffffff).toString(), // int32_t max - (0x80000000).toString(), // out of int32_t - (0xfffffffd).toString(), // less than array max in JSObject - (0xfffffffe).toString(), // array max in JSObject - (0xffffffff).toString(), // (uint32_t max).toString() - (0x100000000).toString(), // out of uint32_t - - // doubles - Number.MIN_VALUE, - Number.MAX_VALUE, - Number.MIN_SAFE_INTEGER, - Number.MAX_SAFE_INTEGER, - Number.POSITIVE_INFINITY, - Number.NEGATIVE_INFINITY, - Number.NaN, - Number.EPSILON, - +0.0, - -0.0, - 0.1, - -0.1, - 4.2, - -4.2, - 0x80000000 + 0.5, // out of int32_t, double - - // stringified doules - (Number.MIN_VALUE).toString(), - (Number.MAX_VALUE).toString(), - (Number.MIN_SAFE_INTEGER).toString(), - (Number.MAX_SAFE_INTEGER).toString(), - (Number.POSITIVE_INFINITY).toString(), - (Number.NEGATIVE_INFINITY).toString(), - "NaN", - (Number.EPSILON).toString(), - "+0.0", - "-0.0", - "0.1", - "-0.1", - "4.2", - "-4.2", - (0x80000000 + 0.5).toString() - ].forEach(function (key) { - var value = lookupWithKey(key); - if (value !== 42) - throw new Error('bad value: ' + value); - }); -} - -function lookupWithKey2(key) { - var object = { - [key]: 42 - }; - return object[key]; -} -noInline(lookupWithKey2); - -var toStringThrowsError = { - toString: function () { - throw new Error('ng'); - } -}; - -for (var i = 0; i < 10000; ++i) { - var error = null; - try { - lookupWithKey2(toStringThrowsError); - } catch (e) { - error = e; - } - if (!error) - throw new Error('not thrown'); - if (String(error) !== 'Error: ng') - throw new Error('bad error: ' + String(error)); -} diff --git a/implementation-contributed/javascriptcore/stress/dfg-put-getter-by-id-class.js b/implementation-contributed/javascriptcore/stress/dfg-put-getter-by-id-class.js deleted file mode 100644 index 7f4d6e6eea..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-put-getter-by-id-class.js +++ /dev/null @@ -1,45 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testAttribute(object, name, type) { - shouldBe(Reflect.has(object, name), true); - let desc = Reflect.getOwnPropertyDescriptor(object, name); - shouldBe(desc.configurable, true); - shouldBe(desc.enumerable, false); - if (type === 'get') { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'undefined'); - } else if (type === 'set') { - shouldBe(typeof desc.get, 'undefined'); - shouldBe(typeof desc.set, 'function'); - } else { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'function'); - } -} -noInline(testAttribute); - -function getter(name) -{ - class Cocoa { - constructor() { - this.ok = 42; - } - get hello() { - return this.ok; - } - get [name]() { - } - } - - let object = new Cocoa(); - testAttribute(object.__proto__, 'hello', 'get'); - testAttribute(object.__proto__, 'dummy', 'get'); - return object.hello; -} -noInline(getter); - -for (var i = 0; i < 10000; ++i) - shouldBe(getter('dummy'), 42); diff --git a/implementation-contributed/javascriptcore/stress/dfg-put-getter-by-id.js b/implementation-contributed/javascriptcore/stress/dfg-put-getter-by-id.js deleted file mode 100644 index 45893e7441..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-put-getter-by-id.js +++ /dev/null @@ -1,39 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testAttribute(object, name, type) { - shouldBe(Reflect.has(object, name), true); - let desc = Reflect.getOwnPropertyDescriptor(object, name); - shouldBe(desc.configurable, true); - shouldBe(desc.enumerable, true); - if (type === 'get') { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'undefined'); - } else if (type === 'set') { - shouldBe(typeof desc.get, 'undefined'); - shouldBe(typeof desc.set, 'function'); - } else { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'function'); - } -} -noInline(testAttribute); - -function getter(name) -{ - var object = { - get hello() { - return this.ok; - }, - [name]: 42 - }; - - testAttribute(object, 'hello', 'get'); - return object.hello; -} -noInline(getter); - -for (var i = 0; i < 10000; ++i) - shouldBe(getter('ok'), 42); diff --git a/implementation-contributed/javascriptcore/stress/dfg-put-getter-by-val-class.js b/implementation-contributed/javascriptcore/stress/dfg-put-getter-by-val-class.js deleted file mode 100644 index 0eb5c4185d..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-put-getter-by-val-class.js +++ /dev/null @@ -1,42 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testAttribute(object, name, type) { - shouldBe(Reflect.has(object, name), true); - let desc = Reflect.getOwnPropertyDescriptor(object, name); - shouldBe(desc.configurable, true); - shouldBe(desc.enumerable, false); - if (type === 'get') { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'undefined'); - } else if (type === 'set') { - shouldBe(typeof desc.get, 'undefined'); - shouldBe(typeof desc.set, 'function'); - } else { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'function'); - } -} -noInline(testAttribute); - -function getter(name) -{ - class Cocoa { - constructor() { - this.ok = 42; - } - get [name]() { - return this.ok; - } - } - - let object = new Cocoa(); - testAttribute(object.__proto__, 'hello', 'get'); - return object.hello; -} -noInline(getter); - -for (var i = 0; i < 10000; ++i) - shouldBe(getter('hello'), 42); diff --git a/implementation-contributed/javascriptcore/stress/dfg-put-getter-by-val.js b/implementation-contributed/javascriptcore/stress/dfg-put-getter-by-val.js deleted file mode 100644 index 74b614a8cc..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-put-getter-by-val.js +++ /dev/null @@ -1,39 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testAttribute(object, name, type) { - shouldBe(Reflect.has(object, name), true); - let desc = Reflect.getOwnPropertyDescriptor(object, name); - shouldBe(desc.configurable, true); - shouldBe(desc.enumerable, true); - if (type === 'get') { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'undefined'); - } else if (type === 'set') { - shouldBe(typeof desc.get, 'undefined'); - shouldBe(typeof desc.set, 'function'); - } else { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'function'); - } -} -noInline(testAttribute); - -function getter(name) -{ - var object = { - ok: 42, - get [name]() { - return this.ok; - } - }; - - testAttribute(object, 'hello', 'get'); - return object.hello; -} -noInline(getter); - -for (var i = 0; i < 10000; ++i) - shouldBe(getter('hello'), 42); diff --git a/implementation-contributed/javascriptcore/stress/dfg-put-setter-by-id-class.js b/implementation-contributed/javascriptcore/stress/dfg-put-setter-by-id-class.js deleted file mode 100644 index bb5b79d992..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-put-setter-by-id-class.js +++ /dev/null @@ -1,46 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testAttribute(object, name, type) { - shouldBe(Reflect.has(object, name), true); - let desc = Reflect.getOwnPropertyDescriptor(object, name); - shouldBe(desc.configurable, true); - shouldBe(desc.enumerable, false); - if (type === 'get') { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'undefined'); - } else if (type === 'set') { - shouldBe(typeof desc.get, 'undefined'); - shouldBe(typeof desc.set, 'function'); - } else { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'function'); - } -} -noInline(testAttribute); - -function getter(name) -{ - class Cocoa { - constructor() { - this.ok = 0; - } - set hello(value) { - this.ok = value; - } - get [name]() { - } - } - - let object = new Cocoa(); - testAttribute(object.__proto__, 'hello', 'set'); - testAttribute(object.__proto__, 'dummy', 'get'); - object.hello = 42; - return object.ok; -} -noInline(getter); - -for (var i = 0; i < 10000; ++i) - shouldBe(getter('dummy'), 42); diff --git a/implementation-contributed/javascriptcore/stress/dfg-put-setter-by-id.js b/implementation-contributed/javascriptcore/stress/dfg-put-setter-by-id.js deleted file mode 100644 index 8f6f3b98cc..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-put-setter-by-id.js +++ /dev/null @@ -1,41 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testAttribute(object, name, type) { - shouldBe(Reflect.has(object, name), true); - let desc = Reflect.getOwnPropertyDescriptor(object, name); - shouldBe(desc.configurable, true); - shouldBe(desc.enumerable, true); - if (type === 'get') { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'undefined'); - } else if (type === 'set') { - shouldBe(typeof desc.get, 'undefined'); - shouldBe(typeof desc.set, 'function'); - } else { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'function'); - } -} -noInline(testAttribute); - -function setter(name) -{ - var object = { - set hello(value) { - this.ok = value; - }, - [name]: 0 - }; - - testAttribute(object, 'hello', 'set'); - object.hello = 42; - return object.ok; - -} -noInline(setter); - -for (var i = 0; i < 10000; ++i) - shouldBe(setter('ok'), 42); diff --git a/implementation-contributed/javascriptcore/stress/dfg-put-setter-by-val-class.js b/implementation-contributed/javascriptcore/stress/dfg-put-setter-by-val-class.js deleted file mode 100644 index f29c9ecfd4..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-put-setter-by-val-class.js +++ /dev/null @@ -1,44 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testAttribute(object, name, type) { - shouldBe(Reflect.has(object, name), true); - let desc = Reflect.getOwnPropertyDescriptor(object, name); - shouldBe(desc.configurable, true); - shouldBe(desc.enumerable, false); - if (type === 'get') { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'undefined'); - } else if (type === 'set') { - shouldBe(typeof desc.get, 'undefined'); - shouldBe(typeof desc.set, 'function'); - } else { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'function'); - } -} -noInline(testAttribute); - -function setter(name) -{ - class Cocoa { - constructor() { - this.ok = 0; - } - set [name](value) { - this.ok = value; - } - } - - let object = new Cocoa(); - testAttribute(object.__proto__, 'hello', 'set'); - object.hello = 42; - return object.ok; - -} -noInline(setter); - -for (var i = 0; i < 10000; ++i) - shouldBe(setter('hello'), 42); diff --git a/implementation-contributed/javascriptcore/stress/dfg-put-setter-by-val.js b/implementation-contributed/javascriptcore/stress/dfg-put-setter-by-val.js deleted file mode 100644 index 2a3546b62f..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-put-setter-by-val.js +++ /dev/null @@ -1,41 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testAttribute(object, name, type) { - shouldBe(Reflect.has(object, name), true); - let desc = Reflect.getOwnPropertyDescriptor(object, name); - shouldBe(desc.configurable, true); - shouldBe(desc.enumerable, true); - if (type === 'get') { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'undefined'); - } else if (type === 'set') { - shouldBe(typeof desc.get, 'undefined'); - shouldBe(typeof desc.set, 'function'); - } else { - shouldBe(typeof desc.get, 'function'); - shouldBe(typeof desc.set, 'function'); - } -} -noInline(testAttribute); - -function setter(name) -{ - var object = { - ok: 0, - set [name](value) { - this.ok = value; - } - }; - - testAttribute(object, 'hello', 'set'); - object.hello = 42; - return object.ok; - -} -noInline(setter); - -for (var i = 0; i < 10000; ++i) - shouldBe(setter('hello'), 42); diff --git a/implementation-contributed/javascriptcore/stress/dfg-rare-data.js b/implementation-contributed/javascriptcore/stress/dfg-rare-data.js deleted file mode 100644 index 45a3f0e154..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-rare-data.js +++ /dev/null @@ -1,9 +0,0 @@ -function F () { this.inner = 42; }; - -for (var i = 0; i < 10000; ++i) { - var x = new F(false); - F.prototype = Object; // Force clearing of the function's rare data - var result = x.inner; - if (result !== 42) - throw "Expected 42, got: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/dfg-reflect-get-prototype-of.js b/implementation-contributed/javascriptcore/stress/dfg-reflect-get-prototype-of.js deleted file mode 100644 index 7c888ff902..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-reflect-get-prototype-of.js +++ /dev/null @@ -1,58 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -(function () { - function target(object) - { - return Reflect.getPrototypeOf(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) - shouldBe(target({}), Object.prototype); -}()); - -(function () { - function target(object) - { - return Reflect.getPrototypeOf(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) { - shouldThrow(() => target(null), `TypeError: Reflect.getPrototypeOf requires the first argument be an object`); - shouldThrow(() => target(undefined), `TypeError: Reflect.getPrototypeOf requires the first argument be an object`); - } -}()); - -(function () { - function target(object) - { - return Reflect.getPrototypeOf(object); - } - noInline(target); - - for (var i = 0; i < 1e3; ++i) { - shouldThrow(() => target("Cocoa"), `TypeError: Reflect.getPrototypeOf requires the first argument be an object`); - shouldThrow(() => target(42), `TypeError: Reflect.getPrototypeOf requires the first argument be an object`); - shouldThrow(() => target(true), `TypeError: Reflect.getPrototypeOf requires the first argument be an object`); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/dfg-ssa-swap.js b/implementation-contributed/javascriptcore/stress/dfg-ssa-swap.js deleted file mode 100644 index 2c0ad68a2c..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-ssa-swap.js +++ /dev/null @@ -1,8 +0,0 @@ -var i,c=0; -function foo() -{ - var a=1,b;for(i=0;i<2;++i){[a,b]=[b,a];c++}if(!a^b)throw c -} -noInline(foo); -for(var k = 0; k < 10000; ++k) - foo() diff --git a/implementation-contributed/javascriptcore/stress/dfg-tail-calls.js b/implementation-contributed/javascriptcore/stress/dfg-tail-calls.js deleted file mode 100644 index ef51c0ca82..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-tail-calls.js +++ /dev/null @@ -1,56 +0,0 @@ -(function nonInlinedTailCall() { - function callee() { if (callee.caller != nonInlinedTailCall) throw new Error(); } - noInline(callee); - - function caller() { "use strict"; return callee(); } - - for (var i = 0; i < 10000; ++i) - caller(); - - function loop(n) { "use strict"; if (n > 0) return loop(n - 1); } - noInline(loop); - - loop(1000000); -})(); - -(function inlinedTailCall() { - function callee() { if (callee.caller != inlinedTailCall) throw new Error(); } - function caller() { "use strict"; return callee(); } - - for (var i = 0; i < 10000; ++i) - caller(); - - function loop(n) { "use strict"; if (n > 0) return loop(n - 1); } - - loop(1000000); -})(); - -(function nonInlinedEmulatedTailCall() { - function emulator() { caller(); } - function callee() { if (callee.caller != emulator) throw new Error(); } - noInline(callee); - function caller() { "use strict"; return callee(); } - - for (var i = 0; i < 10000; ++i) - emulator(); - - function pad(n) { "use strict"; return loop(n); } - function loop(n) { "use strict"; if (n > 0) return pad(n - 1); } - noInline(loop); - - loop(1000000); -})(); - -(function inlinedEmulatedTailCall() { - function emulator() { caller(); } - function callee() { if (callee.caller != emulator) throw new Error(); } - function caller() { "use strict"; return callee(); } - - for (var i = 0; i < 10000; ++i) - emulator(); - - function pad(n) { "use strict"; return loop(n); } - function loop(n) { "use strict"; if (n > 0) return pad(n - 1); } - - loop(1000000); -})(); diff --git a/implementation-contributed/javascriptcore/stress/dfg-to-primitive-pass-symbol.js b/implementation-contributed/javascriptcore/stress/dfg-to-primitive-pass-symbol.js deleted file mode 100644 index 5d265743e0..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-to-primitive-pass-symbol.js +++ /dev/null @@ -1,35 +0,0 @@ -var shouldThrow = false; - -// str concat generates op_to_primitive. -function toPrimitiveTarget() { - if (shouldThrow) { - return Symbol('Cocoa'); - } - return 'Cocoa'; -} -noInline(toPrimitiveTarget); - -function doToPrimitive() { - var value = toPrimitiveTarget(); - return value + "Cappuccino" + value; -} -noInline(doToPrimitive); - -for (var i = 0; i < 10000; ++i) { - var result = doToPrimitive(); - if (result !== "CocoaCappuccinoCocoa") - throw "Error: bad result: " + result; -} - -shouldThrow = true; - -var didThrow; -try { - shouldThrow = true; - doToPrimitive(); -} catch (e) { - didThrow = e; -} - -if (String(didThrow) !== "TypeError: Cannot convert a symbol to a string") - throw "Error: didn't throw or threw wrong exception: " + didThrow; diff --git a/implementation-contributed/javascriptcore/stress/dfg-try-catch-wrong-value-recovery-on-ic-miss.js b/implementation-contributed/javascriptcore/stress/dfg-try-catch-wrong-value-recovery-on-ic-miss.js deleted file mode 100644 index 0d75b233c5..0000000000 --- a/implementation-contributed/javascriptcore/stress/dfg-try-catch-wrong-value-recovery-on-ic-miss.js +++ /dev/null @@ -1,50 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("bad value") -} -noInline(assert); - -let oThrow = { - x: 20, - y: 40, - z: 50, - get f() { throw new Error("Hello World!"); } -}; - -let o1 = { - x: 20, - f: 40 -}; - -let o2 = { - x: 20, - y: 50, - f: 500, - get f() { return 20; } -}; - -function foo(f) { - let o = f(); - try { - o = o.f; - } catch(e) { - assert(o === oThrow); // Make sure this is not undefined. - } -} -noInline(foo); - -let i; -let flag = false; -function f() { - if (flag) - return oThrow; - if (i % 2) - return o1; - return o2; -} -noInline(f); -for (i = 0; i < 10000; i++) { - foo(f); -} -flag = true; -foo(f); diff --git a/implementation-contributed/javascriptcore/stress/direct-arguments-check-array.js b/implementation-contributed/javascriptcore/stress/direct-arguments-check-array.js deleted file mode 100644 index 3f65b336f1..0000000000 --- a/implementation-contributed/javascriptcore/stress/direct-arguments-check-array.js +++ /dev/null @@ -1,40 +0,0 @@ -//@ defaultRun -//@ runNoLLInt("--useConcurrentJIT=false", "--forceEagerCompilation=True") - -// This is a regression test that verifies we handle direct arguments as ArrayStorage. This test should complete and not crash. -// It is a reduction of a fuzzing bug produced testcase. All of the code present was needed to reproduce the issue. - -let a; -let f2; -let args; - -function setup() { - a = [0]; - a.unshift(0); - for (let z of [4, 4, 4, 4, 4]) {}; - new Float64Array(a); - f2 = function() {}; - args = arguments; - args.length = 0; -}; - -function forOfArray() { - for (let z of [true, true, true, true, true, true, true]) { - } -} - -function forOfArgs() { - for (let v of args) { - } -} - -function callEveryOnArgs() { - for (i = 0; i < 1000; ++i) { - Array.prototype.every.call(args, f2, {}); - } -} - -setup(); -forOfArray(); -forOfArgs(); -callEveryOnArgs(); diff --git a/implementation-contributed/javascriptcore/stress/direct-arguments-in-bounds-to-out-of-bounds.js b/implementation-contributed/javascriptcore/stress/direct-arguments-in-bounds-to-out-of-bounds.js deleted file mode 100644 index 2dac7d291f..0000000000 --- a/implementation-contributed/javascriptcore/stress/direct-arguments-in-bounds-to-out-of-bounds.js +++ /dev/null @@ -1,17 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function args() -{ - return arguments[1]; -} -noInline(args); - -for (var i = 0; i < 1e6; ++i) - shouldBe(args(0, 1, 2), 1); - -for (var i = 0; i < 1e6; ++i) - shouldBe(args(0), undefined); diff --git a/implementation-contributed/javascriptcore/stress/direct-arguments-osr-entry.js b/implementation-contributed/javascriptcore/stress/direct-arguments-osr-entry.js deleted file mode 100644 index 97d1ab4f85..0000000000 --- a/implementation-contributed/javascriptcore/stress/direct-arguments-osr-entry.js +++ /dev/null @@ -1,22 +0,0 @@ -// This tests that arguments elimination works with OSR entry. -// We need to have an inner call so that arguments elimination -// sees there are potential candidates. - -var args; - -function foo(a) -{ - args = arguments; - var result = 0; - for (var i = 0; i < 1000000; ++i) { - (function() { - return arguments[0]; - })(42); - result += a; - } - return result; -} - -noInline(foo); - -foo(42); diff --git a/implementation-contributed/javascriptcore/stress/direct-arguments-out-of-bounds-change-structure.js b/implementation-contributed/javascriptcore/stress/direct-arguments-out-of-bounds-change-structure.js deleted file mode 100644 index 6e9e177988..0000000000 --- a/implementation-contributed/javascriptcore/stress/direct-arguments-out-of-bounds-change-structure.js +++ /dev/null @@ -1,30 +0,0 @@ -function foo(o) -{ - var theO = o; - var x = theO.f; - arguments[42]; - return x + theO.f; -} - -// Break some watchpoints. -var o = {f:24}; -o.g = 43; - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo({f:42}); - if (result != 84) - throw "Error: bad result: " + result; -} - -var globalO = {f:42}; -Object.prototype.__defineGetter__(42, function() { - delete globalO.f; - globalO.__defineGetter__("f", function() { return 75; }); - return 33; -}); -var result = foo(globalO); -if (result != 42 + 75) - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/direct-arguments-out-of-bounds-watchpoint.js b/implementation-contributed/javascriptcore/stress/direct-arguments-out-of-bounds-watchpoint.js deleted file mode 100644 index 7169141b9b..0000000000 --- a/implementation-contributed/javascriptcore/stress/direct-arguments-out-of-bounds-watchpoint.js +++ /dev/null @@ -1,19 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function args() -{ - return arguments[1]; -} -noInline(args); - -shouldBe(args(), undefined); -shouldBe(args(0), undefined); -shouldBe(args(0, 1), 1); -for (var i = 0; i < 1e6; ++i) - shouldBe(args(), undefined); -Object.prototype[1] = 42; -shouldBe(args(), 42); diff --git a/implementation-contributed/javascriptcore/stress/direct-arguments-override-length-then-access-normal-length.js b/implementation-contributed/javascriptcore/stress/direct-arguments-override-length-then-access-normal-length.js deleted file mode 100644 index fd3a7bfe24..0000000000 --- a/implementation-contributed/javascriptcore/stress/direct-arguments-override-length-then-access-normal-length.js +++ /dev/null @@ -1,25 +0,0 @@ -(function() { - var args = (function() { - var result = arguments; - result.length = 6; - return result; - })(1, 2, 3, 4, 5); - - var array = [args, [1, 2, 3]]; - - function foo(thing) { - return thing.length; - } - noInline(foo); - - var result = 0; - for (var i = 0; i < 10000; ++i) - result += foo(array[i % array.length]); - - if (result != 45000) - throw "Error: bad result: " + result; - - var result = foo((function() { return arguments; })(1, 2, 3, 4)); - if (result != 4) - throw "Error: bad result: " + result; -})(); diff --git a/implementation-contributed/javascriptcore/stress/direct-binding-return-result.js b/implementation-contributed/javascriptcore/stress/direct-binding-return-result.js deleted file mode 100644 index 93bb2d7b08..0000000000 --- a/implementation-contributed/javascriptcore/stress/direct-binding-return-result.js +++ /dev/null @@ -1,17 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() { - var a, b; - return ([a, b] = [1, 2]); -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) { - var result = test(); - shouldBe(result.length, 2); - shouldBe(result[0], 1); - shouldBe(result[1], 2); -} diff --git a/implementation-contributed/javascriptcore/stress/direct-eval-in-object-literal-methods.js b/implementation-contributed/javascriptcore/stress/direct-eval-in-object-literal-methods.js deleted file mode 100644 index 8c62f876d3..0000000000 --- a/implementation-contributed/javascriptcore/stress/direct-eval-in-object-literal-methods.js +++ /dev/null @@ -1,62 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -{ - let object = { - n() - { - return 42; - } - }; - - let derived = { - m() - { - return eval("super.n()"); - } - }; - Object.setPrototypeOf(derived, object); - shouldBe(derived.m(), 42); - // Cached. - shouldBe(derived.m(), 42); -} - -{ - let object = { - l() - { - return 42; - } - }; - - let derived = { - m() - { - return eval("super.l()"); - } - }; - Object.setPrototypeOf(derived, object); - shouldBe(derived.m(), 42); - // Cached. - shouldBe(derived.m(), 42); - - class Parent { - l() - { - return 55; - } - } - - class Derived extends Parent { - m() - { - return eval("super.l()"); - } - } - let instance = new Derived(); - // Under the strict code, not cached. - shouldBe(instance.l(), 55); - shouldBe(instance.l(), 55); -} diff --git a/implementation-contributed/javascriptcore/stress/direct-tail-call-arity-mismatch-count-args.js b/implementation-contributed/javascriptcore/stress/direct-tail-call-arity-mismatch-count-args.js deleted file mode 100644 index a2478cf93d..0000000000 --- a/implementation-contributed/javascriptcore/stress/direct-tail-call-arity-mismatch-count-args.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; - -function foo(a, b, c, d, e, f) { - return arguments.length; -} - -noInline(foo); - -function bar() { - return foo(1, 2, 3); -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var result = bar(); - if (result != 3) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/disable-caching-when-lazy-materializing-error-property-on-put.js b/implementation-contributed/javascriptcore/stress/disable-caching-when-lazy-materializing-error-property-on-put.js deleted file mode 100644 index 6b08e71156..0000000000 --- a/implementation-contributed/javascriptcore/stress/disable-caching-when-lazy-materializing-error-property-on-put.js +++ /dev/null @@ -1,27 +0,0 @@ -function assert(b) { - if (!b) - throw new Error; -} - -function makeError() { return new Error; } -noInline(makeError); - -function storeToStack(e) { - e.stack = "foo"; -} -noInline(storeToStack); - -function storeToStackAlreadyMaterialized(e) { - e.stack = "bar"; -} -noInline(storeToStackAlreadyMaterialized); - -for (let i = 0; i < 10000; ++i) { - let e = makeError(); - storeToStack(e); - assert(e.stack === "foo"); - if (!!(i % 2)) - e.fooBar = 25; - storeToStackAlreadyMaterialized(e); - assert(e.stack === "bar"); -} diff --git a/implementation-contributed/javascriptcore/stress/disable-function-dot-arguments.js b/implementation-contributed/javascriptcore/stress/disable-function-dot-arguments.js deleted file mode 100644 index 1996ce110b..0000000000 --- a/implementation-contributed/javascriptcore/stress/disable-function-dot-arguments.js +++ /dev/null @@ -1,20 +0,0 @@ -//@ run("function-dot-arguments", "--useFunctionDotArguments=false") - -function foo() { - var a = bar.arguments; - if (a.length != 0) - throw "Error: arguments have non-zero length"; - for (var i = 0; i < 100; ++i) { - if (a[i] !== void 0) - throw "Error: argument " + i + " has non-undefined value"; - } -} - -function bar() { - foo(); -} - -bar(); -bar(1); -bar(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - diff --git a/implementation-contributed/javascriptcore/stress/disable-gigacage-arrays.js b/implementation-contributed/javascriptcore/stress/disable-gigacage-arrays.js deleted file mode 100644 index 212fb1ee71..0000000000 --- a/implementation-contributed/javascriptcore/stress/disable-gigacage-arrays.js +++ /dev/null @@ -1,24 +0,0 @@ -//@ runNoisyTestWithEnv "disable-gigacage", "GIGACAGE_ENABLED=0" - -(function() { - function foo(array, i) - { - return array[i]; - } - - noInline(foo); - - var array = new Array(1000); - for (var i = 0; i < array.length; ++i) - array[i] = 5 - i; - for (var i = 0; i < 1000; ++i) { - var result = 0; - var expectedResult = 0; - for (var j = 0; j < array.length; ++j) { - result += foo(array, j); - expectedResult += 5 - j; - } - if (result != expectedResult) - throw new Error("Bad result: " + result); - } -})(); diff --git a/implementation-contributed/javascriptcore/stress/disable-gigacage-strings.js b/implementation-contributed/javascriptcore/stress/disable-gigacage-strings.js deleted file mode 100644 index 761d06769f..0000000000 --- a/implementation-contributed/javascriptcore/stress/disable-gigacage-strings.js +++ /dev/null @@ -1,25 +0,0 @@ -//@ runNoisyTestWithEnv "disable-gigacage", "GIGACAGE_ENABLED=0" - -(function() { - function foo(array, i) - { - return array.charCodeAt(i); - } - - noInline(foo); - - var array = ""; - for (var i = 0; i < array.length; ++i) - array += String.fromCharCode(5 - i); - for (var i = 0; i < 1000; ++i) { - var result = 0; - var expectedResult = 0; - for (var j = 0; j < array.length; ++j) { - result += foo(array, j); - expectedResult += 5 - j; - } - if (result != expectedResult) - throw new Error("Bad result: " + result); - } -})(); - diff --git a/implementation-contributed/javascriptcore/stress/disable-gigacage-typed-arrays.js b/implementation-contributed/javascriptcore/stress/disable-gigacage-typed-arrays.js deleted file mode 100644 index 3663c1e59c..0000000000 --- a/implementation-contributed/javascriptcore/stress/disable-gigacage-typed-arrays.js +++ /dev/null @@ -1,25 +0,0 @@ -//@ runNoisyTestWithEnv "disable-gigacage", "GIGACAGE_ENABLED=0" - -(function() { - function foo(array, i) - { - return array[i]; - } - - noInline(foo); - - var array = new Int32Array(1000); - for (var i = 0; i < array.length; ++i) - array[i] = 5 - i; - for (var i = 0; i < 1000; ++i) { - var result = 0; - var expectedResult = 0; - for (var j = 0; j < array.length; ++j) { - result += foo(array, j); - expectedResult += 5 - j; - } - if (result != expectedResult) - throw new Error("Bad result: " + result); - } -})(); - diff --git a/implementation-contributed/javascriptcore/stress/dont-constant-fold-check-type-info-on-bound-function.js b/implementation-contributed/javascriptcore/stress/dont-constant-fold-check-type-info-on-bound-function.js deleted file mode 100644 index 5c119b9011..0000000000 --- a/implementation-contributed/javascriptcore/stress/dont-constant-fold-check-type-info-on-bound-function.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -class C { } -let x = new C; -C = C.bind(this); - -function foo(x) { - x.foo; - return x instanceof C; -} -noInline(foo); - -for (let i = 0; i < 1000; ++i) { - let r = foo(x); - if (r !== true) - throw new Error("Bad") -} diff --git a/implementation-contributed/javascriptcore/stress/dont-crash-ftl-osr-entry.js b/implementation-contributed/javascriptcore/stress/dont-crash-ftl-osr-entry.js deleted file mode 100644 index 50b29c8150..0000000000 --- a/implementation-contributed/javascriptcore/stress/dont-crash-ftl-osr-entry.js +++ /dev/null @@ -1,26 +0,0 @@ -//@ runDefault("--jitPolicyScale=0--jitPolicyScale=0") - -// This test should not crash. - -function f_0() { - var v_4 = 1; - var v_5 = 'a'; - while (v_4 < 256) { - v_4 <<= 1; - } - return v_4; -} -function f_1(v_1) { - var sum = 0; - for (var i = 0; i < 1000; i++) { - for (var j = 0; j < 4; j++) { - sum += v_1(); - } - } - return sum; -} - -let hello; -for (var i=0; i<1000; i++) { - hello = f_1(f_0); -} diff --git a/implementation-contributed/javascriptcore/stress/dont-crash-in-cfg-simplification.js b/implementation-contributed/javascriptcore/stress/dont-crash-in-cfg-simplification.js deleted file mode 100644 index c7687bf0e0..0000000000 --- a/implementation-contributed/javascriptcore/stress/dont-crash-in-cfg-simplification.js +++ /dev/null @@ -1,17 +0,0 @@ -function bar() {} -noInline(bar); - -function baz() { } - -function foo() { - if (typeof baz !== "undefined") { - } else { - // The test here is to make sure that we don't merge this basic block - // with itself. If we did, we'd infinite loop in the compiler and eventually - // crash due to OOM when growing a Vector. - while (true) bar(); - } -} -noInline(foo); -for (let i = 0; i < 10000; ++i) - foo(); diff --git a/implementation-contributed/javascriptcore/stress/dont-crash-on-bad-invalidation-point.js b/implementation-contributed/javascriptcore/stress/dont-crash-on-bad-invalidation-point.js deleted file mode 100644 index 720cd259ab..0000000000 --- a/implementation-contributed/javascriptcore/stress/dont-crash-on-bad-invalidation-point.js +++ /dev/null @@ -1,16 +0,0 @@ -var A = 8000; -var B = 8000; -var C = 100; -var Iters = 0; -function dontCrash() { - for (a = 0; a < A; ++a) { - for (b = 0; b < B; ++b) { - for (c = 0; c < C; ++c) { - if (++Iters > 10000000) - return; - } - } - } - -} -dontCrash(); diff --git a/implementation-contributed/javascriptcore/stress/dont-crash-on-stack-overflow-when-parsing-builtin.js b/implementation-contributed/javascriptcore/stress/dont-crash-on-stack-overflow-when-parsing-builtin.js deleted file mode 100644 index 606ef4bf6b..0000000000 --- a/implementation-contributed/javascriptcore/stress/dont-crash-on-stack-overflow-when-parsing-builtin.js +++ /dev/null @@ -1,13 +0,0 @@ -//@ runDefault("--softReservedZoneSize=16384", "--reservedZoneSize=0", "--useJIT=0", "--validateBytecode=1", "--maxPerThreadStackUsage=500000") - -function f() { - try { - f(); - } catch (e) { - try { - Map.prototype.forEach.call('', {}); - } catch (e) {} - } -} - -f() diff --git a/implementation-contributed/javascriptcore/stress/dont-crash-on-stack-overflow-when-parsing-default-constructor.js b/implementation-contributed/javascriptcore/stress/dont-crash-on-stack-overflow-when-parsing-default-constructor.js deleted file mode 100644 index 4f91cbe996..0000000000 --- a/implementation-contributed/javascriptcore/stress/dont-crash-on-stack-overflow-when-parsing-default-constructor.js +++ /dev/null @@ -1,17 +0,0 @@ -//@ runDefault("--softReservedZoneSize=16384", "--reservedZoneSize=0", "--useJIT=0", "--validateBytecode=1", "--maxPerThreadStackUsage=500000") - -function runNearStackLimit(f) { - function t() { - try { - return t(); - } catch (e) { - new class extends (class {}) {}(); - return f(); - } - } - return t(); -} -function foo() { - new class extends (class {}) {}(); -} -runNearStackLimit(() => { return foo(); }); diff --git a/implementation-contributed/javascriptcore/stress/dont-crash-when-hoist-check-structure-on-tdz.js b/implementation-contributed/javascriptcore/stress/dont-crash-when-hoist-check-structure-on-tdz.js deleted file mode 100644 index 86ea6d4bf3..0000000000 --- a/implementation-contributed/javascriptcore/stress/dont-crash-when-hoist-check-structure-on-tdz.js +++ /dev/null @@ -1,28 +0,0 @@ -class Foo extends Object { - constructor(c1, c2) { - if (c1) - super(); - let arrow = () => { - if (c2) - this.foo = 20; - else - this.foo = 40; - }; - noInline(arrow); - arrow(); - } -} -noInline(Foo); - -for (let i = 0; i < 1000; ++i) - new Foo(true, !!(i%2)); - -let threw = false; -try { - new Foo(false, true); -} catch { - threw = true; -} finally { - if (!threw) - throw new Error("Bad") -} diff --git a/implementation-contributed/javascriptcore/stress/dont-dead-lock-put-by-val-as-put-by-id.js b/implementation-contributed/javascriptcore/stress/dont-dead-lock-put-by-val-as-put-by-id.js deleted file mode 100644 index 5bfdd39711..0000000000 --- a/implementation-contributed/javascriptcore/stress/dont-dead-lock-put-by-val-as-put-by-id.js +++ /dev/null @@ -1,17 +0,0 @@ -function ident() { return "foo"; } -noInline(ident); - -let o = { - set foo(x) { - foo(false); - } -}; - -function foo(cond) { - if (cond) - o[ident()] = 20; -} - -for (let i = 0; i < 10000; i++) { - foo(true); -} diff --git a/implementation-contributed/javascriptcore/stress/dont-reserve-huge-capacity-lexer.js b/implementation-contributed/javascriptcore/stress/dont-reserve-huge-capacity-lexer.js deleted file mode 100644 index 6b56962a9f..0000000000 --- a/implementation-contributed/javascriptcore/stress/dont-reserve-huge-capacity-lexer.js +++ /dev/null @@ -1,17 +0,0 @@ -//@ if ($architecture != "x86-64") or $memoryLimited then skip else runDefault end - -var fe="f"; -try -{ - for (i=0; i<25; i++) - fe += fe; - - var fu=new Function( - fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, - fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, - fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, - fe, fe, fe, fe, fe, fe, fe, fe, fe, fe, - "done" - ); -} catch(e) { -} diff --git a/implementation-contributed/javascriptcore/stress/dont-run-cleanup-after-licm.js b/implementation-contributed/javascriptcore/stress/dont-run-cleanup-after-licm.js deleted file mode 100644 index d03849e61d..0000000000 --- a/implementation-contributed/javascriptcore/stress/dont-run-cleanup-after-licm.js +++ /dev/null @@ -1,14 +0,0 @@ -function foo(string) { - var result1, result2; - for (var i = 0; i < 1000; ++i) { - result1 = string[0]; - for (var j = 0; j < 10; ++j) - result2 = 1; - } - return [result1, result2]; -} -noInline(foo); - -foo(" "); -for (var i = 0; i < 1000; i++) - foo(new Error()); diff --git a/implementation-contributed/javascriptcore/stress/dont-strength-reduce-valuerep-of-doublerep.js b/implementation-contributed/javascriptcore/stress/dont-strength-reduce-valuerep-of-doublerep.js deleted file mode 100644 index bb9783b344..0000000000 --- a/implementation-contributed/javascriptcore/stress/dont-strength-reduce-valuerep-of-doublerep.js +++ /dev/null @@ -1,15 +0,0 @@ -let a2 = []; -let thingy = {length: 2**55, __proto__: []}; -let func = (x) => x; - -noInline(Array.prototype.map); - -// This test should not crash. -for (let i = 0; i < 100000; ++i) { - try { - if (i > 0 && (i % 1000) === 0) - thingy.map(func) - a2.map(func); - } catch(e) { - } -} diff --git a/implementation-contributed/javascriptcore/stress/dont-unwind-past-vm-entry-frame.js b/implementation-contributed/javascriptcore/stress/dont-unwind-past-vm-entry-frame.js deleted file mode 100644 index d0d9fbb6ff..0000000000 --- a/implementation-contributed/javascriptcore/stress/dont-unwind-past-vm-entry-frame.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; - -// This test passes when JSC doesn't crash. - -let p = new Proxy(function() { }, { - apply: function() { - return bar(); - } -}); - -function bar() { - let item = getItem(); - return item.foo; -} - -let i; -let shouldReturnBad = false; -let good = [function() {return 1}, {b: 20}, {c: 40}, {d:50}] -let bad = [{asdfhasf: 20}, {e:50}, {j:70}, {k:100}, null]; -function getItem() { - if (shouldReturnBad) - return bad[i % bad.length]; - return good[i % good.length]; -} -noInline(getItem); - -function start() { - for (i = 0; i < 1000; i++) { - p(); - } - - shouldReturnBad = true; - for (i = 0; i < 10000; i++) { - try { - p(); - } catch(e) { } - } -} -start(); diff --git a/implementation-contributed/javascriptcore/stress/dont-validate-stack-offset-in-b3-because-it-might-be-guarded-by-control-flow.js b/implementation-contributed/javascriptcore/stress/dont-validate-stack-offset-in-b3-because-it-might-be-guarded-by-control-flow.js deleted file mode 100644 index 0a8af3377b..0000000000 --- a/implementation-contributed/javascriptcore/stress/dont-validate-stack-offset-in-b3-because-it-might-be-guarded-by-control-flow.js +++ /dev/null @@ -1,26 +0,0 @@ -function assert(b) { - if (!b) - throw new Error; -} -noInline(assert); - -function test() { - function a(a1, a2, a3, ...rest) { - return [rest.length, rest[0], rest[10]]; - } - - function b(...rest) { - return a.apply(null, rest); - } - noInline(b); - - for (let i = 0; i < 12000; i++) { - b(); - let r = a(undefined, 0); - assert(r[0] === 0); - assert(r[1] === undefined); - assert(r[2] === undefined); - } -} - -test(); diff --git a/implementation-contributed/javascriptcore/stress/double-array-to-array-storage.js b/implementation-contributed/javascriptcore/stress/double-array-to-array-storage.js deleted file mode 100644 index 9f3b7925c6..0000000000 --- a/implementation-contributed/javascriptcore/stress/double-array-to-array-storage.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; - -function assert(b, msg) { - if (!b) - throw new Error(msg); -} - -var arr = []; - -function test() -{ - arr = [0, 2147483648]; // NOTE: the second number is greater than INT_MAX - - assert(arr[0] === 0, "arr[0] should be 0, but is " + arr[0]); - assert(arr[1] === 2147483648, "arr[1] should be 2147483648, but is " + arr[1]); - assert(arr.length === 2, "Length should be 2, but is " + arr.length); - - arr.shift(); - - assert(arr[0] === 2147483648, "arr[0] should be 2147483648, but is " + arr[0]); - assert(arr[1] === undefined, "arr[1] should be undefined, but is " + arr[1]); - assert(arr.length === 1, "Length should be 2, but is " + arr.length); - - arr[1] = 1; - - assert(arr[0] === 2147483648, "arr[0] should be 2147483648, but is " + arr[0]); - assert(arr[1] === 1, "arr[1] should be 1, but is " + arr[1]); - assert(arr.length === 2, "Length should be 2, but is " + arr.length); -} - -for (let i = 0; i < 10000; i++) - test(); - diff --git a/implementation-contributed/javascriptcore/stress/double-array-unshift.js b/implementation-contributed/javascriptcore/stress/double-array-unshift.js deleted file mode 100644 index fc9aeb874b..0000000000 --- a/implementation-contributed/javascriptcore/stress/double-array-unshift.js +++ /dev/null @@ -1,6 +0,0 @@ -//@ runDefault -var x = [2.5, 1.5]; -Array.prototype.unshift.call(x, 3.5); -if (x.toString() != "3.5,2.5,1.5") - throw "Error: bad result: " + describe(x); - diff --git a/implementation-contributed/javascriptcore/stress/double-as-int32.js b/implementation-contributed/javascriptcore/stress/double-as-int32.js deleted file mode 100644 index 1939823a71..0000000000 --- a/implementation-contributed/javascriptcore/stress/double-as-int32.js +++ /dev/null @@ -1,22 +0,0 @@ -//@ defaultRun; runNoCJITNoASO - -function foo(a, b) { - return a.f / b.f; -} - -noInline(foo); - -function test(a, b, e) { - var result = foo({f:a}, {f:b}); - if (result != e) - throw "Error: " + a + " / " + b + " should be " + e + " but was " + result; -} - -for (var i = 1; i < 101; ++i) - test(i * 2, i, 2); - -test(9, 3, 3); -test(12, 4, 3); -test(-32, 8, -4); -test(-21, 7, -3); -test(7, 2, 3.5); diff --git a/implementation-contributed/javascriptcore/stress/double-compare-to-float.js b/implementation-contributed/javascriptcore/stress/double-compare-to-float.js deleted file mode 100644 index 428d4054f5..0000000000 --- a/implementation-contributed/javascriptcore/stress/double-compare-to-float.js +++ /dev/null @@ -1,49 +0,0 @@ -function canSimplifyToFloat(a, b) -{ - return Math.fround(a) === Math.fround(b); -} -noInline(canSimplifyToFloat); - -function canSimplifyToFloatWithConstant(a) -{ - return Math.fround(a) === 1.0; -} -noInline(canSimplifyToFloatWithConstant); - -function cannotSimplifyA(a, b) -{ - return a === Math.fround(b); -} -noInline(cannotSimplifyA); - -function cannotSimplifyB(a, b) -{ - return Math.fround(a) === b; -} -noInline(cannotSimplifyB); - -for (let i = 1; i < 1e4; ++i) { - if (canSimplifyToFloat(Math.PI, Math.PI) !== true) - throw "Failed canSimplifyToFloat(Math.PI, Math.PI)"; - if (canSimplifyToFloat(Math.LN2, Math.PI) !== false) - throw "Failed canSimplifyToFloat(Math.LN2, Math.PI)"; - - if (canSimplifyToFloatWithConstant(Math.PI) !== false) - throw "Failed canSimplifyToFloatWithConstant(Math.PI)"; - if (canSimplifyToFloatWithConstant(1) !== true) - throw "Failed canSimplifyToFloatWithConstant(1)"; - - if (cannotSimplifyA(Math.PI, Math.PI) !== false) - throw "Failed cannotSimplifyA(Math.PI, Math.PI)"; - if (cannotSimplifyA(Math.fround(Math.PI), Math.PI) !== true) - throw "Failed cannotSimplifyA(Math.round(Math.PI), Math.PI)"; - if (cannotSimplifyA(Math.LN2, Math.PI) !== false) - throw "Failed cannotSimplifyA(Math.LN2, Math.PI)"; - - if (cannotSimplifyB(Math.PI, Math.PI) !== false) - throw "Failed cannotSimplifyA(Math.PI, Math.PI)"; - if (cannotSimplifyB(Math.PI, Math.fround(Math.PI)) !== true) - throw "Failed cannotSimplifyA(Math.round(Math.PI), Math.PI)"; - if (cannotSimplifyB(Math.LN2, Math.PI) !== false) - throw "Failed cannotSimplifyA(Math.LN2, Math.PI)"; -} diff --git a/implementation-contributed/javascriptcore/stress/double-rep-real-number-use-on-nan.js b/implementation-contributed/javascriptcore/stress/double-rep-real-number-use-on-nan.js deleted file mode 100644 index 96efc543f4..0000000000 --- a/implementation-contributed/javascriptcore/stress/double-rep-real-number-use-on-nan.js +++ /dev/null @@ -1,46 +0,0 @@ -// Original test case. -function isNaNOnDouble(value) -{ - return (+value) !== value; -} -noInline(isNaNOnDouble); - -function testIsNaNOnDoubles() -{ - var value = isNaNOnDouble(-0); - if (value) - throw "isNaNOnDouble(-0) = " + value; - - var value = isNaNOnDouble(NaN); - if (!value) - throw "isNaNOnDouble(NaN) = " + value; - - var value = isNaNOnDouble(Number.POSITIVE_INFINITY); - if (value) - throw "isNaNOnDouble(Number.POSITIVE_INFINITY) = " + value; -} -noInline(testIsNaNOnDoubles); - -for (let i = 0; i < 1e6; ++i) { - testIsNaNOnDoubles(); -} - -// Simplified test case. -function isNaNOnDouble2(value) -{ - let valueToNumber = (+value); - return valueToNumber !== valueToNumber; -} -noInline(isNaNOnDouble2); - -// Warm up without NaN. -for (let i = 0; i < 1e6; ++i) { - if (isNaNOnDouble2(1.5)) - throw "Failed isNaNOnDouble(1.5)"; -} - -// Then pass some NaNs. -for (let i = 0; i < 1e6; ++i) { - if (!isNaNOnDouble2(NaN)) - throw "Failed isNaNOnDouble(NaN)"; -} diff --git a/implementation-contributed/javascriptcore/stress/double-rep-with-non-cell.js b/implementation-contributed/javascriptcore/stress/double-rep-with-non-cell.js deleted file mode 100644 index bc6a1928b3..0000000000 --- a/implementation-contributed/javascriptcore/stress/double-rep-with-non-cell.js +++ /dev/null @@ -1,32 +0,0 @@ -// Only bool, undefined and null -function addNullBoolUndefined(a, b) { - return a + b; -} -noInline(addNullBoolUndefined); - -for (var i = 0; i < 1e4; ++i) { - var value = addNullBoolUndefined(0.5, null); - if (value !== 0.5) - throw "addNullBoolUndefined(0.5, null) failed with i = " + i + " returned value = " + value; - - var value = addNullBoolUndefined(null, undefined); - if (value === value) - throw "addNullBoolUndefined(null, undefined) failed with i = " + i + " returned value = " + value; - - var value = addNullBoolUndefined(true, null); - if (value !== 1) - throw "addNullBoolUndefined(true, null) failed with i = " + i + " returned value = " + value; - - var value = addNullBoolUndefined(undefined, false); - if (value === value) - throw "addNullBoolUndefined(undefined, false) failed with i = " + i + " returned value = " + value; - - var value = addNullBoolUndefined(false, true); - if (value !== 1) - throw "addNullBoolUndefined(false, true) failed with i = " + i + " returned value = " + value; - - var value = addNullBoolUndefined(null, 42); - if (value !== 42) - throw "addNullBoolUndefined(null, 42) failed with i = " + i + " returned value = " + value; - -} diff --git a/implementation-contributed/javascriptcore/stress/double-rep-with-null.js b/implementation-contributed/javascriptcore/stress/double-rep-with-null.js deleted file mode 100644 index 01b6259df4..0000000000 --- a/implementation-contributed/javascriptcore/stress/double-rep-with-null.js +++ /dev/null @@ -1,107 +0,0 @@ -// Using full number + null for math. -function addArgsNumberAndNull(a, b) { - return a + b; -} -noInline(addArgsNumberAndNull); - -for (var i = 0; i < 1e4; ++i) { - var value = addArgsNumberAndNull(i, 1); - if (value !== (i + 1)) - throw "addArgsNumberAndNull(i, 1) failed with i = " + i + " returned value = " + value; - - var value = addArgsNumberAndNull(0.5, i); - if (value !== (i + 0.5)) - throw "addArgsNumberAndNull(0.5, i) failed with i = " + i + " returned value = " + value; - - var value = addArgsNumberAndNull(null, i); - if (value !== i) - throw "addArgsNumberAndNull(null, i) failed with i = " + i + " returned value = " + value; - - var value = addArgsNumberAndNull(i, null); - if (value !== i) - throw "addArgsNumberAndNull(i, null) failed with i = " + i + " returned value = " + value; - - var value = addArgsNumberAndNull(null, null); - if (value !== 0) - throw "addArgsNumberAndNull(null, null) failed with i = " + i + " returned value = " + value; -} - - -// Using int32 + null for math. -function addArgsInt32AndNull(a, b) { - return a + b; -} -noInline(addArgsInt32AndNull); - -for (var i = 0; i < 1e4; ++i) { - var value = addArgsInt32AndNull(i, 1); - if (value !== (i + 1)) - throw "addArgsInt32AndNull(i, 1) failed with i = " + i + " returned value = " + value; - - var value = addArgsInt32AndNull(null, i); - if (value !== i) - throw "addArgsInt32AndNull(null, i) failed with i = " + i + " returned value = " + value; - - var value = addArgsInt32AndNull(i, null); - if (value !== i) - throw "addArgsInt32AndNull(i, null) failed with i = " + i + " returned value = " + value; - - var value = addArgsInt32AndNull(null, null); - if (value !== 0) - throw "addArgsInt32AndNull(null, null) failed with i = " + i + " returned value = " + value; -} - -function testFallbackWithDouble() { - var value = addArgsNumberAndNull(Math.PI, Math.PI); - if (value !== 2 * Math.PI) - throw "addArgsNumberAndNull(Math.PI, Math.PI) failed with i = " + i + " returned value = " + value; -} -testFallbackWithDouble(); - - -// Using full number + null for math. -function addArgsDoubleAndNull(a, b) { - return a + b; -} -noInline(addArgsDoubleAndNull); - -for (var i = 0; i < 1e4; ++i) { - var value = addArgsDoubleAndNull(0.5, i); - if (value !== (i + 0.5)) - throw "addArgsDoubleAndNull(0.5, i) failed with i = " + i + " returned value = " + value; - - var value = addArgsDoubleAndNull(null, 0.1); - if (value !== 0.1) - throw "addArgsDoubleAndNull(null, i) failed with i = " + i + " returned value = " + value; - - var value = addArgsDoubleAndNull(0.6, null); - if (value !== 0.6) - throw "addArgsDoubleAndNull(i, null) failed with i = " + i + " returned value = " + value; -} - -function testFallbackWithObject() { - var value = addArgsDoubleAndNull(Math.PI, { valueOf: function() { return 5; }}); - if (value !== 5 + Math.PI) - throw "addArgsDoubleAndNull(Math.PI, { valueOf: function() { return 5; }}) failed with i = " + i + " returned value = " + value; -} -testFallbackWithObject(); - - -// Using only null -function addArgsOnlyNull(a, b) { - return a + b; -} -noInline(addArgsOnlyNull); - -for (var i = 0; i < 1e4; ++i) { - var value = addArgsOnlyNull(null, null); - if (value !== 0) - throw "addArgsOnlyNull(null, null) failed with i = " + i + " returned value = " + value; -} - -function testFallbackWithString() { - var value = addArgsOnlyNull("foo", "bar"); - if (value !== "foobar") - throw "addArgsOnlyNull(\"foo\", \"bar\") failed with i = " + i + " returned value = " + value; -} -testFallbackWithString(); \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/double-rep-with-undefined.js b/implementation-contributed/javascriptcore/stress/double-rep-with-undefined.js deleted file mode 100644 index d41fba6059..0000000000 --- a/implementation-contributed/javascriptcore/stress/double-rep-with-undefined.js +++ /dev/null @@ -1,131 +0,0 @@ -// Using full number + undefined for math. -function addArgsNumberAndUndefined(a, b) { - return a + b; -} -noInline(addArgsNumberAndUndefined); - -for (var i = 0; i < 1e4; ++i) { - var value = addArgsNumberAndUndefined(i, 1); - if (value !== (i + 1)) - throw "addArgsNumberAndUndefined(i, 1) failed with i = " + i + " returned value = " + value; - - var value = addArgsNumberAndUndefined(0.5, i); - if (value !== (i + 0.5)) - throw "addArgsNumberAndUndefined(0.5, i) failed with i = " + i + " returned value = " + value; - - var value = addArgsNumberAndUndefined(undefined, i); - if (value === value) - throw "addArgsNumberAndUndefined(undefined, i) failed with i = " + i + " returned value = " + value; - - var value = addArgsNumberAndUndefined(i, undefined); - if (value === value) - throw "addArgsNumberAndUndefined(i, undefined) failed with i = " + i + " returned value = " + value; - - var value = addArgsNumberAndUndefined(i); - if (value === value) - throw "addArgsNumberAndUndefined(i) failed with i = " + i + " returned value = " + value; - - var value = addArgsNumberAndUndefined(undefined, undefined); - if (value === value) - throw "addArgsNumberAndUndefined(undefined, undefined) failed with i = " + i + " returned value = " + value; - - var value = addArgsNumberAndUndefined(); - if (value === value) - throw "addArgsNumberAndUndefined() failed with i = " + i + " returned value = " + value; -} - - -// Using int32 + undefined for math. -function addArgsInt32AndUndefined(a, b) { - return a + b; -} -noInline(addArgsInt32AndUndefined); - -for (var i = 0; i < 1e4; ++i) { - var value = addArgsInt32AndUndefined(i, 1); - if (value !== (i + 1)) - throw "addArgsInt32AndUndefined(i, 1) failed with i = " + i + " returned value = " + value; - - var value = addArgsInt32AndUndefined(undefined, i); - if (value === value) - throw "addArgsInt32AndUndefined(undefined, i) failed with i = " + i + " returned value = " + value; - - var value = addArgsInt32AndUndefined(i, undefined); - if (value === value) - throw "addArgsInt32AndUndefined(i, undefined) failed with i = " + i + " returned value = " + value; - - var value = addArgsInt32AndUndefined(i); - if (value === value) - throw "addArgsInt32AndUndefined(i) failed with i = " + i + " returned value = " + value; - - var value = addArgsInt32AndUndefined(undefined, undefined); - if (value === value) - throw "addArgsInt32AndUndefined(undefined, undefined) failed with i = " + i + " returned value = " + value; - - var value = addArgsInt32AndUndefined(); - if (value === value) - throw "addArgsInt32AndUndefined() failed with i = " + i + " returned value = " + value; -} - -function testFallbackWithDouble() { - var value = addArgsNumberAndUndefined(Math.PI, Math.PI); - if (value !== 2 * Math.PI) - throw "addArgsNumberAndUndefined(Math.PI, Math.PI) failed with i = " + i + " returned value = " + value; -} -testFallbackWithDouble(); - - -// Using full number + undefined for math. -function addArgsDoubleAndUndefined(a, b) { - return a + b; -} -noInline(addArgsDoubleAndUndefined); - -for (var i = 0; i < 1e4; ++i) { - var value = addArgsDoubleAndUndefined(0.5, i); - if (value !== (i + 0.5)) - throw "addArgsDoubleAndUndefined(0.5, i) failed with i = " + i + " returned value = " + value; - - var value = addArgsDoubleAndUndefined(undefined, 0.1); - if (value === value) - throw "addArgsDoubleAndUndefined(undefined, i) failed with i = " + i + " returned value = " + value; - - var value = addArgsDoubleAndUndefined(0.6, undefined); - if (value === value) - throw "addArgsDoubleAndUndefined(i, undefined) failed with i = " + i + " returned value = " + value; - - var value = addArgsDoubleAndUndefined(42.8); - if (value === value) - throw "addArgsDoubleAndUndefined(i) failed with i = " + i + " returned value = " + value; -} - -function testFallbackWithObject() { - var value = addArgsDoubleAndUndefined(Math.PI, { valueOf: function() { return 5; }}); - if (value !== 5 + Math.PI) - throw "addArgsDoubleAndUndefined(Math.PI, { valueOf: function() { return 5; }}) failed with i = " + i + " returned value = " + value; -} -testFallbackWithObject(); - - -// Using full number + undefined for math. -function addArgsOnlyUndefined(a, b) { - return a + b; -} -noInline(addArgsOnlyUndefined); - -for (var i = 0; i < 1e4; ++i) { - var value = addArgsOnlyUndefined(undefined, undefined); - if (value === value) - throw "addArgsOnlyUndefined(undefined, undefined) failed with i = " + i + " returned value = " + value; - - var value = addArgsOnlyUndefined(); - if (value === value) - throw "addArgsOnlyUndefined() failed with i = " + i + " returned value = " + value; -} - -function testFallbackWithString() { - var value = addArgsOnlyUndefined("foo", "bar"); - if (value !== "foobar") - throw "addArgsOnlyUndefined(\"foo\", \"bar\") failed with i = " + i + " returned value = " + value; -} -testFallbackWithString(); \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/double-to-float.js b/implementation-contributed/javascriptcore/stress/double-to-float.js deleted file mode 100644 index adcc377c6b..0000000000 --- a/implementation-contributed/javascriptcore/stress/double-to-float.js +++ /dev/null @@ -1,157 +0,0 @@ -function upsilonReferencingItsPhi(index, input) -{ - // All uses of "outputDouble" are converted to float. - // Inside the loop, the Upsilon is referencing its own Phi. This should - // not prevent the conversion. - let outputDouble = input; - while (index) { - if (index & 0x4) - outputDouble = Math.fround(outputDouble) + Math.PI; - index = index >>> 1; - } - return Math.fround(outputDouble); -} -noInline(upsilonReferencingItsPhi); - -let expectedNotTaken = Math.fround(Math.LN2); -let expectedTaken = Math.fround(Math.fround(Math.LN2) + Math.PI); -for (let i = 0; i < 1e6; ++i) { - let branchNotTakenResult = upsilonReferencingItsPhi(3, Math.LN2); - if (branchNotTakenResult !== expectedNotTaken) - throw "Failed upsilonReferencingItsPhi(3, Math.LN2) at i = " + i + " result = " + branchNotTakenResult; - - let branchTakenResult = upsilonReferencingItsPhi(7, Math.LN2); - if (branchTakenResult !== expectedTaken) - throw "Failed upsilonReferencingItsPhi(7, Math.LN2) at i = " + i + " result = " + branchTakenResult; -} - -// Same as above, but this time it is always better to convert the outside Phi-Upsilon. -function upsilonReferencingItsPhiAllFloat(index, input) -{ - let outputDouble = Math.fround(input); - while (index) { - if (index & 0x4) - outputDouble = Math.fround(outputDouble) + Math.PI; - index = index >>> 1; - } - return Math.fround(outputDouble); -} -noInline(upsilonReferencingItsPhiAllFloat); - -for (let i = 0; i < 1e6; ++i) { - let branchNotTakenResult = upsilonReferencingItsPhiAllFloat(3, Math.LN2); - if (branchNotTakenResult !== expectedNotTaken) - throw "Failed upsilonReferencingItsPhiAllFloat(3, Math.LN2) at i = " + i + " result = " + branchNotTakenResult; - - let branchTakenResult = upsilonReferencingItsPhiAllFloat(7, Math.LN2); - if (branchTakenResult !== expectedTaken) - throw "Failed upsilonReferencingItsPhiAllFloat(7, Math.LN2) at i = " + i + " result = " + branchTakenResult; -} - -// This time, converting to float would be a mistake because one of the Phi -// is not converted. -function upsilonReferencingItsPhiWithoutConversion(index, input) -{ - let outputDouble = input; - while (index) { - if (index & 0x4) - outputDouble = Math.fround(outputDouble) + Math.PI; - index = index >>> 1; - } - return outputDouble; -} -noInline(upsilonReferencingItsPhiWithoutConversion); - -let expectedNotTakenWithoutConversion = Math.LN2; -let expectedTakenWithoutConversion = Math.fround(Math.LN2) + Math.PI; -for (let i = 0; i < 1e6; ++i) { - let branchNotTakenResult = upsilonReferencingItsPhiWithoutConversion(3, Math.LN2); - if (branchNotTakenResult !== expectedNotTakenWithoutConversion) - throw "Failed upsilonReferencingItsPhiWithoutConversion(3, Math.LN2) at i = " + i + " result = " + branchNotTakenResult; - - let branchTakenResult = upsilonReferencingItsPhiWithoutConversion(7, Math.LN2); - if (branchTakenResult !== expectedTakenWithoutConversion) - throw "Failed upsilonReferencingItsPhiWithoutConversion(7, Math.LN2) at i = " + i + " result = " + branchTakenResult; -} - -function conversionPropagages(flags, a, b) -{ - let result = 0.5; - if (flags & 0x1) { - if (flags & 0x2) { - if (flags & 0x4) { - if (flags & 0x8) { - result = Math.fround(a) + Math.fround(b); - } else { - result = 6.5; - } - } else { - result = 4.5; - } - } else { - result = 2.5; - } - } else { - result = 1.5; - } - return Math.fround(result); -} -noInline(conversionPropagages); - -let conversionPropagageExpectedResult = Math.fround(Math.fround(Math.LN2) + Math.fround(Math.PI)); -for (let i = 0; i < 1e6; ++i) { - let result = conversionPropagages(0xf, Math.LN2, Math.PI); - if (result !== conversionPropagageExpectedResult) - throw "Failed conversionPropagages(0xf, Math.LN2, Math.PI)"; -} - - -function chainedUpsilonBothConvert(condition1, condition2, a, b) -{ - let firstPhi; - if (condition1) - firstPhi = Math.fround(a); - else - firstPhi = Math.fround(b); - - let secondPhi; - if (condition2) - secondPhi = firstPhi + 2; - else - secondPhi = firstPhi + 1; - return Math.fround(secondPhi); -} -noInline(chainedUpsilonBothConvert); - -let expectedChainedUpsilonBothConvert = Math.fround(Math.fround(Math.PI) + Math.fround(1)); -for (let i = 0; i < 1e6; ++i) { - if (chainedUpsilonBothConvert(1, 0, Math.PI, Math.LN2) !== expectedChainedUpsilonBothConvert) - throw "Failed chainedUpsilonBothConvert(1, 0, Math.PI, Math.LN2)"; -} - -function chainedUpsilonFirstConvert(condition1, condition2, a, b) -{ - // This first phi is trivially simplified by the fround() - // of the second if-else. - let firstPhi; - if (condition1) - firstPhi = Math.fround(a); - else - firstPhi = Math.fround(b); - - // This second one cannot ever be converted because the - // result is not rounded to float. - let secondPhi; - if (condition2) - secondPhi = Math.fround(firstPhi) + Math.fround(1/3); - else - secondPhi = Math.fround(firstPhi) - Math.fround(1/3); - return secondPhi; -} -noInline(chainedUpsilonFirstConvert); - -let expectedChainedUpsilonFirstConvert = Math.fround(Math.PI) - Math.fround(1/3); -for (let i = 0; i < 1e6; ++i) { - if (chainedUpsilonFirstConvert(1, 0, Math.PI, Math.LN2) !== expectedChainedUpsilonFirstConvert) - throw "Failed chainedUpsilonFirstConvert(1, 0, Math.PI, Math.LN2)"; -} diff --git a/implementation-contributed/javascriptcore/stress/double-to-string-in-loop-removed.js b/implementation-contributed/javascriptcore/stress/double-to-string-in-loop-removed.js deleted file mode 100644 index 06efd2a16c..0000000000 --- a/implementation-contributed/javascriptcore/stress/double-to-string-in-loop-removed.js +++ /dev/null @@ -1,8 +0,0 @@ -function test() -{ - for (var i = 0; i < 1e6; ++i) - (i * 0.1).toString(); -} -noInline(test); - -test(); diff --git a/implementation-contributed/javascriptcore/stress/duplicate-computed-accessors.js b/implementation-contributed/javascriptcore/stress/duplicate-computed-accessors.js deleted file mode 100644 index 663313e04b..0000000000 --- a/implementation-contributed/javascriptcore/stress/duplicate-computed-accessors.js +++ /dev/null @@ -1,402 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -// Class methods. -(function () { - var method1 = 'taste'; - var method2 = 'taste'; - - class Cocoa { - get [method1]() { - return 'awesome'; - } - - get [method2]() { - return 'great'; - } - } - - var cocoa = new Cocoa(); - shouldBe(cocoa.taste, "great"); -}()); - -(function () { - var counter = 0; - function method1() { - shouldBe(counter++, 0); - return 'taste'; - } - function method2() { - shouldBe(counter++, 1); - return 'taste'; - } - - class Cocoa { - get [method1()]() { - return 'awesome'; - } - - get [method2()]() { - return 'great'; - } - } - - var cocoa = new Cocoa(); - shouldBe(cocoa.taste, "great"); -}()); - -(function () { - var counter = 0; - function method1() { - shouldBe(counter++, 0); - return 'taste'; - } - function method2() { - shouldBe(counter++, 1); - return 'taste'; - } - - class Cocoa { - get [method1()]() { - return this.value; - } - - set [method2()](value) { - this.value = value; - } - } - - var cocoa = new Cocoa(); - shouldBe(cocoa.taste, undefined); - cocoa.taste = 'great'; - shouldBe(cocoa.taste, 'great'); -}()); - -(function () { - var counter = 0; - function method1() { - shouldBe(counter++, 0); - return 'taste'; - } - function method2() { - shouldBe(counter++, 1); - return 'taste'; - } - - class Cocoa { - get 'taste'() { - return 'bad'; - } - - get [method1()]() { - return this.value; - } - - set [method2()](value) { - this.value = value; - } - } - - var cocoa = new Cocoa(); - shouldBe(cocoa.taste, undefined); - cocoa.taste = 'great'; - shouldBe(cocoa.taste, 'great'); -}()); - -(function () { - var counter = 0; - function method1() { - shouldBe(counter++, 0); - return 'taste'; - } - function method2() { - shouldBe(counter++, 1); - return 'taste'; - } - - class Cocoa { - get [method1()]() { - return this.value; - } - - set [method2()](value) { - this.value = value; - } - - get 'taste'() { - return 'awesome'; - } - - set taste(value) { - } - } - - var cocoa = new Cocoa(); - shouldBe(cocoa.taste, 'awesome'); - cocoa.taste = 'great'; - shouldBe(cocoa.taste, 'awesome'); -}()); - -// Class static methods. -(function () { - var method1 = 'taste'; - var method2 = 'taste'; - - class Cocoa { - static get [method1]() { - return 'awesome'; - } - - static get [method2]() { - return 'great'; - } - } - - shouldBe(Cocoa.taste, "great"); -}()); - -(function () { - var counter = 0; - function method1() { - shouldBe(counter++, 0); - return 'taste'; - } - function method2() { - shouldBe(counter++, 1); - return 'taste'; - } - - class Cocoa { - static get [method1()]() { - return 'awesome'; - } - - static get [method2()]() { - return 'great'; - } - } - - shouldBe(Cocoa.taste, "great"); -}()); - -(function () { - var counter = 0; - function method1() { - shouldBe(counter++, 0); - return 'taste'; - } - function method2() { - shouldBe(counter++, 1); - return 'taste'; - } - - class Cocoa { - static get [method1()]() { - return this.value; - } - - static set [method2()](value) { - this.value = value; - } - } - - shouldBe(Cocoa.taste, undefined); - Cocoa.taste = 'great'; - shouldBe(Cocoa.taste, 'great'); -}()); - -(function () { - var counter = 0; - function method1() { - shouldBe(counter++, 0); - return 'taste'; - } - function method2() { - shouldBe(counter++, 1); - return 'taste'; - } - - class Cocoa { - static get 'taste'() { - return 'bad'; - } - - static get [method1()]() { - return this.value; - } - - static set [method2()](value) { - this.value = value; - } - } - - shouldBe(Cocoa.taste, undefined); - Cocoa.taste = 'great'; - shouldBe(Cocoa.taste, 'great'); -}()); - -(function () { - var counter = 0; - function method1() { - shouldBe(counter++, 0); - return 'taste'; - } - function method2() { - shouldBe(counter++, 1); - return 'taste'; - } - - class Cocoa { - static get [method1()]() { - return this.value; - } - - static set [method2()](value) { - this.value = value; - } - - static get 'taste'() { - return 'awesome'; - } - - static set taste(value) { - } - } - - shouldBe(Cocoa.taste, 'awesome'); - Cocoa.taste = 'great'; - shouldBe(Cocoa.taste, 'awesome'); -}()); - -// Object. -(function () { - var method1 = 'taste'; - var method2 = 'taste'; - - let Cocoa = { - get [method1]() { - return 'awesome'; - }, - - get [method2]() { - return 'great'; - } - } - - shouldBe(Cocoa.taste, "great"); -}()); - -(function () { - var counter = 0; - function method1() { - shouldBe(counter++, 0); - return 'taste'; - } - function method2() { - shouldBe(counter++, 1); - return 'taste'; - } - - let Cocoa = { - get [method1()]() { - return 'awesome'; - }, - - get [method2()]() { - return 'great'; - } - } - - shouldBe(Cocoa.taste, "great"); -}()); - -(function () { - var counter = 0; - function method1() { - shouldBe(counter++, 0); - return 'taste'; - } - function method2() { - shouldBe(counter++, 1); - return 'taste'; - } - - let Cocoa = { - get [method1()]() { - return this.value; - }, - - set [method2()](value) { - this.value = value; - } - } - - shouldBe(Cocoa.taste, undefined); - Cocoa.taste = 'great'; - shouldBe(Cocoa.taste, 'great'); -}()); - -(function () { - var counter = 0; - function method1() { - shouldBe(counter++, 0); - return 'taste'; - } - function method2() { - shouldBe(counter++, 1); - return 'taste'; - } - - let Cocoa = { - get 'taste'() { - return 'bad'; - }, - - get [method1()]() { - return this.value; - }, - - set [method2()](value) { - this.value = value; - } - } - - shouldBe(Cocoa.taste, undefined); - Cocoa.taste = 'great'; - shouldBe(Cocoa.taste, 'great'); -}()); - -(function () { - var counter = 0; - function method1() { - shouldBe(counter++, 0); - return 'taste'; - } - function method2() { - shouldBe(counter++, 1); - return 'taste'; - } - - let Cocoa = { - get [method1()]() { - return this.value; - }, - - set [method2()](value) { - this.value = value; - }, - - get 'taste'() { - return 'awesome'; - }, - - set taste(value) { - } - } - - shouldBe(Cocoa.taste, 'awesome'); - Cocoa.taste = 'great'; - shouldBe(Cocoa.taste, 'awesome'); -}()); diff --git a/implementation-contributed/javascriptcore/stress/each-block-at-top-of-polymorphic-call-inlining-should-be-exitOK.js b/implementation-contributed/javascriptcore/stress/each-block-at-top-of-polymorphic-call-inlining-should-be-exitOK.js deleted file mode 100644 index 607ee3253d..0000000000 --- a/implementation-contributed/javascriptcore/stress/each-block-at-top-of-polymorphic-call-inlining-should-be-exitOK.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -function f() { }; -noInline(f); - -function foo(o, x) { - return o.get(x); -} -noInline(foo); - -let objs = [ - new Map, - { get() { return f(); } }, -]; - - -for (let i = 0; i < 1000000; ++i) { - foo(objs[i % objs.length], i); -} diff --git a/implementation-contributed/javascriptcore/stress/eden-gc-with-retired-blocks.js b/implementation-contributed/javascriptcore/stress/eden-gc-with-retired-blocks.js deleted file mode 100644 index 9cfaf2529a..0000000000 --- a/implementation-contributed/javascriptcore/stress/eden-gc-with-retired-blocks.js +++ /dev/null @@ -1,24 +0,0 @@ -//@ runDefault -// This test should not crash. - -var objs; - -for (let i = 0; i < 500; i += 100) { - objs = []; - gc(); - - // Make "Retired" blocks. - for (let j = 0; j < i; j++) { - let o; - switch (i % 6) { - case 0: o = { }; - case 1: o = { a: i }; - case 2: o = { a: i, b: i}; - case 3: o = { a: i, b: i, c: i }; - case 4: o = { a: i, b: i, c: i, d: i }; - case 5: o = { a: i, b: i, c: i, d: i, e: i }; - } - objs[j] = o; - } - edenGC(); -} diff --git a/implementation-contributed/javascriptcore/stress/element-property-get-should-not-handled-with-get-by-id.js b/implementation-contributed/javascriptcore/stress/element-property-get-should-not-handled-with-get-by-id.js deleted file mode 100644 index da2ad72899..0000000000 --- a/implementation-contributed/javascriptcore/stress/element-property-get-should-not-handled-with-get-by-id.js +++ /dev/null @@ -1,18 +0,0 @@ -(function () { - function getOne(a) - { - return a['1']; - } - - for (var i = 0; i < 36; ++i) - getOne({2: true}); - - if (!getOne({1: true})) - throw new Error("OUT"); - - for (var i = 0; i < 1e4; ++i) - getOne({2: true}); - - if (!getOne({1: true})) - throw new Error("OUT"); -}()); diff --git a/implementation-contributed/javascriptcore/stress/elidable-new-object-roflcopter-then-exit.js b/implementation-contributed/javascriptcore/stress/elidable-new-object-roflcopter-then-exit.js deleted file mode 100644 index 00bd91b724..0000000000 --- a/implementation-contributed/javascriptcore/stress/elidable-new-object-roflcopter-then-exit.js +++ /dev/null @@ -1,23 +0,0 @@ -function sumOfArithSeries(limit) { - return limit * (limit + 1) / 2; -} - -var n = 1000000; - -var array = [42, "hello"]; - -function foo() { - var result = 0; - var q; - for (var i = 0; i < n; ++i) { - var o = {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: i}}}}}}}}}}}}}}}}}}}; - var p = {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: i + 1}}}}}}}}}}}}}}}}}}}; - q = array[(i > n - 100) | 0] + 1; - result += o.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f + p.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f; - } - return q + result; -} - -var result = foo(); -if (result != "hello" + 1 + (sumOfArithSeries(n - 1) + sumOfArithSeries(n))) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/elide-new-object-dag-then-exit.js b/implementation-contributed/javascriptcore/stress/elide-new-object-dag-then-exit.js deleted file mode 100644 index fbe99a5f7d..0000000000 --- a/implementation-contributed/javascriptcore/stress/elide-new-object-dag-then-exit.js +++ /dev/null @@ -1,43 +0,0 @@ -function sumOfArithSeries(limit) { - return limit * (limit + 1) / 2; -} - -var n = 10000000; - -function bar() { } - -function verify(q, i) { - if (q.f == q.g) - throw "Error: q.f == q.g"; - if (q.f.f != q.g.f) - throw "Error: q.f.f != q.g.f"; - if (q.f.f.f != i) - throw "Error: q.f.f.f != i"; -} - -function foo() { - var result = 0; - for (var i = 0; i < n; ++i) { - var leaf = {f:i}; - var o = {f:leaf}; - var p = {f:leaf}; - var q = {f:o, g:p}; - result += q.f.f.f; - if (i >= n - 100) { - // We want the materialization to happen in the exit. So, before calling the thing that - // causes the materialization, we call bar(). We've never profiled this call at the time - // of FTL compilation, so this should be an exit. - bar(); - verify(q, i); - } - } - return result; -} - -noInline(foo); -noInline(verify); -noInline(bar); - -var result = foo(); -if (result != sumOfArithSeries(n - 1)) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/empty_eos_regex_split.js b/implementation-contributed/javascriptcore/stress/empty_eos_regex_split.js deleted file mode 100644 index 05b2796e40..0000000000 --- a/implementation-contributed/javascriptcore/stress/empty_eos_regex_split.js +++ /dev/null @@ -1,3 +0,0 @@ -var splited = "a".split(/$/); -if (splited.length != 1 || splited[0] != "a") - throw "Error: " + splited.length + " = " + splited; diff --git a/implementation-contributed/javascriptcore/stress/float32-array-nan-inlined.js b/implementation-contributed/javascriptcore/stress/float32-array-nan-inlined.js deleted file mode 100644 index 53ec2d1376..0000000000 --- a/implementation-contributed/javascriptcore/stress/float32-array-nan-inlined.js +++ /dev/null @@ -1,20 +0,0 @@ -function foo(o) { - return o[0]; -} - -function test(a, x) { - var intArray = new Int32Array(1); - intArray[0] = a; - var floatArray = new Float32Array(intArray.buffer); - var element = foo(floatArray); - var result = element + 1; - if (("" + result) != ("" + x)) - throw "Error: bad result for " + a + ": " + result + ", but expected: " + x + "; loaded " + element + " from the array"; -} - -noInline(test); - -for (var i = 0; i < 100000; ++i) - test(0, 1); - -test(0xFFFF0000, 0/0); diff --git a/implementation-contributed/javascriptcore/stress/float32-array-nan.js b/implementation-contributed/javascriptcore/stress/float32-array-nan.js deleted file mode 100644 index f74add8b32..0000000000 --- a/implementation-contributed/javascriptcore/stress/float32-array-nan.js +++ /dev/null @@ -1,20 +0,0 @@ -function foo(o) { - return o[0]; -} - -noInline(foo); - -function test(a, x) { - var intArray = new Int32Array(1); - intArray[0] = a; - var floatArray = new Float32Array(intArray.buffer); - var element = foo(floatArray); - var result = element + 1; - if (("" + result) != ("" + x)) - throw "Error: bad result for " + a + ": " + result + ", but expected: " + x + "; loaded " + element + " from the array"; -} - -for (var i = 0; i < 100000; ++i) - test(0, 1); - -test(0xFFFF0000, 0/0); diff --git a/implementation-contributed/javascriptcore/stress/float32-array-out-of-bounds.js b/implementation-contributed/javascriptcore/stress/float32-array-out-of-bounds.js deleted file mode 100644 index b50765d7c0..0000000000 --- a/implementation-contributed/javascriptcore/stress/float32-array-out-of-bounds.js +++ /dev/null @@ -1,23 +0,0 @@ -function foo(a) { - return a[42]; -} - -noInline(foo); - -var shortArray = new Float32Array(10); -var longArray = new Float32Array(100); - -function test(array, expected) { - var result = foo(array); - if (result != expected) - throw new Error("bad result: " + result); -} - -for (var i = 0; i < 1000; ++i) - test(shortArray, void 0); - -for (var i = 0; i < 100000; ++i) - test(longArray, 0); - -test(shortArray, void 0); - diff --git a/implementation-contributed/javascriptcore/stress/float32-repeat-out-of-bounds.js b/implementation-contributed/javascriptcore/stress/float32-repeat-out-of-bounds.js deleted file mode 100644 index 92f81c6368..0000000000 --- a/implementation-contributed/javascriptcore/stress/float32-repeat-out-of-bounds.js +++ /dev/null @@ -1,17 +0,0 @@ -//@ defaultNoEagerRun - -function foo(a) { - a[0] = 1; - a[1] = 2; - a[2] = 3; -} - -noInline(foo); - -var array = new Float32Array(1); - -for (var i = 0; i < 100000; ++i) - foo(array); - -if (reoptimizationRetryCount(foo)) - throw "Error: unexpected retry count: " + reoptimizationRetryCount(foo); diff --git a/implementation-contributed/javascriptcore/stress/float32array-out-of-bounds.js b/implementation-contributed/javascriptcore/stress/float32array-out-of-bounds.js deleted file mode 100644 index 02a02dda7d..0000000000 --- a/implementation-contributed/javascriptcore/stress/float32array-out-of-bounds.js +++ /dev/null @@ -1,29 +0,0 @@ -function make(value) { - var result = new Float32Array(1); - result[0] = value; - return result; -} - -function foo(a, i) { - return a[i]; -} - -noInline(foo); - -function test(value) { - var result = foo(make(value), 0); - if (result != value) - throw "Error: bad result: " + result; -} - -for (var i = 0; i < 100000; ++i) - test(42); - -var result = foo(make(42), 1); -if (result !== void 0) - throw "Error: bad result: " + result; - -Float32Array.prototype[1] = 23; -result = foo(make(42), 1); -if (result !== 23) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/float64-array-nan-inlined.js b/implementation-contributed/javascriptcore/stress/float64-array-nan-inlined.js deleted file mode 100644 index 582d0389a8..0000000000 --- a/implementation-contributed/javascriptcore/stress/float64-array-nan-inlined.js +++ /dev/null @@ -1,37 +0,0 @@ -//@ defaultRun -//@ runNoJIT - -function foo(o) { - return o[0]; -} - -function isBigEndian() { - var word = new Int16Array(1); - word[0] = 1; - var bytes = new Int8Array(word.buffer); - return !bytes[0]; -} - -function test(a, b, x) { - var intArray = new Int32Array(2); - intArray[0] = a; - intArray[1] = b; - var floatArray = new Float64Array(intArray.buffer); - var element = foo(floatArray); - var result = element + 1; - if (("" + result) != ("" + x)) - throw "Error: bad result for " + a + ", " + b + ": " + result + ", but expected: " + x + "; loaded " + element + " from the array"; -} - -noInline(test); - -for (var i = 0; i < 100000; ++i) - test(0, 0, 1); - -if (isBigEndian()) { - test(0xFFFF0000, 0, 0/0); - test(0, 0xFFFF0000, 1); -} else { - test(0xFFFF0000, 0, 1); - test(0, 0xFFFF0000, 0/0); -} diff --git a/implementation-contributed/javascriptcore/stress/float64-array-nan.js b/implementation-contributed/javascriptcore/stress/float64-array-nan.js deleted file mode 100644 index fd91baf81f..0000000000 --- a/implementation-contributed/javascriptcore/stress/float64-array-nan.js +++ /dev/null @@ -1,34 +0,0 @@ -function foo(o) { - return o[0]; -} - -noInline(foo); - -function isBigEndian() { - var word = new Int16Array(1); - word[0] = 1; - var bytes = new Int8Array(word.buffer); - return !bytes[0]; -} - -function test(a, b, x) { - var intArray = new Int32Array(2); - intArray[0] = a; - intArray[1] = b; - var floatArray = new Float64Array(intArray.buffer); - var element = foo(floatArray); - var result = element + 1; - if (("" + result) != ("" + x)) - throw "Error: bad result for " + a + ", " + b + ": " + result + ", but expected: " + x + "; loaded " + element + " from the array"; -} - -for (var i = 0; i < 100000; ++i) - test(0, 0, 1); - -if (isBigEndian()) { - test(0xFFFF0000, 0, 0/0); - test(0, 0xFFFF0000, 1); -} else { - test(0xFFFF0000, 0, 1); - test(0, 0xFFFF0000, 0/0); -} diff --git a/implementation-contributed/javascriptcore/stress/floating-point-div-to-mul.js b/implementation-contributed/javascriptcore/stress/floating-point-div-to-mul.js deleted file mode 100644 index 6ce0503e03..0000000000 --- a/implementation-contributed/javascriptcore/stress/floating-point-div-to-mul.js +++ /dev/null @@ -1,216 +0,0 @@ -function opaqueDivBy2(a) -{ - return a / 2; -} -noInline(opaqueDivBy2); - -function opaqueDivBy3(a) -{ - return a / 3; -} -noInline(opaqueDivBy3); - -function opaqueDivBy4(a) -{ - return a / 4; -} -noInline(opaqueDivBy4); - -function opaqueDivBySafeMaxMinusOne(a) -{ - // 2^1022 - return a / 44942328371557897693232629769725618340449424473557664318357520289433168951375240783177119330601884005280028469967848339414697442203604155623211857659868531094441973356216371319075554900311523529863270738021251442209537670585615720368478277635206809290837627671146574559986811484619929076208839082406056034304; -} -noInline(opaqueDivBySafeMaxMinusOne); - -function opaqueDivBySafeMax(a) -{ - // 2^1023 - return a / 89884656743115795386465259539451236680898848947115328636715040578866337902750481566354238661203768010560056939935696678829394884407208311246423715319737062188883946712432742638151109800623047059726541476042502884419075341171231440736956555270413618581675255342293149119973622969239858152417678164812112068608; -} -noInline(opaqueDivBySafeMax); - -function opaqueDivBySafeMaxPlusOne(a) -{ - // 2^1024 - return a / 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216; -} -noInline(opaqueDivBySafeMaxPlusOne); - -function opaqueDivBySafeMin(a) -{ - // 2^-1022 - return a / (1 / 44942328371557897693232629769725618340449424473557664318357520289433168951375240783177119330601884005280028469967848339414697442203604155623211857659868531094441973356216371319075554900311523529863270738021251442209537670585615720368478277635206809290837627671146574559986811484619929076208839082406056034304); -} -noInline(opaqueDivBySafeMin); - -function opaqueDivBySafeMinMinusOne(a) -{ - // 2^-1023 - return a / (1 / 89884656743115795386465259539451236680898848947115328636715040578866337902750481566354238661203768010560056939935696678829394884407208311246423715319737062188883946712432742638151109800623047059726541476042502884419075341171231440736956555270413618581675255342293149119973622969239858152417678164812112068608); -} -noInline(opaqueDivBySafeMinMinusOne); - - -for (let i = 0; i < 1e4; ++i) { - let result = opaqueDivBy2(Math.PI); - if (result !== 1.5707963267948966) - throw "Failed opaqueDivBy2(Math.PI). Result = " + result; - result = opaqueDivBy2(NaN); - if (result === result) - throw "Failed opaqueDivBy2(NaN). Result = " + result; - result = opaqueDivBy2(Infinity); - if (result !== Infinity) - throw "Failed opaqueDivBy2(Infinity). Result = " + result; - result = opaqueDivBy2(-Infinity); - if (result !== -Infinity) - throw "Failed opaqueDivBy2(-Infinity). Result = " + result; - result = opaqueDivBy2(Math.E); - if (result !== 1.3591409142295225) - throw "Failed opaqueDivBy2(Math.E). Result = " + result; - - result = opaqueDivBy3(Math.PI); - if (result !== 1.0471975511965976) - throw "Failed opaqueDivBy3(Math.PI). Result = " + result; - result = opaqueDivBy3(NaN); - if (result === result) - throw "Failed opaqueDivBy3(NaN). Result = " + result; - result = opaqueDivBy3(Infinity); - if (result !== Infinity) - throw "Failed opaqueDivBy3(Infinity). Result = " + result; - result = opaqueDivBy3(-Infinity); - if (result !== -Infinity) - throw "Failed opaqueDivBy3(-Infinity). Result = " + result; - result = opaqueDivBy3(Math.E); - if (result !== 0.9060939428196817) - throw "Failed opaqueDivBy3(Math.E). Result = " + result; - - result = opaqueDivBy4(Math.PI); - if (result !== 0.7853981633974483) - throw "Failed opaqueDivBy4(Math.PI). Result = " + result; - result = opaqueDivBy4(NaN); - if (result === result) - throw "Failed opaqueDivBy4(NaN). Result = " + result; - result = opaqueDivBy4(Infinity); - if (result !== Infinity) - throw "Failed opaqueDivBy4(Infinity). Result = " + result; - result = opaqueDivBy4(-Infinity); - if (result !== -Infinity) - throw "Failed opaqueDivBy4(-Infinity). Result = " + result; - result = opaqueDivBy4(Math.E); - if (result !== 0.6795704571147613) - throw "Failed opaqueDivBy4(Math.E). Result = " + result; - - result = opaqueDivBySafeMaxMinusOne(Math.PI); - if (result !== 6.990275687580919e-308) - throw "Failed opaqueDivBySafeMaxMinusOne(Math.PI). Result = " + result; - result = opaqueDivBySafeMaxMinusOne(NaN); - if (result === result) - throw "Failed opaqueDivBySafeMaxMinusOne(NaN). Result = " + result; - result = opaqueDivBySafeMaxMinusOne(Infinity); - if (result !== Infinity) - throw "Failed opaqueDivBySafeMaxMinusOne(Infinity). Result = " + result; - result = opaqueDivBySafeMaxMinusOne(-Infinity); - if (result !== -Infinity) - throw "Failed opaqueDivBySafeMaxMinusOne(-Infinity). Result = " + result; - result = opaqueDivBySafeMaxMinusOne(Math.E); - if (result !== 6.048377836559378e-308) - throw "Failed opaqueDivBySafeMaxMinusOne(Math.E). Result = " + result; - - result = opaqueDivBySafeMax(Math.PI); - if (result !== 3.4951378437904593e-308) - throw "Failed opaqueDivBySafeMax(Math.PI). Result = " + result; - result = opaqueDivBySafeMax(NaN); - if (result === result) - throw "Failed opaqueDivBySafeMax(NaN). Result = " + result; - result = opaqueDivBySafeMax(Infinity); - if (result !== Infinity) - throw "Failed opaqueDivBySafeMax(Infinity). Result = " + result; - result = opaqueDivBySafeMax(-Infinity); - if (result !== -Infinity) - throw "Failed opaqueDivBySafeMax(-Infinity). Result = " + result; - result = opaqueDivBySafeMax(Math.E); - if (result !== 3.024188918279689e-308) - throw "Failed opaqueDivBySafeMax(Math.E). Result = " + result; - - result = opaqueDivBySafeMaxPlusOne(Math.PI); - if (result !== 0) - throw "Failed opaqueDivBySafeMaxPlusOne(Math.PI). Result = " + result; - result = opaqueDivBySafeMaxPlusOne(NaN); - if (result === result) - throw "Failed opaqueDivBySafeMaxPlusOne(NaN). Result = " + result; - result = opaqueDivBySafeMaxPlusOne(Infinity); - if (result === result) - throw "Failed opaqueDivBySafeMaxPlusOne(Infinity). Result = " + result; - result = opaqueDivBySafeMaxPlusOne(-Infinity); - if (result === result) - throw "Failed opaqueDivBySafeMaxPlusOne(-Infinity). Result = " + result; - result = opaqueDivBySafeMaxPlusOne(Math.E); - if (result !== 0) - throw "Failed opaqueDivBySafeMaxPlusOne(Math.E). Result = " + result; - - result = opaqueDivBySafeMin(Math.PI); - if (result !== 1.4119048864730642e+308) - throw "Failed opaqueDivBySafeMin(Math.PI). Result = " + result; - result = opaqueDivBySafeMin(NaN); - if (result === result) - throw "Failed opaqueDivBySafeMin(NaN). Result = " + result; - result = opaqueDivBySafeMin(Infinity); - if (result !== Infinity) - throw "Failed opaqueDivBySafeMin(Infinity). Result = " + result; - result = opaqueDivBySafeMin(-Infinity); - if (result !== -Infinity) - throw "Failed opaqueDivBySafeMin(-Infinity). Result = " + result; - result = opaqueDivBySafeMin(Math.E); - if (result !== 1.2216591454104522e+308) - throw "Failed opaqueDivBySafeMin(Math.E). Result = " + result; - - result = opaqueDivBySafeMinMinusOne(Math.PI); - if (result !== Infinity) - throw "Failed opaqueDivBySafeMinMinusOne(Math.PI). Result = " + result; - result = opaqueDivBySafeMinMinusOne(NaN); - if (result === result) - throw "Failed opaqueDivBySafeMinMinusOne(NaN). Result = " + result; - result = opaqueDivBySafeMinMinusOne(Infinity); - if (result !== Infinity) - throw "Failed opaqueDivBySafeMinMinusOne(Infinity). Result = " + result; - result = opaqueDivBySafeMinMinusOne(-Infinity); - if (result !== -Infinity) - throw "Failed opaqueDivBySafeMinMinusOne(-Infinity). Result = " + result; - result = opaqueDivBySafeMinMinusOne(Math.E); - if (result !== Infinity) - throw "Failed opaqueDivBySafeMinMinusOne(Math.E). Result = " + result; -} - - -// Check that we don't do anything crazy with crazy types. -for (let i = 0; i < 1e3; ++i) { - let result = opaqueDivBy2(); - if (result === result) - throw "Failed opaqueDivBy2()"; - result = opaqueDivBy4(null); - if (result !== 0) - throw "Failed opaqueDivBy4(null)"; - result = opaqueDivBySafeMaxMinusOne("WebKit!"); - if (result === result) - throw "Failed opaqueDivBy4(null)"; - result = opaqueDivBySafeMin(""); - if (result !== 0) - throw "Failed opaqueDivBySafeMin('')"; - try { - result = opaqueDivBy2(Symbol()); - throw "Failed opaqueDivBy2(Symbol())"; - } catch (exception) { - if (exception != "TypeError: Cannot convert a symbol to a number") - throw "Wrong exception: " + exception; - } - result = opaqueDivBy4(true); - if (result !== 0.25) - throw "Failed opaqueDivBy4(true)"; - result = opaqueDivBySafeMaxMinusOne(false); - if (result !== 0) - throw "Failed opaqueDivBySafeMaxMinusOne(false)"; - result = opaqueDivBySafeMin({ valueOf: function() { return 42; }}); - if (result !== Infinity) - throw "Failed opaqueDivBySafeMin({ valueOf: function() { return 42; }})"; -} diff --git a/implementation-contributed/javascriptcore/stress/flush-after-force-exit-in-bytecodeparser-needs-to-update-argument-positions.js b/implementation-contributed/javascriptcore/stress/flush-after-force-exit-in-bytecodeparser-needs-to-update-argument-positions.js deleted file mode 100644 index a1e99ff8e1..0000000000 --- a/implementation-contributed/javascriptcore/stress/flush-after-force-exit-in-bytecodeparser-needs-to-update-argument-positions.js +++ /dev/null @@ -1,32 +0,0 @@ -//@ runDefault("--useConcurrentGC=0", "--thresholdForJITAfterWarmUp=10", "--thresholdForJITSoon=10", "--thresholdForOptimizeAfterWarmUp=20", "--thresholdForOptimizeAfterLongWarmUp=20", "--thresholdForOptimizeSoon=20", "--thresholdForFTLOptimizeAfterWarmUp=20", "--thresholdForFTLOptimizeSoon=20", "--maximumEvalCacheableSourceLength=150000", "--maxPerThreadStackUsage=1048576") - -function runNearStackLimit(f) { - function t() { - try { - return t(); - } catch (e) { - return f(); - } - } - return t(); -}; - -runNearStackLimit(() => { }); -runNearStackLimit(() => { }); - -function f2(a, b) { - 'use strict'; - try { - a.push(arguments[0] + arguments[2] + a + undefinedVariable); - } catch (e) { } -} - -try { - runNearStackLimit(() => { - return f2(1, 2, 3); - }); -} catch (e) {} - -try { - runNearStackLimit(); -} catch { } diff --git a/implementation-contributed/javascriptcore/stress/fold-based-on-int32-proof-mul.js b/implementation-contributed/javascriptcore/stress/fold-based-on-int32-proof-mul.js deleted file mode 100644 index 94fa137f16..0000000000 --- a/implementation-contributed/javascriptcore/stress/fold-based-on-int32-proof-mul.js +++ /dev/null @@ -1,14 +0,0 @@ -function foo(a, b) { - return a * b === -0; -} -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(1, 1); - if (result !== false) - throw "Error: bad result: " + result; -} - -var result = foo(-1, 0); -if (result !== true) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/fold-based-on-int32-proof-or-zero.js b/implementation-contributed/javascriptcore/stress/fold-based-on-int32-proof-or-zero.js deleted file mode 100644 index b28ed691db..0000000000 --- a/implementation-contributed/javascriptcore/stress/fold-based-on-int32-proof-or-zero.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo(a, b) { - var c = a + b; - return (c | 0) == c; -} -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(1, 1); - if (result !== true) - throw "Error: bad result: " + result; -} - -var result = foo(1073741824, 1073741824); -if (result !== false) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/fold-based-on-int32-proof.js b/implementation-contributed/javascriptcore/stress/fold-based-on-int32-proof.js deleted file mode 100644 index f9a2ee54b7..0000000000 --- a/implementation-contributed/javascriptcore/stress/fold-based-on-int32-proof.js +++ /dev/null @@ -1,14 +0,0 @@ -function foo(a, b) { - return a + b === 2147483648; -} -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(1, 1); - if (result !== false) - throw "Error: bad result: " + result; -} - -var result = foo(1073741824, 1073741824); -if (result !== true) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/fold-load-varargs-arity-check-fail-barely.js b/implementation-contributed/javascriptcore/stress/fold-load-varargs-arity-check-fail-barely.js deleted file mode 100644 index f1a1398290..0000000000 --- a/implementation-contributed/javascriptcore/stress/fold-load-varargs-arity-check-fail-barely.js +++ /dev/null @@ -1,28 +0,0 @@ -function foo(a, b) { - return [a, b]; -} - -function bar() { - return foo.apply(this, arguments); -} - -function baz() { - return bar(42); -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - var result = baz(); - if (!(result instanceof Array)) - throw "Error: result is not an array."; - if (result.length != 2) - throw "Error: result doesn't have length 4."; - if (result[0] != 42) - throw "Error: first element is not 42: " + result[0]; - for (var j = 1; j < 2; ++j) { - if (result[j] !== void 0) - throw "Error: element " + j + " is not undefined: " + result[j]; - } -} - diff --git a/implementation-contributed/javascriptcore/stress/fold-load-varargs-arity-check-fail.js b/implementation-contributed/javascriptcore/stress/fold-load-varargs-arity-check-fail.js deleted file mode 100644 index f166f0f2ff..0000000000 --- a/implementation-contributed/javascriptcore/stress/fold-load-varargs-arity-check-fail.js +++ /dev/null @@ -1,29 +0,0 @@ -function foo(a, b, c, d) { - return [a, b, c, d]; -} - -function bar() { - return foo.apply(this, arguments); -} - -function baz() { - return bar(42); -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - var result = baz(); - if (!(result instanceof Array)) - throw "Error: result is not an array."; - if (result.length != 4) - throw "Error: result doesn't have length 4."; - if (result[0] != 42) - throw "Error: first element is not 42: " + result[0]; - for (var j = 1; j < 4; ++j) { - if (result[j] !== void 0) - throw "Error: element " + j + " is not undefined: " + result[j]; - } -} - - diff --git a/implementation-contributed/javascriptcore/stress/fold-multi-get-by-offset-to-get-by-offset-with-watchpoint.js b/implementation-contributed/javascriptcore/stress/fold-multi-get-by-offset-to-get-by-offset-with-watchpoint.js deleted file mode 100644 index 0973369af1..0000000000 --- a/implementation-contributed/javascriptcore/stress/fold-multi-get-by-offset-to-get-by-offset-with-watchpoint.js +++ /dev/null @@ -1,26 +0,0 @@ -//@ defaultNoEagerRun - -function foo(o) { - return o.f; -} - -for (var i = 0; i < 100; ++i) { - var result = foo((i & 1) ? {f:1, g:2} : {g:1, f:2}); - if (result != 2 - (i & 1)) - throw "Error: bad result in warm-up loop for i = " + i + ": " + result; -} - -function bar(o) { - return o.g + effectful42() + foo(o); -} - -noInline(bar); - -for (var i = 0; i < 100000; ++i) { - var result = bar({f:i, g:i * 3}); - if (result != i * 4 + 42) - throw "Error: bad result for i = " + i + ": " + result; -} - -if (reoptimizationRetryCount(bar)) - throw "Error: reoptimized bar unexpectedly: " + reoptimizationRetryCount(bar); diff --git a/implementation-contributed/javascriptcore/stress/fold-multi-get-by-offset-to-get-by-offset-without-folding-the-structure-check-new.js b/implementation-contributed/javascriptcore/stress/fold-multi-get-by-offset-to-get-by-offset-without-folding-the-structure-check-new.js deleted file mode 100644 index e406102391..0000000000 --- a/implementation-contributed/javascriptcore/stress/fold-multi-get-by-offset-to-get-by-offset-without-folding-the-structure-check-new.js +++ /dev/null @@ -1,42 +0,0 @@ -function foo(o) { - return o.f; -} - -function bar(o) { - return o.g; -} - -function baz(o, p, q) { - var result = 0; - if (isFinalTier()) { - p = o; - q = o; - result += 10000; - } - result += foo(p); - result += bar(q); - return result; -} - -noInline(baz); - -for (var i = 0; i < 100000; ++i) { - var o, p, q; - var expected1; - var expected2; - o = {f:100, g:101}; - expected2 = 10000 + 100 + 101; - if (i & 1) { - p = {e:1, f:2, g:3}; - q = {e:4, f:5, g:6}; - expected1 = 2 + 6; - } else { - p = {f:7, g:8}; - q = {g:9, f:10}; - expected1 = 7 + 9; - } - var result = baz(o, p, q); - if (result != expected1 && result != expected2) - throw "Error: bad result: " + result + " (expected " + expected1 + " or " + expected2 + ")"; -} - diff --git a/implementation-contributed/javascriptcore/stress/fold-multi-get-by-offset-to-get-by-offset-without-folding-the-structure-check.js b/implementation-contributed/javascriptcore/stress/fold-multi-get-by-offset-to-get-by-offset-without-folding-the-structure-check.js deleted file mode 100644 index 56c35a005e..0000000000 --- a/implementation-contributed/javascriptcore/stress/fold-multi-get-by-offset-to-get-by-offset-without-folding-the-structure-check.js +++ /dev/null @@ -1,50 +0,0 @@ -function foo(o) { - return o.f; -} - -function fu(o) { - return o.e; -} - -function bar(f, o) { - return f(o); -} - -function baz(f, o) { - return f(o); -} - -for (var i = 0; i < 100; ++i) { - foo({f:1, e:2}); - foo({e:1, f:2}); - foo({d:1, e:2, f:3}); - fu({f:1, e:2}); - fu({e:1, f:2, g:3}); - fu({d:1, e:2, f:3, g:4}); -} - -for (var i = 0; i < 100; ++i) { - bar(foo, {f:1}); - bar(function() { }, null); - bar(function() { return 42; }, null); - baz(fu, {e:1}); - baz(function() { }, null); - baz(function() { return 42; }, null); -} - -(function(f, g, o, p) { - var result = 0; - var n = 1000000; - for (var i = 0; i < n; ++i) { - var q; - if (i == n - 1) - q = p; - else - q = o; - result += baz(g, q); - result += bar(f, q); - } - if (result != (n - 1) * (o.f + o.e) + 12 + 13) - throw "Error: bad result: " + result; -})(foo, fu, {f:42, e:2}, {e:12, f:13, g:14}); - diff --git a/implementation-contributed/javascriptcore/stress/fold-multi-get-by-offset-to-get-by-offset.js b/implementation-contributed/javascriptcore/stress/fold-multi-get-by-offset-to-get-by-offset.js deleted file mode 100644 index 34be8e9c8e..0000000000 --- a/implementation-contributed/javascriptcore/stress/fold-multi-get-by-offset-to-get-by-offset.js +++ /dev/null @@ -1,26 +0,0 @@ -//@ defaultNoEagerRun - -function foo(o) { - return o.f; -} - -for (var i = 0; i < 100; ++i) { - var result = foo((i & 1) ? {f:1, g:2} : {g:1, f:2}); - if (result != 2 - (i & 1)) - throw "Error: bad result in warm-up loop for i = " + i + ": " + result; -} - -function bar(o) { - return o.g + foo(o); -} - -noInline(bar); - -for (var i = 0; i < 100000; ++i) { - var result = bar({f:i, g:i * 3}); - if (result != i * 4) - throw "Error: bad result for i = " + i + ": " + result; -} - -if (reoptimizationRetryCount(bar)) - throw "Error: reoptimized bar unexpectedly: " + reoptimizationRetryCount(bar); diff --git a/implementation-contributed/javascriptcore/stress/fold-multi-put-by-offset-to-put-by-offset-without-folding-the-structure-check.js b/implementation-contributed/javascriptcore/stress/fold-multi-put-by-offset-to-put-by-offset-without-folding-the-structure-check.js deleted file mode 100644 index 0f3b8a1a0c..0000000000 --- a/implementation-contributed/javascriptcore/stress/fold-multi-put-by-offset-to-put-by-offset-without-folding-the-structure-check.js +++ /dev/null @@ -1,56 +0,0 @@ -function foo(o) { - o.f = 1; -} - -function fu(o) { - o.e = 2; -} - -function bar(f, o) { - f(o); -} - -function baz(f, o) { - f(o); -} - -for (var i = 0; i < 100; ++i) { - foo({f:1, e:2}); - foo({e:1, f:2}); - foo({d:1, e:2, f:3}); - fu({f:1, e:2}); - fu({e:1, f:2, g:3}); - fu({d:1, e:2, f:3, g:4}); -} - -for (var i = 0; i < 100; ++i) { - bar(foo, {f:1}); - bar(function() { }, null); - bar(function() { return 42; }, null); - baz(fu, {e:1}); - baz(function() { }, null); - baz(function() { return 42; }, null); -} - -(function(f, g, o, p) { - var result = 0; - var n = 1000000; - for (var i = 0; i < n; ++i) { - var q; - if (i == n - 1) - q = p; - else - q = o; - baz(g, q); - bar(f, q); - } - if (o.e != 2) - throw "Error: bad value in o.e: " + o.e; - if (o.f != 1) - throw "Error: bad value in o.f: " + o.f; - if (p.e != 2) - throw "Error: bad value in p.e: " + p.e; - if (p.f != 1) - throw "Error: bad value in p.f: " + p.f; -})(foo, fu, {f:42, e:2}, {e:12, f:13, g:14}); - diff --git a/implementation-contributed/javascriptcore/stress/fold-multi-put-by-offset-to-put-by-offset.js b/implementation-contributed/javascriptcore/stress/fold-multi-put-by-offset-to-put-by-offset.js deleted file mode 100644 index 8da82cf18c..0000000000 --- a/implementation-contributed/javascriptcore/stress/fold-multi-put-by-offset-to-put-by-offset.js +++ /dev/null @@ -1,40 +0,0 @@ -function foo(o) { - o.f = (o.f | 0) + 42; -} - -function callFoo(o) { - return foo(o); -} - -noInline(callFoo); - -for (var i = 0; i < 10000; ++i) { - var object; - if ((i % 3) == 0) - object = {g:3}; - else if ((i % 3) == 1) - object = {f:1, g:2}; - else if ((i % 3) == 2) - object = {g:1, f:2}; - callFoo(object); - if (object.f != 42 + (i % 3)) - throw "Error: bad result for i = " + i + ": " + object.f; -} - -function bar(o) { - var result = o.f; - foo(o); - return result; -} - -noInline(bar); - -for (var i = 0; i < 100000; ++i) { - var o = {f:42}; - var result = bar(o); - if (result != 42) - throw "Error: bad result at end: " + result; - if (o.f != 42 + 42) - throw "Error: bad o.f: " + o.f; -} - diff --git a/implementation-contributed/javascriptcore/stress/fold-typed-array-properties.js b/implementation-contributed/javascriptcore/stress/fold-typed-array-properties.js deleted file mode 100644 index 2d17d778bc..0000000000 --- a/implementation-contributed/javascriptcore/stress/fold-typed-array-properties.js +++ /dev/null @@ -1,35 +0,0 @@ -var a = new Int32Array(new ArrayBuffer(100), 4, 1); - -if (a.length != 1) - throw "Error: bad length (start): " + a.length; -if (a.byteOffset != 4) - throw "Error: bad offset (start): " + a.byteOffset; -if (a.byteLength != 4) - throw "Error: bad byte length (start): " + a.byteLength; - -function foo(when) { - var tmp = a.length; - if (tmp != 1) - throw "Error: bad length (" + when + "): " + tmp; - tmp = a.byteOffset; - if (tmp != 4) - throw "Error: bad offset (" + when + "): " + tmp; - tmp = a.byteLength; - if (tmp != 4) - throw "Error: bad byte length (" + when + "): " + tmp; -} - -for (var i = 0; i < 1000000; ++i) - foo("loop"); - -transferArrayBuffer(a.buffer); - -var didThrow = false; -try { - foo("after transfer"); -} catch (e) { - didThrow = true; -} - -if (!didThrow) - throw "Should have thrown."; diff --git a/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-immutable-butterfly-out-of-bounds-foldable.js b/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-immutable-butterfly-out-of-bounds-foldable.js deleted file mode 100644 index f72c5768bc..0000000000 --- a/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-immutable-butterfly-out-of-bounds-foldable.js +++ /dev/null @@ -1,56 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var array0 = [1, 2, 3, 4, 5]; -var array1 = [1.2, 2.3, 3.4, 4.5, 5.6]; -var array2 = ["Hello", "New", "World", "Cappuccino", "Cocoa"]; -var array3 = [null, null, null, null, null]; -var array4 = [undefined, undefined, undefined, undefined, undefined]; -var array5 = [false, true, false, true, false]; - -function test0() -{ - return array0[5]; -} -noInline(test0); - -function test1() -{ - return array1[5]; -} -noInline(test1); - -function test2() -{ - return array2[5]; -} -noInline(test2); - -function test3() -{ - return array3[5]; -} -noInline(test3); - -function test4() -{ - return array4[5]; -} -noInline(test4); - -function test5() -{ - return array5[5]; -} -noInline(test5); - -for (var i = 0; i < 1e5; ++i) { - shouldBe(test0(), undefined); - shouldBe(test1(), undefined); - shouldBe(test2(), undefined); - shouldBe(test3(), undefined); - shouldBe(test4(), undefined); - shouldBe(test5(), undefined); -} diff --git a/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-immutable-butterfly-out-of-bounds.js b/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-immutable-butterfly-out-of-bounds.js deleted file mode 100644 index 400eeda658..0000000000 --- a/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-immutable-butterfly-out-of-bounds.js +++ /dev/null @@ -1,66 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var array0 = [1, 2, 3, 4, 5]; -var array1 = [1.2, 2.3, 3.4, 4.5, 5.6]; -var array2 = ["Hello", "New", "World", "Cappuccino", "Cocoa"]; -var array3 = [null, null, null, null, null]; -var array4 = [undefined, undefined, undefined, undefined, undefined]; -var array5 = [false, true, false, true, false]; - -function test0() -{ - return array0[5]; -} -noInline(test0); - -function test1() -{ - return array1[5]; -} -noInline(test1); - -function test2() -{ - return array2[5]; -} -noInline(test2); - -function test3() -{ - return array3[5]; -} -noInline(test3); - -function test4() -{ - return array4[5]; -} -noInline(test4); - -function test5() -{ - return array5[5]; -} -noInline(test5); - -for (var i = 0; i < 1e5; ++i) { - shouldBe(test0(), undefined); - shouldBe(test1(), undefined); - shouldBe(test2(), undefined); - shouldBe(test3(), undefined); - shouldBe(test4(), undefined); - shouldBe(test5(), undefined); -} -// Breaking sane chains. -Array.prototype[5] = 42; -for (var i = 0; i < 1e5; ++i) { - shouldBe(test0(), 42); - shouldBe(test1(), 42); - shouldBe(test2(), 42); - shouldBe(test3(), 42); - shouldBe(test4(), 42); - shouldBe(test5(), 42); -} diff --git a/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-immutable-butterfly-with-types.js b/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-immutable-butterfly-with-types.js deleted file mode 100644 index 2114fa790d..0000000000 --- a/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-immutable-butterfly-with-types.js +++ /dev/null @@ -1,56 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var array0 = [1, 2, 3, 4, 5]; -var array1 = [1.2, 2.3, 3.4, 4.5, 5.6]; -var array2 = ["Hello", "New", "World", "Cappuccino", "Cocoa"]; -var array3 = [null, null, null, null, null]; -var array4 = [undefined, undefined, undefined, undefined, undefined]; -var array5 = [false, true, false, true, false]; - -function test0() -{ - return array0[0]; -} -noInline(test0); - -function test1() -{ - return array1[0]; -} -noInline(test1); - -function test2() -{ - return array2[0]; -} -noInline(test2); - -function test3() -{ - return array3[0]; -} -noInline(test3); - -function test4() -{ - return array4[0]; -} -noInline(test4); - -function test5() -{ - return array5[0]; -} -noInline(test5); - -for (var i = 0; i < 1e6; ++i) { - shouldBe(test0(), 1); - shouldBe(test1(), 1.2); - shouldBe(test2(), "Hello"); - shouldBe(test3(), null); - shouldBe(test4(), undefined); - shouldBe(test5(), false); -} diff --git a/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-immutable-butterfly.js b/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-immutable-butterfly.js deleted file mode 100644 index cf09b55166..0000000000 --- a/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-immutable-butterfly.js +++ /dev/null @@ -1,30 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var array = [1, 2, 3, 4, 5]; - -function checking(i) -{ - if (i === (1e6 - 1)) { - // array[0] = 42; - array.ok = 4000; - } else if (i === (2e6 - 4000)) { - array.hey = 4000; - } else if (i === (1e6 * 2)) { - array[0] = 42; - } -} -noInline(checking); - -function test(i) -{ - checking(i); - return array[0] + array[1]; -} -noInline(test); - -for (var i = 0; i < 2e6; ++i) - shouldBe(test(i), 3); -shouldBe(test(2e6), 44); diff --git a/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-read-only-dont-delete-object.js b/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-read-only-dont-delete-object.js deleted file mode 100644 index 50fdf9f2cb..0000000000 --- a/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-read-only-dont-delete-object.js +++ /dev/null @@ -1,60 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} -noInline(shouldBe); - -var array1 = {0:0, 1:1, 2:2, 3:3, 4:4, 5:5}; -var array2 = {0:"Hello", 1:"World", 2:"Cocoa"}; -Object.freeze(array1); -Object.freeze(array2); - -function test1() -{ - return array1[0] + array1[1] + array1[2] + array1[3] + array1[4] + array1[5]; -} -noInline(test1); - -function test2() -{ - return array1[0] + array1[1] + array1[2] + array1[3] + array1[4] + array1[5] + (array1[6] | 0); -} -noInline(test2); - -function test3() -{ - return array2[0] + array2[1] + array2[2]; -} -noInline(test3); - -var array3 = {}; -Object.defineProperty(array3, 0, { - get() { return 42; } -}); -Object.defineProperty(array3, 1, { - get() { return 42; } -}); -Object.freeze(array3); - -function test4() -{ - return array3[0] + array3[1]; -} -noInline(test4); - -var array4 = {0:0, 1:1, 2:2, 3:3, 4:4, 5:5}; -Object.seal(array4); - -function test5() -{ - return array4[0] + array4[1] + array4[2] + array4[3] + array4[4] + array4[5]; -} -noInline(test5); - -for (var i = 0; i < 1e5; ++i) { - shouldBe(test1(), 15); - shouldBe(test2(), 15); - shouldBe(test3(), `HelloWorldCocoa`); - shouldBe(test4(), 84); - shouldBe(test5(), 15); -} diff --git a/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-read-only-dont-delete-runtime-array.js b/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-read-only-dont-delete-runtime-array.js deleted file mode 100644 index 3739b42007..0000000000 --- a/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-read-only-dont-delete-runtime-array.js +++ /dev/null @@ -1,35 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} -noInline(shouldBe); - -var array1 = $vm.createRuntimeArray(0, 1, 2, 3, 4, 5); -Object.freeze(array1); - -function test1() -{ - return array1[0] + array1[1] + array1[2] + array1[3] + array1[4] + array1[5]; -} -noInline(test1); - -function test2() -{ - return array1[0] + array1[1] + array1[2] + array1[3] + array1[4] + array1[5] + (array1[6] | 0); -} -noInline(test2); - -var array4 = $vm.createRuntimeArray(0, 1, 2, 3, 4, 5); -Object.seal(array4); - -function test5() -{ - return array4[0] + array4[1] + array4[2] + array4[3] + array4[4] + array4[5]; -} -noInline(test5); - -for (var i = 0; i < 1e5; ++i) { - shouldBe(test1(), 15); - shouldBe(test2(), 15); - shouldBe(test5(), 15); -} diff --git a/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-read-only-dont-delete.js b/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-read-only-dont-delete.js deleted file mode 100644 index 92fbcbfa8d..0000000000 --- a/implementation-contributed/javascriptcore/stress/folding-get-by-val-with-read-only-dont-delete.js +++ /dev/null @@ -1,60 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} -noInline(shouldBe); - -var array1 = [0, 1, 2, 3, 4, 5]; -var array2 = ["Hello", "World", "Cocoa"]; -Object.freeze(array1); -Object.freeze(array2); - -function test1() -{ - return array1[0] + array1[1] + array1[2] + array1[3] + array1[4] + array1[5]; -} -noInline(test1); - -function test2() -{ - return array1[0] + array1[1] + array1[2] + array1[3] + array1[4] + array1[5] + (array1[6] | 0); -} -noInline(test2); - -function test3() -{ - return array2[0] + array2[1] + array2[2]; -} -noInline(test3); - -var array3 = []; -Object.defineProperty(array3, 0, { - get() { return 42; } -}); -Object.defineProperty(array3, 1, { - get() { return 42; } -}); -Object.freeze(array3); - -function test4() -{ - return array3[0] + array3[1]; -} -noInline(test4); - -var array4 = [0, 1, 2, 3, 4, 5]; -Object.seal(array4); - -function test5() -{ - return array4[0] + array4[1] + array4[2] + array4[3] + array4[4] + array4[5]; -} -noInline(test5); - -for (var i = 0; i < 1e5; ++i) { - shouldBe(test1(), 15); - shouldBe(test2(), 15); - shouldBe(test3(), `HelloWorldCocoa`); - shouldBe(test4(), 84); - shouldBe(test5(), 15); -} diff --git a/implementation-contributed/javascriptcore/stress/for-in-array-mode.js b/implementation-contributed/javascriptcore/stress/for-in-array-mode.js deleted file mode 100644 index 9002b940ad..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-array-mode.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2015 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. ``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 - * 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 funcArgAndBodyStr = -"(arr) {" + "\n" + -" var sum = 0;" + "\n" + -" for (var i in arr)" + "\n" + -" sum += arr[i];" + "\n" + -" return sum;" + "\n" + -"}"; - -var testData = { - "ArrayWithUndecided": { in: [], out: 0 }, - "ArrayWithInt32": { in: [ 1, 2, 3 ], out: 6 }, - "ArrayWithContiguous": { in: [ "a", "b", "c" ], out: "0abc" }, - "ArrayWithDouble": { in: [10.25, 20.25, 30.25 ], out: 60.75 }, - "ArrayWithArrayStorage": { in: [ "a", "b", "c" ], out: "0abc1000" }, // The in array will be augmented below. - "ArrayWithSlowPutArrayStorage": { in: [ "a", "b", "c" ], out: "0abc10" }, // the in array will be augmented below. - - "NonArrayWithUndecided": { in: {}, out: 0 }, - "NonArrayWithInt32": { in: { "0":1, "1":2, "2":3 }, out: 6 }, - "NonArrayWithContiguous": { in: { "0":"a", "1":"b", "2":"c" }, out: "0abc" }, - "NonArrayWithDouble": { in: { "0":10.25, "1":20.25, "2":30.25 }, out: 60.75 }, - "NonArrayWithArrayStorage": { in: { "0":"a", "1":"b", "2":"c" }, out: "0abc1000" }, // The in obj will be augmented below. - "NonArrayWithSlowPutArrayStorage": { in: { "0":"a", "1":"b", "2":"c" }, out: "0abc10" }, // the in obj will be augmented below. -}; - - -var o = { a: 10 }; -Object.defineProperties(o, { - "0": { - get: function() { return this.a; }, - set: function(x) { this.a = x; }, - }, -}); - -testData["ArrayWithArrayStorage"].in[1000] = 1000; -testData["ArrayWithSlowPutArrayStorage"].in.__proto__ = o; -testData["NonArrayWithArrayStorage"].in["1000"] = 1000; -testData["NonArrayWithSlowPutArrayStorage"].in.__proto__ = o; - -var numberOfFailures = 0; - -function test(name, data) { - eval("function " + name + funcArgAndBodyStr); - noInline(name); - - var failed = false; - var previousResult; - for (var i = 0; i < 10000; ++i) { - var expected = data.out; - var actual = eval(name + "(data.in)"); - - if ((actual != expected) && (actual != previousResult)) { - print("FAIL: " + name + ": expected: " + expected + ", actual: " + actual + ", starting @ loop iteration " + i); - previousResult = actual; - failed = true; - numberOfFailures++; - } - } -} - -for (name in testData) - test(name, testData[name]); - -if (numberOfFailures) - throw "Error: number of failures found: " + numberOfFailures; diff --git a/implementation-contributed/javascriptcore/stress/for-in-base-reassigned-later-and-change-structure.js b/implementation-contributed/javascriptcore/stress/for-in-base-reassigned-later-and-change-structure.js deleted file mode 100644 index 1b087d52d7..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-base-reassigned-later-and-change-structure.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo(o_) { - var o = o_; - var result = 0; - for (var s in o) { - result += o[s]; - if (result >= 3) - o = {0:1, 1:2, b:4, a:3}; - } - return result; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo({0:0, 1:1, a:2, b:3}); - if (result != 7) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/for-in-base-reassigned-later.js b/implementation-contributed/javascriptcore/stress/for-in-base-reassigned-later.js deleted file mode 100644 index 83115b4973..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-base-reassigned-later.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo(o_) { - var o = o_; - var result = 0; - for (var s in o) { - result += o[s]; - if (result >= 3) - o = {0:1, 1:2, a:3, b:4}; - } - return result; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo({0:0, 1:1, a:2, b:3}); - if (result != 7) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/for-in-base-reassigned.js b/implementation-contributed/javascriptcore/stress/for-in-base-reassigned.js deleted file mode 100644 index 09c87953b8..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-base-reassigned.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo(o_) { - var o = o_; - var result = 0; - for (var s in o) { - result += o[s]; - o = {0:1, 1:2, a:3, b:4}; - } - return result; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo({0:0, 1:1, a:2, b:3}); - if (result != 9) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/for-in-capture-string-loop-var.js b/implementation-contributed/javascriptcore/stress/for-in-capture-string-loop-var.js deleted file mode 100644 index c92bf686f1..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-capture-string-loop-var.js +++ /dev/null @@ -1,22 +0,0 @@ -(function() { - // Capture the loop variable and modify it inside the loop. - var foo = function() { - var captured; - var g = function() { - captured = "foo"; - }; - var sum = 0; - var o = {"foo": 1, "bar": 2}; - for (captured in o) { - g(); - sum += o[captured]; - } - return sum; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - if (foo() != 2) - throw new Error("bad result"); - } - foo(null); -})(); diff --git a/implementation-contributed/javascriptcore/stress/for-in-delete-during-iteration.js b/implementation-contributed/javascriptcore/stress/for-in-delete-during-iteration.js deleted file mode 100644 index 5ad3566fd0..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-delete-during-iteration.js +++ /dev/null @@ -1,69 +0,0 @@ -(function() { - // Remove a yet-to-be-visited indexed property during iteration. - var foo = function() { - var a = [1, 2, 3, 4, 5]; - var result = ""; - for (var p in a) { - if (p == 2) - delete a[3]; - result += a[p]; - } - return result; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - if (foo() !== "1235") - throw new Error("bad result"); - } - foo(null); -})(); -(function() { - // Remove a yet-to-be-visited non-indexed property during iteration. - var foo = function() { - var o = {}; - o.x = "x"; - o.y = "y"; - o.z = "z"; - var result = ""; - for (var p in o) { - if (p == "x") { - delete o.y; - o.a = "a"; - } - result += o[p]; - } - return result; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - if (foo() !== "xz") - throw new Error("bad result"); - } -})(); -(function() { - // Remove then re-add a property during iteration. - var foo = function() { - var A = function() {}; - A.prototype.x = "A.x"; - A.prototype.y = "A.y"; - var o = new A(); - o.z = "o.z"; - o.y = "o.y"; - o.x = "o.x"; - var result = ""; - for (var p in o) { - if (p == "z") - delete o.x; - if (p == "y") - o.x = "o.x"; - result += o[p]; - } - return result; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - if (foo() !== "o.zo.yo.x") - throw new Error("bad result"); - } - foo(null); -})(); diff --git a/implementation-contributed/javascriptcore/stress/for-in-invalidate-context-weird-assignments.js b/implementation-contributed/javascriptcore/stress/for-in-invalidate-context-weird-assignments.js deleted file mode 100644 index d111a75203..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-invalidate-context-weird-assignments.js +++ /dev/null @@ -1,82 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad"); -} - -function test(f) { - noInline(f); - for (let i = 0; i < 1000; ++i) - f(); -} - -test(function() { - let o = {xx: 0}; - for (let i in o) { - for (i in [0, 1, 2]) { } - assert(typeof i === "string"); - assert(o[i] === undefined); - } -}); - -test(function() { - let o = {xx: 0}; - for (let i in o) { - for (var i of [0]) { } - assert(typeof i === "number"); - assert(o[i] === undefined); - } -}); - -test(function() { - let o = {xx: 0}; - for (let i in o) { - for ({i} of [{i: 0}]) { } - assert(typeof i === "number"); - assert(o[i] === undefined); - } -}); - -test(function() { - let o = {xx: 0}; - for (let i in o) { - ;({i} = {i: 0}); - assert(typeof i === "number"); - assert(o[i] === undefined); - } -}); - -test(function() { - let o = {xx: 0}; - for (let i in o) { - ;([i] = [0]); - assert(typeof i === "number"); - assert(o[i] === undefined); - } -}); - -test(function() { - let o = {xx: 0}; - for (let i in o) { - ;({...i} = {a:20, b:30}); - assert(typeof i === "object"); - assert(o[i] === undefined); - } -}); - -test(function() { - let o = {xx: 0}; - for (let i in o) { - eval("i = 0;"); - assert(typeof i === "number"); - assert(o[i] === undefined); - } -}); - -test(function() { - let o = {xx: 0}; - for (let i in o) { - var i = 0; - assert(typeof i === "number"); - assert(o[i] === undefined); - } -}); diff --git a/implementation-contributed/javascriptcore/stress/for-in-invalidation-for-any-write.js b/implementation-contributed/javascriptcore/stress/for-in-invalidation-for-any-write.js deleted file mode 100644 index 7cbbbf2b2c..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-invalidation-for-any-write.js +++ /dev/null @@ -1,146 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion"); -} -noInline(assert); - -function test(f) { - noInline(f); - for (let i = 0; i < 1000; ++i) - f(); -} - -test(function() { - let o = {xx: 42}; - for (let i in o) { - for (let j = 0; j < 2; j++) { - let r = o[i]; - if (i === "xx") - assert(r === 42); - i = function() { } - } - } -}); - -test(function() { - let o = {xx: 42}; - for (let i in {xx: 0}) { - for (let j = 0; j < 2; j++) { - let r = o[i]; - if (i === "xx") - assert(r === 42); - i = new Uint32Array([0, 1, 0x777777, 0, 0]); - } - } -}); - -test(function() { - let o = {xx: 42}; - for (let i in {xx: 0}) { - for (let j = 0; j < 2; j++) { - let r = o[i]; - if (i === "xx") - assert(r === 42); - ([i] = [new Uint32Array([0, 1, 0x777777, 0, 0])]); - } - } -}); - -test(function() { - let o = {xx: 42}; - for (let i in {xx: 0}) { - for (let j = 0; j < 2; j++) { - let r = o[i]; - if (i === "xx") - assert(r === 42); - ({xyz: i} = {xyz: new Uint32Array([0, 1, 0x777777, 0, 0])}); - } - } -}); - -test(function() { - let o = [1,2,3]; - let toStringCalls = 0; - let first; - let num = 0; - let total = 0; - for (let i in o) { - first = true; - for (let j = 0; j < 3; j++) { - let r = o[i]; - if (first) - assert(r === o[num]); - else - assert(r === undefined); - first = false; - i = { - toString() { - ++toStringCalls; - return "hello!"; - } - } - } - ++num; - } - - // Should be called twice per outer for-in loop. - assert(toStringCalls === o.length * 2); -}); - -test(function() { - let o = [1,2,3]; - let toStringCalls = 0; - let first; - let num = 0; - let total = 0; - for (let i in o) { - first = true; - for (let j = 0; j < 3; j++) { - let r = o[i]; - if (first) - assert(r === o[num]); - else - assert(r === undefined); - first = false; - ([i] = [{ - toString() { - ++toStringCalls; - return "hello!"; - } - }]); - } - ++num; - } - - // Should be called twice per outer for-in loop. - assert(toStringCalls === o.length * 2); -}); - -test(function() { - let o = [1,2,3]; - let toStringCalls = 0; - let first; - let num = 0; - let total = 0; - for (let i in o) { - first = true; - for (let j = 0; j < 3; j++) { - let r = o[i]; - if (first) - assert(r === o[num]); - else - assert(r === undefined); - first = false; - ({xyz: i} = {xyz: { - toString() { - ++toStringCalls; - return "hello!"; - } - }}); - } - ++num; - } - - // Should be called twice per outer for-in loop. - assert(toStringCalls === o.length * 2); -}); diff --git a/implementation-contributed/javascriptcore/stress/for-in-modify-int-loop-var.js b/implementation-contributed/javascriptcore/stress/for-in-modify-int-loop-var.js deleted file mode 100644 index 82397bc264..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-modify-int-loop-var.js +++ /dev/null @@ -1,21 +0,0 @@ -(function() { - // Change integer value of the loop variable in the loop. - var foo = function() { - var a = [1, 2, 3]; - var sum = 0; - for (var i in a) { - i += 10; - sum += i; - } - return sum; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - var result = foo(); - if (typeof result !== "string") - throw new Error("result should have type string"); - if (result !== "0010110210") - throw new Error("bad result"); - } - foo(null); -})(); diff --git a/implementation-contributed/javascriptcore/stress/for-in-modify-string-loop-var.js b/implementation-contributed/javascriptcore/stress/for-in-modify-string-loop-var.js deleted file mode 100644 index 071a0860f8..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-modify-string-loop-var.js +++ /dev/null @@ -1,19 +0,0 @@ -(function() { - // Change string value of the loop variable in the loop. - var foo = function() { - var sum = 0; - var a = [1, 2, 3]; - a.foo = 42; - for (var i in a) { - i = "foo"; - sum += a[i]; - } - return sum; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - if (foo() != 42 * 4) - throw new Error("bad result"); - } - foo(null); -})(); diff --git a/implementation-contributed/javascriptcore/stress/for-in-of-const.js b/implementation-contributed/javascriptcore/stress/for-in-of-const.js deleted file mode 100644 index cead58f085..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-of-const.js +++ /dev/null @@ -1,49 +0,0 @@ -// Check that const variables can't be assigned to from for-in/for-of. -// https://bugs.webkit.org/show_bug.cgi?id=156673 - -expect_nothrow = function(why, f) { - f(); -} - -expect_throw = function(why, f) { - threw = false; - try { - f(); - } catch (e) { - if (e.toString() != "TypeError: Attempted to assign to readonly property.") - throw Error("expected a TypeError, got " + e.toString()); - threw = true; - } - if (!threw) - throw Error("expected to throw"); -} - -// for-in - -expect_nothrow("regular for-in", function() { for (x in [1,2,3]) x; }); -expect_nothrow("var for-in", function() { for (var x in [1,2,3]) x; }); -expect_nothrow("let for-in", function() { for (let x in [1,2,3]) x; }); -expect_nothrow("for-in with const variable", function() { for (const x in [1,2,3]) x; }); -expect_nothrow("for-in which never iterates", function() { const x = 20; for (x in []) x; }); - -expect_throw("for-in on const from func's scope", function() { const x = 20; for (x in [1,2,3]) x; }); -expect_throw("same, with intervening capture", function() { const x = 20; capture = function() { x; }; for (x in [1,2,3]) x; }); -expect_throw("same, iterating in capture", function() { const x = 20; capture = function() { for (x in [1,2,3]) x; }; capture(); }); - -// for-of - -expect_nothrow("regular for-of", function() { for (x of [1,2,3]) x; }); -expect_nothrow("var for-of", function() { for (var x of [1,2,3]) x; }); -expect_nothrow("let for-of", function() { for (let x of [1,2,3]) x; }); -expect_nothrow("for-of with const variable", function() { for (const x of [1,2,3]) x; }); -expect_nothrow("for-of which never iterates", function() { const x = 20; for (x of []) x; }); - -expect_throw("for-of on const from func's scope", function() { const x = 20; for (x of [1,2,3]) x; }); -expect_throw("same, with intervening capture", function() { const x = 20; capture = function() { x; }; for (x of [1,2,3]) x; }); -expect_throw("same, iterating in capture", function() { const x = 20; capture = function() { for (x of [1,2,3]) x; }; capture(); }); - -expect_throw("bad destructuring", function() { let arr = [{x:20}]; const x = 50; for ({x} of arr) x; }); -expect_nothrow("good destructuring", function() { let arr = [{x:20}]; const x = 50; for ({x : foo} of arr) x; }); -expect_nothrow("const good destructuring", function() { let arr = [{x:20}]; const x = 50; for (const {x} of arr) x; }); -expect_nothrow("let good destructuring", function() { let arr = [{x:20}]; const x = 50; for (let {x} of arr) x; }); -// Note: `var {x}` would shadow `const x` and therefore fail. diff --git a/implementation-contributed/javascriptcore/stress/for-in-postfix-ignored-index.js b/implementation-contributed/javascriptcore/stress/for-in-postfix-ignored-index.js deleted file mode 100644 index b7947eadde..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-postfix-ignored-index.js +++ /dev/null @@ -1,14 +0,0 @@ -//@ runDefault - -function foo(o) { - var result = 0; - for (var s in o) { - s++; - result += o[s]; - } - return result; -} - -var result = foo({f:42}); -if ("" + result != "NaN") - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/for-in-postfix-index.js b/implementation-contributed/javascriptcore/stress/for-in-postfix-index.js deleted file mode 100644 index 0d59240f53..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-postfix-index.js +++ /dev/null @@ -1,15 +0,0 @@ -//@ runDefault - -function foo(o) { - var result = 0; - for (var s in o) { - var tmp = s++; - result += o[s]; - result += tmp; - } - return result; -} - -var result = foo({f:42}); -if ("" + result != "NaN") - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/for-in-prefix-index.js b/implementation-contributed/javascriptcore/stress/for-in-prefix-index.js deleted file mode 100644 index 4f700fd0e1..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-prefix-index.js +++ /dev/null @@ -1,12 +0,0 @@ -//@ runDefault - -function foo(o) { - var result = 0; - for (var s in o) - result += o[--s]; - return result; -} - -var result = foo({f:42}); -if ("" + result != "NaN") - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/for-in-prototype-with-indexed-properties-should-prevent-caching.js b/implementation-contributed/javascriptcore/stress/for-in-prototype-with-indexed-properties-should-prevent-caching.js deleted file mode 100644 index 8c3bfa6471..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-prototype-with-indexed-properties-should-prevent-caching.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict"; - -function assert(b) { - if (!b) - throw new Error; -} - - -function test1() { - function foo(o) { - let result = []; - for (let p in o) - result.push(p); - return result; - } - noInline(foo); - - let p = {}; - let x = {__proto__: p}; - p[0] = 25; - for (let i = 0; i < 20; ++i) { - let result = foo(x); - assert(result.length === 1); - assert(result[0] === "0"); - } - - p[1] = 30; - for (let i = 0; i < 20; ++i) { - let result = foo(x); - assert(result.length === 2); - assert(result[0] === "0"); - assert(result[1] === "1"); - } - - p[2] = {}; - for (let i = 0; i < 20; ++i) { - let result = foo(x); - assert(result.length === 3); - assert(result[0] === "0"); - assert(result[1] === "1"); - assert(result[2] === "2"); - } -} -test1(); - -function test2() { - function foo(o) { - let result = []; - for (let p in o) - result.push(p); - return result; - } - noInline(foo); - - let p = {}; - let x = {__proto__: p}; - for (let i = 0; i < 20; ++i) { - let result = foo(x); - assert(result.length === 0); - } - - p[0] = 30; - for (let i = 0; i < 20; ++i) { - let result = foo(x); - assert(result.length === 1); - assert(result[0] === "0"); - } - - p[1] = {}; - for (let i = 0; i < 20; ++i) { - let result = foo(x); - assert(result.length === 2); - assert(result[0] === "0"); - assert(result[1] === "1"); - } -} -test2(); diff --git a/implementation-contributed/javascriptcore/stress/for-in-prototype.js b/implementation-contributed/javascriptcore/stress/for-in-prototype.js deleted file mode 100644 index d12a1bdd50..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-prototype.js +++ /dev/null @@ -1,57 +0,0 @@ -(function() { - // Iterate when the base object's properties shadow properties in the prototype chain. - var foo = function() { - var A = function() { }; - A.prototype.x = 42; - var o = new A(); - o.x = 43; - var result = ""; - for (var p in o) - result += o[p]; - return result; - }; - for (var i = 0; i < 10000; ++i) { - if (foo() !== "43") - throw new Error("bad result"); - } - foo(null); -})(); -(function() { - // Iterate when the prototype has the same range of indexed properties as the base object. - var foo = function() { - var A = function() {}; - A.prototype[0] = 42; - var a = new A(); - a[0] = 43; - var result = ""; - for (var p in a) - result += a[p]; - return result; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - if (foo() !== "43") - throw new Error("bad result"); - } - foo(null); -})(); -(function() { - // Iterate when the prototype has indexed properties beyond the range of the base object. - var foo = function() { - var A = function() {}; - A.prototype[0] = 42; - A.prototype[1] = 3; - var a = new A(); - a[0] = 43; - var result = ""; - for (var p in a) - result += a[p]; - return result; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - if (foo() !== "433") - throw new Error("bad result"); - } - foo(null); -})(); diff --git a/implementation-contributed/javascriptcore/stress/for-in-shadow-prototype-property.js b/implementation-contributed/javascriptcore/stress/for-in-shadow-prototype-property.js deleted file mode 100644 index 855ab085cc..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-shadow-prototype-property.js +++ /dev/null @@ -1,22 +0,0 @@ -(function() { - // Add a property to the base object that shadows a property in the prototype during iteration. - var foo = function() { - var A = function() {}; - A.prototype.x = "A.x"; - A.prototype.y = "A.y"; - var o = new A(); - var result = ""; - for (var p in o) { - if (p == "x") - o.y = "o.y"; - result += o[p]; - } - return result; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - if (foo() !== "A.xo.y") - throw new Error("bad result"); - } - foo(null); -})(); diff --git a/implementation-contributed/javascriptcore/stress/for-in-side-effects.js b/implementation-contributed/javascriptcore/stress/for-in-side-effects.js deleted file mode 100755 index f822eba881..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-side-effects.js +++ /dev/null @@ -1,79 +0,0 @@ -// Regression test for bug 179212 - -var p = { "a": {} }; - -var flag = 0; -var data = []; -var copy = []; - -var z = new Proxy({}, { - getPrototypeOf: function() { - if (flag == 2) { - data[0] = { "x": "I changed" }; - } - - if (flag == 1) { - flag = 2; - } - - return {"a": 1, "b": 2} - } -}); - -p.__proto__ = z; - -function reset() -{ - flag = 0; - data = [1.1, 2.2, 3.3]; - copy = []; -} - -function runTest(func) -{ - reset(); - - for (var i = 0; i < 0x10000; i++) - func(); - - flag = 1; - func(); - - if (copy[0].x != "I changed") - throw "Expected updated value for copy[0]"; -} - -function testWithoutFTL() -{ - function f() - { - data[0] = 2.2; - for(var d in p) { - copy[0] = data[0]; - copy[1] = data[1]; - copy[2] = data[2]; - } - } - - noFTL(f); - - runTest(f); -} - -function testWithFTL() -{ - function f() - { - data[0] = 2.2; - for(var d in p) { - copy[0] = data[0]; - copy[1] = data[1]; - copy[2] = data[2]; - } - } - - runTest(f); -} - -testWithoutFTL(); -testWithFTL(); diff --git a/implementation-contributed/javascriptcore/stress/for-in-string.js b/implementation-contributed/javascriptcore/stress/for-in-string.js deleted file mode 100644 index 44640e6c7f..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-string.js +++ /dev/null @@ -1,16 +0,0 @@ -(function() { - // Iterate over characters in a string. - var o = "hello"; - var foo = function(o) { - var result = ""; - for (var s in o) - result += o[s]; - return result; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - if (foo("hello") !== "hello") - throw new Error("incorrect result"); - } - foo(null); -})(); diff --git a/implementation-contributed/javascriptcore/stress/for-in-tests.js b/implementation-contributed/javascriptcore/stress/for-in-tests.js deleted file mode 100644 index a685489a2d..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-tests.js +++ /dev/null @@ -1,211 +0,0 @@ -(function() { - // Iterate over an array with normal indexed properties. - var foo = function() { - var a = [1, 2, 3, 4, 5]; - var sum = 0; - var result = ""; - for (var p in a) - result += a[p]; - return result; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - if (foo() !== "12345") - throw new Error("bad result"); - } - foo(null); -})(); -(function() { - // Iterate over an object with normal non-indexed properties. - var foo = function() { - var o = {}; - o.x = 1; - o.y = 2; - o.z = 3; - var result = ""; - for (var p in o) - result += o[p]; - return result; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - if (foo() !== "123") - throw new Error("bad result"); - } - foo(null); -})(); -(function() { - // Iterate over an object with both indexed and non-indexed properties. - var foo = function() { - var o = {}; - o.x = 1; - o.y = 2; - o.z = 3; - o[0] = 4; - o[1] = 5; - o[2] = 6; - var result = ""; - for (var p in o) - result += o[p]; - return result; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - if (foo() != "456123") - throw new Error("bad result"); - } - foo(null); -})(); -(function() { - // Iterate over an array with both indexed and non-indexed properties. - var foo = function() { - var a = [4, 5, 6]; - a.x = 1; - a.y = 2; - a.z = 3; - var result = ""; - for (var p in a) - result += a[p]; - return result; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - if (foo() !== "456123") - throw new Error("bad result"); - } - foo(null); -})(); -(function() { - var foo = function(a, b) { - for (var p in b) { - var f1 = a[p]; - var f2 = b[p]; - if (f1 === f2) - continue; - a[p] = b[p]; - } - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - var o1 = {}; - var o2 = {}; - o2.x = 42; - o2.y = 53; - foo(o1, o2); - if (o1.x !== o2.x) - throw new Error("bad result: " + o1.x + "!==" + o2.x); - if (o1.y !== o2.y) - throw new Error("bad result: " + o1.y + "!==" + o2.y); - } -})(); - -(function() { - var foo = function(a, b) { - for (var p = b in a) {} - return p; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - var expected = 'expected-result'; - var result = foo({}, expected); - if (expected !== result) - throw new Error("bad result: " + result + "!==" + expected); - } - for (var i = 0; i < 10000; ++i) { - var expected = 'a'; - var result = foo({a:'abcd'}, expected); - if (expected !== result) - throw new Error("bad result: " + result + "!==" + expected); - } - for (var i = 0; i < 10000; ++i) { - var expected = 'b'; - var result = foo({a:'abcd', b: 'bcde'}, expected); - if (expected !== result) - throw new Error("bad result: " + result + "!==" + expected); - } - - for (var i = 0; i < 10000; ++i) { - var expected = 'c'; - var o = {a:'abcd', b: 'bcde'}; - o.c = 'cdef'; - var result = foo(o, expected); - if (expected !== result) - throw new Error("bad result: " + result + "!==" + expected); - } -})(); - -(function() { - var boo = function () { return 'expected-result'; }; - var foo = function(a) { - for (var p = boo() in a) {} - return p; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - var expected = 'expected-result'; - var result = foo({}); - if (expected !== result) - throw new Error("bad result: " + result + "!==" + expected); - } -})(); - -(function() { - var foo = function(a, b, first) { - { - let p = 'some-value'; - for (var p = b in a) {} - if (first) - return p; - } - return p; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - var expected = 'expected-result'; - var result = foo({}, expected, true); - if (expected !== result) - throw new Error("bad result: " + result + "!==" + expected); - } - for (var i = 0; i < 10000; ++i) { - var expected = 'expected-result'; - var result = foo({}, expected, false); - if (typeof result !== 'undefined') - throw new Error("bad result: " + result + "!== undefined"); - } -})(); - -(function() { - var foo = function(a, b, c) { - for (var p = b + c in a) {} - return p; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - var expected = 'expected-result'; - var result = foo({}, 'expected', '-result'); - if (expected !== result) - throw new Error("bad result: " + result + "!==" + expected); - } -})(); - -(function() { - var error = false; - try { - eval("(function() { 'use strict'; for (var i = 0 in {}) {}})()"); - } catch(e) { - error = e instanceof SyntaxError; - } - if (!error) - throw new Error("Expected SyntaxError error"); -})(); - -(function() { - var error = false; - try { - eval("(function() { const i = 10; for (var i = 0 in {}) {}})()"); - } catch(e) { - error = e instanceof SyntaxError; - } - if (!error) - throw new Error("Expected SyntaxError error"); -})(); diff --git a/implementation-contributed/javascriptcore/stress/for-in-typed-array.js b/implementation-contributed/javascriptcore/stress/for-in-typed-array.js deleted file mode 100644 index 08f8828b96..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-in-typed-array.js +++ /dev/null @@ -1,18 +0,0 @@ -(function() { - // Iterate over typed arrays. - var foo = function() { - var a = new Uint8Array(5); - for (var i = 0; i < a.length; ++i) - a[i] = i; - var result = ""; - for (var p in a) - result += a[p]; - return result; - }; - noInline(foo); - for (var i = 0; i < 10000; ++i) { - if (foo() !== "01234") - throw new Error("bad result"); - } - foo(null); -})(); diff --git a/implementation-contributed/javascriptcore/stress/for-let-comma.js b/implementation-contributed/javascriptcore/stress/for-let-comma.js deleted file mode 100644 index 73c2e7c246..0000000000 --- a/implementation-contributed/javascriptcore/stress/for-let-comma.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo() { - var array = []; - for (let x = 0, []; x < 10; ++x) { array.push(x); } - return array; -} - -var result = foo(); -if (result.length != 10) - throw "Error: bad length: " + result.length; -for (var i = 0; i < 10; ++i) { - if (result[i] != i) - throw "Error: bad entry at i = " + i + ": " + result[i]; -} -if (result.length != 10) - throw "Error: bad length: " + result.length; - diff --git a/implementation-contributed/javascriptcore/stress/force-exit-then-eval-dfg.js b/implementation-contributed/javascriptcore/stress/force-exit-then-eval-dfg.js deleted file mode 100644 index 5798086cc3..0000000000 --- a/implementation-contributed/javascriptcore/stress/force-exit-then-eval-dfg.js +++ /dev/null @@ -1,14 +0,0 @@ -function foo(a, b, string) -{ - OSRExit(); - return eval(string); -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(1, 2, "a + b + 1"); - if (result != 1 + 2 + 1) - throw "Error: bad result in loop: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/force-exit-then-eval.js b/implementation-contributed/javascriptcore/stress/force-exit-then-eval.js deleted file mode 100644 index b3fd93d378..0000000000 --- a/implementation-contributed/javascriptcore/stress/force-exit-then-eval.js +++ /dev/null @@ -1,23 +0,0 @@ -var flag = true; -flag = false; - -function foo(a, b, string) -{ - var x = a + b; - if (flag) - return eval(string); - return 42; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(1, 2, "x + 1"); - if (result != 42) - throw "Error: bad result in loop: " + result; -} - -flag = true; -var result = foo(1, 2, "x - 1"); -if (result != 1 + 2 - 1) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/forward-varargs-double-new-array-buffer.js b/implementation-contributed/javascriptcore/stress/forward-varargs-double-new-array-buffer.js deleted file mode 100644 index 48fd783f9f..0000000000 --- a/implementation-contributed/javascriptcore/stress/forward-varargs-double-new-array-buffer.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; - -function assert(b, m="") { - if (!b) - throw new Error("Bad assertion: " + m); -} -noInline(assert); - -function test() { - function baz(...args) { - return args; - } - function bar(...args) { - return baz(...args); - } - function foo(a, b, c, ...args) { - return bar(...args, a, ...[0.5, 1.5, 2.5]); - } - noInline(foo); - - for (let i = 0; i < 100000; i++) { - let r = foo(i, i+1, i+2, i+3); - assert(r.length === 5); - let [a, b, c, d, e] = r; - assert(a === i+3); - assert(b === i); - assert(c === 0.5); - assert(d === 1.5); - assert(e === 2.5); - } -} - -test(); diff --git a/implementation-contributed/javascriptcore/stress/forward-varargs-for-inlined-escaped-arguments.js b/implementation-contributed/javascriptcore/stress/forward-varargs-for-inlined-escaped-arguments.js deleted file mode 100644 index 6d2aed01fe..0000000000 --- a/implementation-contributed/javascriptcore/stress/forward-varargs-for-inlined-escaped-arguments.js +++ /dev/null @@ -1,21 +0,0 @@ -function foo() { - return arguments; -} - -function baz(a, b, c) { - return a + b + c; -} - -function bar(a, b, c) { - var args = foo(b, c, 42); - return baz.apply(void 0, args); -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var result = bar(1, 2, 3); - if (result != 47) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/freeze-and-seal-should-prevent-extensions.js b/implementation-contributed/javascriptcore/stress/freeze-and-seal-should-prevent-extensions.js deleted file mode 100644 index 6fc6c6dd41..0000000000 --- a/implementation-contributed/javascriptcore/stress/freeze-and-seal-should-prevent-extensions.js +++ /dev/null @@ -1,51 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -(function () { - "use strict"; - - var object = { - Cocoa: 'Cocoa', - Cappuccino: 'Cappuccino' - }; - - object.Matcha = 'Matcha'; - shouldBe(object.Matcha, 'Matcha'); - Object.freeze(object); - shouldBe(object.Matcha, 'Matcha'); - shouldBe(Reflect.isExtensible(object), false); - shouldThrow(() => object.Mocha = 'Mocha', `TypeError: Attempted to assign to readonly property.`); -}()); - -(function () { - "use strict"; - - var object = { - Cocoa: 'Cocoa', - Cappuccino: 'Cappuccino' - }; - - object.Matcha = 'Matcha'; - shouldBe(object.Matcha, 'Matcha'); - Object.seal(object); - shouldBe(object.Matcha, 'Matcha'); - shouldBe(Reflect.isExtensible(object), false); - shouldThrow(() => object.Mocha = 'Mocha', `TypeError: Attempted to assign to readonly property.`); -}()); diff --git a/implementation-contributed/javascriptcore/stress/freeze-setter.js b/implementation-contributed/javascriptcore/stress/freeze-setter.js deleted file mode 100644 index e43caf1d26..0000000000 --- a/implementation-contributed/javascriptcore/stress/freeze-setter.js +++ /dev/null @@ -1,20 +0,0 @@ -//@ runDefault - -"use strict"; - -let x; - -let o = { - set foo(value) - { - x = value; - } -}; - -Object.freeze(o); - -o.foo = 42; - -if (x != 42) - throw "Error: bad result: " + x; - diff --git a/implementation-contributed/javascriptcore/stress/freeze_leek.js b/implementation-contributed/javascriptcore/stress/freeze_leek.js deleted file mode 100644 index a171e496f3..0000000000 --- a/implementation-contributed/javascriptcore/stress/freeze_leek.js +++ /dev/null @@ -1,41 +0,0 @@ -var o = Object.freeze([]), - leak = {}; - -try { - throw o; -} catch (ex) {} - -if(o.stack !== undefined) - throw new Error("the stack was leaked."); - -o.stack = leak; - -if(o.stack === leak) - throw new Error("the object wasn't frozen."); - -o.other = "wrong"; - -if(o.other === "wrong") - throw new Error("the object wasn't frozen."); - - -o = Object.freeze({"hi": "other"}); - -try { - throw o; -} catch (ex) {} -o.stack = leak; - - -if(o.stack !== undefined) - throw new Error("the stack was leaked."); - -o.stack = leak; - -if(o.stack === leak) - throw new Error("the object wasn't frozen."); - -o.other = "wrong"; - -if(o.other === "wrong") - throw new Error("the object wasn't frozen."); diff --git a/implementation-contributed/javascriptcore/stress/fromCharCode-exception-check.js b/implementation-contributed/javascriptcore/stress/fromCharCode-exception-check.js deleted file mode 100644 index 328c06ed64..0000000000 --- a/implementation-contributed/javascriptcore/stress/fromCharCode-exception-check.js +++ /dev/null @@ -1,8 +0,0 @@ -// This shouldn't crash. - -try { - String.fromCharCode(Symbol(), new Proxy({}, { get() { } })); -} catch (e) { - if (!(e instanceof TypeError) || e.message !== "Cannot convert a symbol to a number") - throw new Error("bad error type or message" + e); -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-arithcos.js b/implementation-contributed/javascriptcore/stress/ftl-arithcos.js deleted file mode 100644 index 3c3ced7457..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-arithcos.js +++ /dev/null @@ -1,15 +0,0 @@ -//@ skip if $hostOS == "windows" - -function foo(x) { - return Math.cos(x); -} - -noInline(foo); - -var j = 0; -for (var i = 0; i < 100000; ++i) - j = foo(i); - -if (-0.5098753724179009 != j){ - throw "Error" -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-arithsin.js b/implementation-contributed/javascriptcore/stress/ftl-arithsin.js deleted file mode 100644 index b559f4d490..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-arithsin.js +++ /dev/null @@ -1,13 +0,0 @@ -function foo(x) { - return Math.sin(x); -} - -noInline(foo); - -var j = 0; -for (var i = 0; i < 100000; ++i) - j = foo(i); - -if (0.860248280789742 != j){ - throw "Error" -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-arithsqrt.js b/implementation-contributed/javascriptcore/stress/ftl-arithsqrt.js deleted file mode 100644 index dbe01ce4b7..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-arithsqrt.js +++ /dev/null @@ -1,13 +0,0 @@ -function foo(x) { - return Math.sqrt(x); -} - -noInline(foo); - -var j = 0; -for (var i = 0; i < 100000; ++i) - j = foo(i); - -if ( 316.226184874055 != j){ - throw "Error" -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-arithtan.js b/implementation-contributed/javascriptcore/stress/ftl-arithtan.js deleted file mode 100644 index b936c6eccd..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-arithtan.js +++ /dev/null @@ -1,14 +0,0 @@ -function foo(x) { - return Math.tan(x); -} - -noInline(foo); - -var expected = foo(100000 - 1); -var j = 0; -for (var i = 0; i < 100000; ++i) - j = foo(i); - -if (expected != j){ - throw `Error: ${j}`; -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-bit-xor-right-result-interference.js b/implementation-contributed/javascriptcore/stress/ftl-bit-xor-right-result-interference.js deleted file mode 100644 index 467bc11cae..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-bit-xor-right-result-interference.js +++ /dev/null @@ -1,31 +0,0 @@ -var toggle = 0; - -function bar() -{ - if (toggle ^= 1) - return 42; - else - return {valueOf: function() { return 42; }}; -} - -noInline(bar); - -function baz() -{ - return 7; -} - -noInline(baz); - -function foo() -{ - return bar() ^ baz(); -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(); - if (result != 45) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-call-bad-callee-exception-interesting-live-state.js b/implementation-contributed/javascriptcore/stress/ftl-call-bad-callee-exception-interesting-live-state.js deleted file mode 100644 index 48ed5dc9cb..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-call-bad-callee-exception-interesting-live-state.js +++ /dev/null @@ -1,57 +0,0 @@ -function foo(f, p) { - var x = 100; - var result = 101; - var pf = p.g; - try { - x = 102; - pf++; - result = f(); - f = 104; - pf++; - x = 106; - } catch (e) { - return {outcome: "exception", values: [f, pf, x, result]}; - } - return {outcome: "return", values: [f, pf, x, result]}; -} - -noInline(foo); - -function bar() { - return 107; -} - -noInline(bar); - -// Warm up foo(). -for (var i = 0; i < 100000; ++i) { - var result = foo(bar, {g:200}); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 202) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; -} - -// Now throw an exception. -var result = foo("hello", {g:300}); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 4) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== "hello") - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 301) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; -if (result.values[3] !== 101) - throw "Error at end: bad values[3]: " + result.values[3]; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-call-exception-interesting-live-state.js b/implementation-contributed/javascriptcore/stress/ftl-call-exception-interesting-live-state.js deleted file mode 100644 index 61a8a6e595..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-call-exception-interesting-live-state.js +++ /dev/null @@ -1,60 +0,0 @@ -function foo(f, p) { - var x = 100; - var result = 101; - var pf = p.g; - try { - x = 102; - pf++; - result = f(); - f = 104; - pf++; - x = 106; - } catch (e) { - return {outcome: "exception", values: [f, pf, x, result]}; - } - return {outcome: "return", values: [f, pf, x, result]}; -} - -noInline(foo); - -function bar() { - return 107; -} - -noInline(bar); - -// Warm up foo(). -for (var i = 0; i < 100000; ++i) { - var result = foo(bar, {g:200}); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 202) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; -} - -// Now throw an exception. -bar = function() { - throw "Error42"; -} -var result = foo(bar, {g:300}); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 4) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== bar) - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 301) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; -if (result.values[3] !== 101) - throw "Error at end: bad values[3]: " + result.values[3]; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-call-exception-no-catch.js b/implementation-contributed/javascriptcore/stress/ftl-call-exception-no-catch.js deleted file mode 100644 index 1b795fbd3d..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-call-exception-no-catch.js +++ /dev/null @@ -1,51 +0,0 @@ -function foo(f, p) { - var x = 100; - var result = 101; - x = 102; - p = 103; - result = f(); - f = 104; - p = 105; - x = 106; - return {outcome: "return", values: [f, p, x, result]}; -} - -noInline(foo); - -function bar() { - return 107; -} - -noInline(bar); - -// Warm up foo(). -for (var i = 0; i < 100000; ++i) { - var result = foo(bar); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 105) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; -} - -// Now throw an exception. -var result; -try { - bar = function() { - throw "Error42"; - } - var result = foo(bar, 108); -} catch (e) { - if (e != "Error42") - throw "Error at end: bad exception: " + e; - result = {outcome: "exception"}; -} -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; diff --git a/implementation-contributed/javascriptcore/stress/ftl-call-exception.js b/implementation-contributed/javascriptcore/stress/ftl-call-exception.js deleted file mode 100644 index 6893aa7fe3..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-call-exception.js +++ /dev/null @@ -1,59 +0,0 @@ -function foo(f, p, args) { - var x = 100; - var result = 101; - try { - x = 102; - p = 103; - result = f.apply(this, args); - f = 104; - p = 105; - x = 106; - } catch (e) { - return {outcome: "exception", values: [f, p, x, result]}; - } - return {outcome: "return", values: [f, p, x, result]}; -} - -noInline(foo); - -function bar(a, b, c) { - return a + b + c; -} - -noInline(bar); - -// Warm up foo(). -for (var i = 0; i < 100000; ++i) { - var result = foo(bar, null, [105, 1, 1]); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 105) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; -} - -// Now throw an exception. -bar = function() { - throw "Error42"; -} -var result = foo(bar, 108, [105, 1, 1]); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 4) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== bar) - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 103) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; -if (result.values[3] !== 101) - throw "Error at end: bad values[3]: " + result.values[3]; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-call-varargs-bad-args-exception-interesting-live-state.js b/implementation-contributed/javascriptcore/stress/ftl-call-varargs-bad-args-exception-interesting-live-state.js deleted file mode 100644 index 7b6d41e5b4..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-call-varargs-bad-args-exception-interesting-live-state.js +++ /dev/null @@ -1,60 +0,0 @@ -// This failure will be resolved by https://bugs.webkit.org/show_bug.cgi?id=150279. -//@ skip - -function foo(f, p, args) { - var x = 100; - var result = 101; - var pf = p.g; - try { - x = 102; - pf++; - result = f.apply(this, args); - f = 104; - pf++; - x = 106; - } catch (e) { - return {outcome: "exception", values: [f, pf, x, result]}; - } - return {outcome: "return", values: [f, pf, x, result]}; -} - -noInline(foo); - -function bar(a, b, c) { - return a + b + c; -} - -noInline(bar); - -// Warm up foo(). -for (var i = 0; i < 100000; ++i) { - var result = foo(bar, {g:200}, [105, 1, 1]); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 202) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; -} - -// Now throw an exception. -var result = foo(bar, {g:300}, 42); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 4) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== bar) - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 301) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; -if (result.values[3] !== 101) - throw "Error at end: bad values[3]: " + result.values[3]; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-call-varargs-bad-callee-exception-interesting-live-state.js b/implementation-contributed/javascriptcore/stress/ftl-call-varargs-bad-callee-exception-interesting-live-state.js deleted file mode 100644 index f60ac24af1..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-call-varargs-bad-callee-exception-interesting-live-state.js +++ /dev/null @@ -1,57 +0,0 @@ -function foo(f, p, args) { - var x = 100; - var result = 101; - var pf = p.g; - try { - x = 102; - pf++; - result = f.apply(this, args); - f = 104; - pf++; - x = 106; - } catch (e) { - return {outcome: "exception", values: [f, pf, x, result]}; - } - return {outcome: "return", values: [f, pf, x, result]}; -} - -noInline(foo); - -function bar(a, b, c) { - return a + b + c; -} - -noInline(bar); - -// Warm up foo(). -for (var i = 0; i < 100000; ++i) { - var result = foo(bar, {g:200}, [105, 1, 1]); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 202) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; -} - -// Now throw an exception. -var result = foo("hello", {g:300}, [105, 1, 1]); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 4) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== "hello") - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 301) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; -if (result.values[3] !== 101) - throw "Error at end: bad values[3]: " + result.values[3]; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-call-varargs-exception-interesting-live-state.js b/implementation-contributed/javascriptcore/stress/ftl-call-varargs-exception-interesting-live-state.js deleted file mode 100644 index 35770c4be0..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-call-varargs-exception-interesting-live-state.js +++ /dev/null @@ -1,60 +0,0 @@ -function foo(f, p, args) { - var x = 100; - var result = 101; - var pf = p.g; - try { - x = 102; - pf++; - result = f.apply(this, args); - f = 104; - pf++; - x = 106; - } catch (e) { - return {outcome: "exception", values: [f, pf, x, result]}; - } - return {outcome: "return", values: [f, pf, x, result]}; -} - -noInline(foo); - -function bar(a, b, c) { - return a + b + c; -} - -noInline(bar); - -// Warm up foo(). -for (var i = 0; i < 100000; ++i) { - var result = foo(bar, {g:200}, [105, 1, 1]); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 202) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; -} - -// Now throw an exception. -bar = function() { - throw "Error42"; -} -var result = foo(bar, {g:300}, [105, 1, 1]); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 4) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== bar) - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 301) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; -if (result.values[3] !== 101) - throw "Error at end: bad values[3]: " + result.values[3]; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-call-varargs-exception-no-catch.js b/implementation-contributed/javascriptcore/stress/ftl-call-varargs-exception-no-catch.js deleted file mode 100644 index 6cac2c9a23..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-call-varargs-exception-no-catch.js +++ /dev/null @@ -1,51 +0,0 @@ -function foo(f, p, args) { - var x = 100; - var result = 101; - x = 102; - p = 103; - result = f.apply(this, args); - f = 104; - p = 105; - x = 106; - return {outcome: "return", values: [f, p, x, result]}; -} - -noInline(foo); - -function bar(a, b, c) { - return a + b + c; -} - -noInline(bar); - -// Warm up foo(). -for (var i = 0; i < 100000; ++i) { - var result = foo(bar, null, [105, 1, 1]); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 105) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; -} - -// Now throw an exception. -var result; -try { - bar = function() { - throw "Error42"; - } - var result = foo(bar, 108, [105, 1, 1]); -} catch (e) { - if (e != "Error42") - throw "Error at end: bad exception: " + e; - result = {outcome: "exception"}; -} -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; diff --git a/implementation-contributed/javascriptcore/stress/ftl-call-varargs-exception.js b/implementation-contributed/javascriptcore/stress/ftl-call-varargs-exception.js deleted file mode 100644 index 76973eb992..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-call-varargs-exception.js +++ /dev/null @@ -1,59 +0,0 @@ -function foo(f, p) { - var x = 100; - var result = 101; - try { - x = 102; - p = 103; - result = f(); - f = 104; - p = 105; - x = 106; - } catch (e) { - return {outcome: "exception", values: [f, p, x, result]}; - } - return {outcome: "return", values: [f, p, x, result]}; -} - -noInline(foo); - -function bar() { - return 107; -} - -noInline(bar); - -// Warm up foo(). -for (var i = 0; i < 100000; ++i) { - var result = foo(bar); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 105) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; -} - -// Now throw an exception. -bar = function() { - throw "Error42"; -} -var result = foo(bar, 108); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 4) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== bar) - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 103) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; -if (result.values[3] !== 101) - throw "Error at end: bad values[3]: " + result.values[3]; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-checkin-variable.js b/implementation-contributed/javascriptcore/stress/ftl-checkin-variable.js deleted file mode 100644 index 275f6b42c4..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-checkin-variable.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo(l,x){ - var t = l in x; - return t; -} - -noInline(foo); - -var r; -for (var i = 0; i < 1000000; ++i) { - var z = { 'y' : i, 's' : i + 1 }; - z.s = 10; - r = foo("s",z); -} - -if (!r) { - print ("Error: " + r); -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-checkin.js b/implementation-contributed/javascriptcore/stress/ftl-checkin.js deleted file mode 100644 index 8cbde8b1b2..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-checkin.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo(x){ - var t = "s" in x; - return t; -} - -noInline(foo); - -var r; -for (var i = 0; i < 1000000; ++i) { - var z = { 'y' : i, 's' : i + 1 }; - z.s = 10; - r = foo(z); -} - -if (!r) { - print ("Error: " + r); -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-force-osr-exit.js b/implementation-contributed/javascriptcore/stress/ftl-force-osr-exit.js deleted file mode 100644 index 6fcfe53b43..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-force-osr-exit.js +++ /dev/null @@ -1,21 +0,0 @@ -function foo(p, o) { - var q = o.q; - if (p) - return q.f; - return q.g; -} - -noInline(foo); - -var o = {q: {f: 41, g: 42}}; - -for (var i = 0; i < 100000; ++i) { - var result = foo(false, o); - if (result != 42) - throw "Error: bad result: " + result; -} - -var result = foo(true, o); -if (result != 41) - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-function-dot-arguments-with-callee-saves.js b/implementation-contributed/javascriptcore/stress/ftl-function-dot-arguments-with-callee-saves.js deleted file mode 100644 index 89b1d69ada..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-function-dot-arguments-with-callee-saves.js +++ /dev/null @@ -1,23 +0,0 @@ -function baz() { - return foo.arguments; -} - -noInline(baz); - -function foo() { - return baz(); -} - -function bar(o, i) { - var x = o.f; - return [foo(1, 2, 3), x]; -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var a = bar({f:42}); - if (a.length != 2 || a[0].length != 3 || a[0][0] != 1 || a[0][1] != 2 || a[0][2] != 3 || a[1] != 42) - throw "Error: bad result: " + a; -} - diff --git a/implementation-contributed/javascriptcore/stress/ftl-get-by-id-getter-exception-interesting-live-state.js b/implementation-contributed/javascriptcore/stress/ftl-get-by-id-getter-exception-interesting-live-state.js deleted file mode 100644 index a7320ab1bd..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-get-by-id-getter-exception-interesting-live-state.js +++ /dev/null @@ -1,61 +0,0 @@ -function foo(o, p) { - var x = 100; - var result = 101; - var pf = p.g; - try { - x = 102; - pf++; - result = o.f; - o = 104; - pf++; - x = 106; - } catch (e) { - return {outcome: "exception", values: [o, pf, x, result]}; - } - return {outcome: "return", values: [o, pf, x, result]}; -} - -noInline(foo); - -// Warm up foo() with polymorphic objects and getters. -for (var i = 0; i < 100000; ++i) { - var o = {}; - o.__defineGetter__("f", function() { - return 107; - }); - if (i & 1) - o["i" + i] = i; // Make it polymorphic. - var result = foo(o, {g:200}); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 202) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; -} - -// Now throw an exception. -var o = {}; -o.__defineGetter__("f", function() { - throw "Error42"; -}); -var result = foo(o, {g:300}); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 4) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== o) - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 301) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; -if (result.values[3] !== 101) - throw "Error at end: bad values[3]: " + result.values[3]; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-get-by-id-getter-exception-no-catch.js b/implementation-contributed/javascriptcore/stress/ftl-get-by-id-getter-exception-no-catch.js deleted file mode 100644 index 85f357a26b..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-get-by-id-getter-exception-no-catch.js +++ /dev/null @@ -1,53 +0,0 @@ -function foo(o, p) { - var x = 100; - var result = 101; - x = 102; - p = 103; - result = o.f; - o = 104; - p = 105; - x = 106; - return {outcome: "return", values: [o, p, x, result]}; -} - -noInline(foo); - -// Warm up foo() with polymorphic objects and getters. -for (var i = 0; i < 100000; ++i) { - var o = {}; - o.__defineGetter__("f", function() { - return 107; - }); - if (i & 1) - o["i" + i] = i; // Make it polymorphic. - var result = foo(o); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 105) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; -} - -// Now throw an exception. -var result; -try { - var o = {}; - o.__defineGetter__("f", function() { - throw "Error42"; - }); - result = foo(o, 108); -} catch (e) { - if (e != "Error42") - throw "Error at end: bad exception: " + e; - result = {outcome: "exception"}; -} -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-get-by-id-getter-exception.js b/implementation-contributed/javascriptcore/stress/ftl-get-by-id-getter-exception.js deleted file mode 100644 index 38e732d916..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-get-by-id-getter-exception.js +++ /dev/null @@ -1,60 +0,0 @@ -function foo(o, p) { - var x = 100; - var result = 101; - try { - x = 102; - p = 103; - result = o.f; - o = 104; - p = 105; - x = 106; - } catch (e) { - return {outcome: "exception", values: [o, p, x, result]}; - } - return {outcome: "return", values: [o, p, x, result]}; -} - -noInline(foo); - -// Warm up foo() with polymorphic objects and getters. -for (var i = 0; i < 100000; ++i) { - var o = {}; - o.__defineGetter__("f", function() { - return 107; - }); - if (i & 1) - o["i" + i] = i; // Make it polymorphic. - var result = foo(o); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 105) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; -} - -// Now throw an exception. -var o = {}; -o.__defineGetter__("f", function() { - throw "Error42"; -}); -var result = foo(o, 108); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 4) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== o) - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 103) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; -if (result.values[3] !== 101) - throw "Error at end: bad values[3]: " + result.values[3]; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-get-by-id-slow-exception-interesting-live-state.js b/implementation-contributed/javascriptcore/stress/ftl-get-by-id-slow-exception-interesting-live-state.js deleted file mode 100644 index c8c14bc536..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-get-by-id-slow-exception-interesting-live-state.js +++ /dev/null @@ -1,58 +0,0 @@ -function foo(o, p) { - var x = 100; - var result = 101; - var pf = p.g; - try { - x = 102; - pf++; - result = o.f; - o = 104; - pf++; - x = 106; - } catch (e) { - return {outcome: "exception", values: [o, pf, x, result]}; - } - return {outcome: "return", values: [o, pf, x, result]}; -} - -noInline(foo); - -// Warm up foo() with polymorphic objects. -for (var i = 0; i < 100000; ++i) { - var o; - o = {f:107}; - o["i" + i] = i; // Make it polymorphic. - var result = foo(o, {g:200}); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 202) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; -} - -// Now throw an exception. -var o = {}; -o.__defineGetter__("f", function() { - throw "Error42"; -}); -var result = foo(o, {g:300}); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 4) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== o) - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 301) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; -if (result.values[3] !== 101) - throw "Error at end: bad values[3]: " + result.values[3]; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-get-by-id-slow-exception-no-catch.js b/implementation-contributed/javascriptcore/stress/ftl-get-by-id-slow-exception-no-catch.js deleted file mode 100644 index d19ab2e183..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-get-by-id-slow-exception-no-catch.js +++ /dev/null @@ -1,49 +0,0 @@ -function foo(o, p) { - var x = 100; - var result = 101; - x = 102; - p = 103; - result = o.f; - o = 104; - p = 105; - x = 106; - return {outcome: "return", values: [o, p, x, result]}; -} - -noInline(foo); - -// Warm up foo() with polymorphic objects. -for (var i = 0; i < 100000; ++i) { - var o; - o = {f:107}; - o["i" + i] = i; // Make it polymorphic. - var result = foo(o); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 105) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; -} - -// Now throw an exception. -var result; -try { - var o = {}; - o.__defineGetter__("f", function() { - throw "Error42"; - }); - result = foo(o, 108); -} catch (e) { - if (e != "Error42") - throw "Error at end: bad exception: " + e; - result = {outcome: "exception"}; -} -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; diff --git a/implementation-contributed/javascriptcore/stress/ftl-get-by-id-slow-exception.js b/implementation-contributed/javascriptcore/stress/ftl-get-by-id-slow-exception.js deleted file mode 100644 index 8dbfe6df63..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-get-by-id-slow-exception.js +++ /dev/null @@ -1,57 +0,0 @@ -function foo(o, p) { - var x = 100; - var result = 101; - try { - x = 102; - p = 103; - result = o.f; - o = 104; - p = 105; - x = 106; - } catch (e) { - return {outcome: "exception", values: [o, p, x, result]}; - } - return {outcome: "return", values: [o, p, x, result]}; -} - -noInline(foo); - -// Warm up foo() with polymorphic objects. -for (var i = 0; i < 100000; ++i) { - var o; - o = {f:107}; - o["i" + i] = i; // Make it polymorphic. - var result = foo(o); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 105) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; -} - -// Now throw an exception. -var o = {}; -o.__defineGetter__("f", function() { - throw "Error42"; -}); -var result = foo(o, 108); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 4) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== o) - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 103) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; -if (result.values[3] !== 101) - throw "Error at end: bad values[3]: " + result.values[3]; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-get-my-argument-by-val-inlined-and-not-inlined.js b/implementation-contributed/javascriptcore/stress/ftl-get-my-argument-by-val-inlined-and-not-inlined.js deleted file mode 100644 index 1d4eeaf285..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-get-my-argument-by-val-inlined-and-not-inlined.js +++ /dev/null @@ -1,27 +0,0 @@ -function foo(i) { - return arguments[i]; -} - -function bar(i) { - return [arguments[i], foo(i, "one", 2, "three"), arguments[i]]; -} - -noInline(bar); - -function arraycmp(a, b) { - if (a.length != b.length) - return false; - for (var i = 0; i < a.length; ++i) { - if (a[i] != b[i]) - return false; - } - return true; -} - -for (var i = 0; i < 10000; ++i) { - var thingies = [i % 4, "one", 2, "three"]; - var otherThingies = [i % 4, "five", 6, "seven"]; - var result = bar(i % 4, "five", 6, "seven"); - if (!arraycmp(result, [otherThingies[i % 4], thingies[i % 4], otherThingies[i % 4]])) - throw "Error: bad result for i = " + i + ": " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-get-my-argument-by-val-inlined.js b/implementation-contributed/javascriptcore/stress/ftl-get-my-argument-by-val-inlined.js deleted file mode 100644 index 99c82da79d..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-get-my-argument-by-val-inlined.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(i) { - return arguments[i]; -} - -function bar(i) { - return foo(i, "one", 2, "three"); -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var thingies = [i % 4, "one", 2, "three"]; - var result = bar(i % 4, "five", 6, "seven"); - if (result != thingies[i % 4]) - throw "Error: bad result for i = " + i + ": " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-get-my-argument-by-val.js b/implementation-contributed/javascriptcore/stress/ftl-get-my-argument-by-val.js deleted file mode 100644 index a17825394e..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-get-my-argument-by-val.js +++ /dev/null @@ -1,12 +0,0 @@ -function foo(i) { - return arguments[i]; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var thingies = [i % 4, "one", 2, "three"]; - var result = foo(i % 4, "one", 2, "three"); - if (result != thingies[i % 4]) - throw "Error: bad result for i = " + i + ": " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-getmyargumentslength-inline.js b/implementation-contributed/javascriptcore/stress/ftl-getmyargumentslength-inline.js deleted file mode 100644 index 51806340ce..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-getmyargumentslength-inline.js +++ /dev/null @@ -1,9 +0,0 @@ -function foo(){ - return arguments.length; -} - -for (var i = 0; i < 100000; ++i) { - var r = foo(11, 12, 13, 18, 19, 20); - if (r != 6) throw "Error: "+r; -} - diff --git a/implementation-contributed/javascriptcore/stress/ftl-getmyargumentslength.js b/implementation-contributed/javascriptcore/stress/ftl-getmyargumentslength.js deleted file mode 100644 index 8f05ed2bdf..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-getmyargumentslength.js +++ /dev/null @@ -1,11 +0,0 @@ -function foo(){ - return arguments.length; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var r = foo(11, 12, 13, 18, 19, 20); - if (r != 6) throw "Error: "+r; -} - diff --git a/implementation-contributed/javascriptcore/stress/ftl-gettypedarrayoffset-simple.js b/implementation-contributed/javascriptcore/stress/ftl-gettypedarrayoffset-simple.js deleted file mode 100644 index 7529fc647e..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-gettypedarrayoffset-simple.js +++ /dev/null @@ -1,12 +0,0 @@ -function foo(x){ - return x.byteOffset -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var b = new Uint8Array(42, 0); - if (foo(b) != 0) - throw "error" -} - diff --git a/implementation-contributed/javascriptcore/stress/ftl-gettypedarrayoffset-wasteful.js b/implementation-contributed/javascriptcore/stress/ftl-gettypedarrayoffset-wasteful.js deleted file mode 100644 index 0694e4ccc2..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-gettypedarrayoffset-wasteful.js +++ /dev/null @@ -1,12 +0,0 @@ -function foo(x){ - return x.byteOffset -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var b = new Uint8Array(new ArrayBuffer(42), 0); - if (foo(b) != 0) - throw "error" -} - diff --git a/implementation-contributed/javascriptcore/stress/ftl-has-a-bad-time.js b/implementation-contributed/javascriptcore/stress/ftl-has-a-bad-time.js deleted file mode 100644 index 698b7e01f9..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-has-a-bad-time.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo(p) { - return p ? [42] : null; -} - -noInline(foo); - -// Make sure we think that foo() allocates int arrays. -for (var i = 0; i < 100; ++i) - foo(true); - -// Now have a bad time. -var array = new Array(); -Array.prototype.__defineSetter__("0", function() { }); - -// Finally, get foo() to compile in the FTL. But don't allocate anymore arrays. -for (var i = 0; i < 100000; ++i) - foo(false); - diff --git a/implementation-contributed/javascriptcore/stress/ftl-in-overflow.js b/implementation-contributed/javascriptcore/stress/ftl-in-overflow.js deleted file mode 100644 index 84ecd0385f..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-in-overflow.js +++ /dev/null @@ -1,13 +0,0 @@ -function foo(o) { - return "foo" in o; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var o = {}; - o["i" + i] = 42; - o.foo = 43; - foo(o); -} - diff --git a/implementation-contributed/javascriptcore/stress/ftl-library-exception.js b/implementation-contributed/javascriptcore/stress/ftl-library-exception.js deleted file mode 100644 index 41a9e34c3b..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-library-exception.js +++ /dev/null @@ -1,21 +0,0 @@ -function foo(d){ - return Date.prototype.getTimezoneOffset.call(d); -} - -noInline(foo); - -var x; -var count = 100000; -var z = 0; -for (var i = 0 ; i < count; i++){ - try { - var q = foo(i < count - 10 ? new Date() : "a"); - x = false; - z = q; - } catch (e) { - x = true; - } -} - -if (!x) - throw "bad result: "+ x; diff --git a/implementation-contributed/javascriptcore/stress/ftl-library-inline-gettimezoneoffset.js b/implementation-contributed/javascriptcore/stress/ftl-library-inline-gettimezoneoffset.js deleted file mode 100644 index 8df8b128ca..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-library-inline-gettimezoneoffset.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(x, d){ - return x + d.getTimezoneOffset(); -} - -noInline(foo); - -var d = new Date(); -var expected = foo(0, d); -var count = 1000000; -var result = 0; -for (var i = 0 ; i < count; i++){ - result += foo(0, d); -} - -if (result != count * expected) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/ftl-library-inlining-exceptions-dataview.js b/implementation-contributed/javascriptcore/stress/ftl-library-inlining-exceptions-dataview.js deleted file mode 100644 index f41b9ce241..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-library-inlining-exceptions-dataview.js +++ /dev/null @@ -1,26 +0,0 @@ -function foo(d){ - return d.getInt8(42); -} - -noInline(foo); - -var d = new DataView(new ArrayBuffer(43)); -d.setInt8(42, 43); -for (var i = 0; i < 100000; ++i) { - var result = foo(d); - if (result != 43) - throw "Error: bad result: " + result; -} - -for (var i = 0; i < 10; ++i) { - var didThrow = false; - try { - foo(new DataView(new ArrayBuffer(42))); - } catch (e) { - didThrow = true; - if (e.message.indexOf("Out of bounds") < 0) - throw "Error: bad exception: " + e.message; - } - if (!didThrow) - throw "Error: did not throw"; -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-library-inlining-exceptions.js b/implementation-contributed/javascriptcore/stress/ftl-library-inlining-exceptions.js deleted file mode 100644 index 0b6516bca0..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-library-inlining-exceptions.js +++ /dev/null @@ -1,19 +0,0 @@ -function foo(d){ - return Date.prototype.getTimezoneOffset.call(d); -} - -noInline(foo); - -var x; -var count = 100000; -for (var i = 0 ; i < count; i++){ - try { - foo(i < count - 1000 ? new Date() : "a"); - x = false; - } catch (e) { - x = true; - } -} - -if (!x) - throw "bad result: "+ x; \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/ftl-library-inlining-loops.js b/implementation-contributed/javascriptcore/stress/ftl-library-inlining-loops.js deleted file mode 100644 index 160fcb954b..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-library-inlining-loops.js +++ /dev/null @@ -1,28 +0,0 @@ -function foo(){ - var count = 100; - var d = new DataView(new ArrayBuffer(count)); - - for (var i = 0; i < count / 4; i++){ - d.setInt32(i, i); - } - - for (var i = 0; i < count; i++){ - d.setInt8(i, i); - } - var result = 0; - for (var i = 0; i < count; i++){ - result += d.getInt8(i); - } - return result; -} - -noInline(foo); - -var r = 0; -for (var i = 0 ; i < 50000; i++){ - r += foo(); -} - -if (r != 247500000) - throw "Bad result: " + r; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-library-inlining-random.js b/implementation-contributed/javascriptcore/stress/ftl-library-inlining-random.js deleted file mode 100644 index 4b67803702..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-library-inlining-random.js +++ /dev/null @@ -1,11 +0,0 @@ -function foo(x){ - return Math.random(x); -} - -noInline(foo); - -var x = 0; - -for (var i = 0 ; i < 100000; i++){ - x = foo(i); -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-library-substring.js b/implementation-contributed/javascriptcore/stress/ftl-library-substring.js deleted file mode 100644 index 2bc0532e1d..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-library-substring.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo(i, x){ - return x.substring( 2 , 5); -} - -noInline(foo); - -var x = ""; - -for (var i = 0 ; i < 100000; i++){ - x = foo(i, "lkajsx"); -} - -if (x != "ajs") - throw "Error: bad substring: "+ x; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-negate-zero.js b/implementation-contributed/javascriptcore/stress/ftl-negate-zero.js deleted file mode 100644 index 516d851efa..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-negate-zero.js +++ /dev/null @@ -1,12 +0,0 @@ -function foo(x) { - return -x; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(0); - if (1 / result != "-Infinity") - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/ftl-new-negative-array-size.js b/implementation-contributed/javascriptcore/stress/ftl-new-negative-array-size.js deleted file mode 100644 index 16fdc9366b..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-new-negative-array-size.js +++ /dev/null @@ -1,20 +0,0 @@ -function foo(arg) { - try { - return new Array(arg); - } catch (e) { - return "error42"; - } -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(1); - if (result.length != 1) - throw "Error: bad result: " + result; -} - -var result = foo(-1); -if (result != "error42") - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-operation-exception-interesting-live-state.js b/implementation-contributed/javascriptcore/stress/ftl-operation-exception-interesting-live-state.js deleted file mode 100644 index 6f4ef2caf4..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-operation-exception-interesting-live-state.js +++ /dev/null @@ -1,63 +0,0 @@ -function foo(o, p) { - var x = 100; - var result = 101; - var pf = p.g; - try { - x = 102; - pf++; - result = o.f; - o = 104; - pf++; - x = 106; - } catch (e) { - return {outcome: "exception", values: [o, pf, x, result]}; - } - return {outcome: "return", values: [o, pf, x, result]}; -} - -noInline(foo); - -// Warm up foo() with polymorphic objects and non-object types. -for (var i = 0; i < 100000; ++i) { - var o; - var isObject = i & 1; - if (isObject) { - o = {f:107}; - o["i" + i] = i; // Make it polymorphic. - } else - o = 42; - var result = foo(o, {g:200}); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 202) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (isObject) { - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; - } else { - if (result.values[3] !== void 0) - throw "Error in loop: bad values[3]: " + result.values[3]; - } -} - -// Now throw an exception. -var result = foo(null, {g:300}); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 4) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== null) - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 301) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; -if (result.values[3] !== 101) - throw "Error at end: bad values[3]: " + result.values[3]; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-operation-exception-no-catch.js b/implementation-contributed/javascriptcore/stress/ftl-operation-exception-no-catch.js deleted file mode 100644 index 50ec2e4140..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-operation-exception-no-catch.js +++ /dev/null @@ -1,52 +0,0 @@ -function foo(o, p) { - var x = 100; - var result = 101; - x = 102; - p = 103; - result = o.f; - o = 104; - p = 105; - x = 106; - return {outcome: "return", values: [o, p, x, result]}; -} - -noInline(foo); - -// Warm up foo() with polymorphic objects and non-object types. -for (var i = 0; i < 100000; ++i) { - var o; - var isObject = i & 1; - if (isObject) { - o = {f:107}; - o["i" + i] = i; // Make it polymorphic. - } else - o = 42; - var result = foo(o); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 105) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (isObject) { - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; - } else { - if (result.values[3] !== void 0) - throw "Error in loop: bad values[3]: " + result.values[3]; - } -} - -// Now throw an exception. -var result; -try { - result = foo(null, 108); -} catch (e) { - result = {outcome: "exception"}; -} -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; diff --git a/implementation-contributed/javascriptcore/stress/ftl-operation-exception.js b/implementation-contributed/javascriptcore/stress/ftl-operation-exception.js deleted file mode 100644 index a63c33c722..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-operation-exception.js +++ /dev/null @@ -1,62 +0,0 @@ -function foo(o, p) { - var x = 100; - var result = 101; - try { - x = 102; - p = 103; - result = o.f; - o = 104; - p = 105; - x = 106; - } catch (e) { - return {outcome: "exception", values: [o, p, x, result]}; - } - return {outcome: "return", values: [o, p, x, result]}; -} - -noInline(foo); - -// Warm up foo() with polymorphic objects and non-object types. -for (var i = 0; i < 100000; ++i) { - var o; - var isObject = i & 1; - if (isObject) { - o = {f:107}; - o["i" + i] = i; // Make it polymorphic. - } else - o = 42; - var result = foo(o); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 4) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 105) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (isObject) { - if (result.values[3] !== 107) - throw "Error in loop: bad values[3]: " + result.values[3]; - } else { - if (result.values[3] !== void 0) - throw "Error in loop: bad values[3]: " + result.values[3]; - } -} - -// Now throw an exception. -var result = foo(null, 108); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 4) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== null) - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 103) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; -if (result.values[3] !== 101) - throw "Error at end: bad values[3]: " + result.values[3]; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-put-by-id-setter-exception-interesting-live-state.js b/implementation-contributed/javascriptcore/stress/ftl-put-by-id-setter-exception-interesting-live-state.js deleted file mode 100644 index 444fc6f408..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-put-by-id-setter-exception-interesting-live-state.js +++ /dev/null @@ -1,61 +0,0 @@ -function foo(o, p) { - var x = 100; - var result = 101; - var pf = p.g; - try { - x = 102; - pf++; - o.f = x + pf; - o = 104; - pf++; - x = 106; - } catch (e) { - return {outcome: "exception", values: [o, pf, x]}; - } - return {outcome: "return", values: [o, pf, x]}; -} - -noInline(foo); - -// Warm up foo() with polymorphic objects and getters. -for (var i = 0; i < 100000; ++i) { - var o = {}; - o.__defineSetter__("f", function(value) { - this._f = value; - }); - if (i & 1) - o["i" + i] = i; // Make it polymorphic. - var result = foo(o, {g:200}); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 3) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 202) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (o._f != 102 + 201) - throw "Error in loop: bad value of o._f: " + o._f; -} - -// Now throw an exception. -var o = {}; -o.__defineSetter__("f", function() { - throw "Error42"; -}); -var result = foo(o, {g:300}); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 3) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== o) - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 301) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; -if ("_f" in o) - throw "Error at end: o has _f."; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-put-by-id-setter-exception-no-catch.js b/implementation-contributed/javascriptcore/stress/ftl-put-by-id-setter-exception-no-catch.js deleted file mode 100644 index 278dcc9b72..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-put-by-id-setter-exception-no-catch.js +++ /dev/null @@ -1,54 +0,0 @@ -function foo(o, p) { - var x = 100; - var result = 101; - x = 102; - p = 103; - o.f = x + p; - o = 104; - p = 105; - x = 106; - return {outcome: "return", values: [o, p, x]}; -} - -noInline(foo); - -// Warm up foo() with polymorphic objects and getters. -for (var i = 0; i < 100000; ++i) { - var o = {}; - o.__defineSetter__("f", function(value) { - this._f = value; - }); - if (i & 1) - o["i" + i] = i; // Make it polymorphic. - var result = foo(o); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 3) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 105) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (o._f != 102 + 103) - throw "Error in loop: bad value of o._f: " + o._f; -} - -// Now throw an exception. -var result; -try { - var o = {}; - o.__defineSetter__("f", function() { - throw "Error42"; - }); - result = foo(o, 108); -} catch (e) { - if (e != "Error42") - throw "Error at end: bad exception: " + e; - result = {outcome: "exception"}; -} -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if ("_f" in o) - throw "Error at end: o has _f"; diff --git a/implementation-contributed/javascriptcore/stress/ftl-put-by-id-setter-exception.js b/implementation-contributed/javascriptcore/stress/ftl-put-by-id-setter-exception.js deleted file mode 100644 index ea1fa8b5b0..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-put-by-id-setter-exception.js +++ /dev/null @@ -1,60 +0,0 @@ -function foo(o, p) { - var x = 100; - var result = 101; - try { - x = 102; - p = 103; - o.f = x + p; - o = 104; - p = 105; - x = 106; - } catch (e) { - return {outcome: "exception", values: [o, p, x]}; - } - return {outcome: "return", values: [o, p, x]}; -} - -noInline(foo); - -// Warm up foo() with polymorphic objects and getters. -for (var i = 0; i < 100000; ++i) { - var o = {}; - o.__defineSetter__("f", function(value) { - this._f = value; - }); - if (i & 1) - o["i" + i] = i; // Make it polymorphic. - var result = foo(o); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 3) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 105) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (o._f != 102 + 103) - throw "Error in loop: bad value of o._f: " + o._f; -} - -// Now throw an exception. -var o = {}; -o.__defineSetter__("f", function() { - throw "Error42"; -}); -var result = foo(o, 108); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 3) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== o) - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 103) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; -if ("_f" in o) - throw "Error at end: o has _f."; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-put-by-id-slow-exception-interesting-live-state.js b/implementation-contributed/javascriptcore/stress/ftl-put-by-id-slow-exception-interesting-live-state.js deleted file mode 100644 index 6f59ed6c36..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-put-by-id-slow-exception-interesting-live-state.js +++ /dev/null @@ -1,56 +0,0 @@ -function foo(o, p) { - var x = 100; - var result = 101; - var pf = p.g; - try { - x = 102; - pf++; - o.f = x + pf; - o = 104; - pf++; - x = 106; - } catch (e) { - return {outcome: "exception", values: [o, pf, x]}; - } - return {outcome: "return", values: [o, pf, x]}; -} - -noInline(foo); - -// Warm up foo() with polymorphic objects and getters. -for (var i = 0; i < 100000; ++i) { - var o = {}; - if (i & 1) - o["i" + i] = i; // Make it polymorphic. - var result = foo(o, {g:200}); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 3) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 202) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (o.f != 102 + 201) - throw "Error in loop: bad value of o.f: " + o.f; -} - -// Now throw an exception. -var o = {}; -o.__defineSetter__("f", function() { - throw "Error42"; -}); -var result = foo(o, {g:300}); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 3) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== o) - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 301) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-put-by-id-slow-exception-no-catch.js b/implementation-contributed/javascriptcore/stress/ftl-put-by-id-slow-exception-no-catch.js deleted file mode 100644 index ed8d492e96..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-put-by-id-slow-exception-no-catch.js +++ /dev/null @@ -1,51 +0,0 @@ -function foo(o, p) { - var x = 100; - var result = 101; - var pf = p.g; - x = 102; - pf++; - o.f = x + pf; - o = 104; - pf++; - x = 106; - return {outcome: "return", values: [o, pf, x]}; -} - -noInline(foo); - -// Warm up foo() with polymorphic objects and getters. -for (var i = 0; i < 100000; ++i) { - var o = {}; - if (i & 1) - o["i" + i] = i; // Make it polymorphic. - var result = foo(o, {g:200}); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 3) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 202) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (o.f != 102 + 201) - throw "Error in loop: bad value of o.f: " + o.f; -} - -// Now throw an exception. -var result; -try { - var o = {}; - o.__defineSetter__("f", function() { - throw "Error42"; - }); - result = foo(o, {g:300}); -} catch (e) { - if (e != "Error42") - throw "Error at end: bad exception: " + e; - result = {outcome: "exception"}; -} -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-put-by-id-slow-exception.js b/implementation-contributed/javascriptcore/stress/ftl-put-by-id-slow-exception.js deleted file mode 100644 index 3e1bb88a01..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-put-by-id-slow-exception.js +++ /dev/null @@ -1,55 +0,0 @@ - function foo(o, p) { - var x = 100; - var result = 101; - try { - x = 102; - p = 103; - o.f = x + p; - o = 104; - p = 105; - x = 106; - } catch (e) { - return {outcome: "exception", values: [o, p, x]}; - } - return {outcome: "return", values: [o, p, x]}; -} - -noInline(foo); - -// Warm up foo() with polymorphic objects and getters. -for (var i = 0; i < 100000; ++i) { - var o = {}; - if (i & 1) - o["i" + i] = i; // Make it polymorphic. - var result = foo(o); - if (result.outcome !== "return") - throw "Error in loop: bad outcome: " + result.outcome; - if (result.values.length !== 3) - throw "Error in loop: bad number of values: " + result.values.length; - if (result.values[0] !== 104) - throw "Error in loop: bad values[0]: " + result.values[0]; - if (result.values[1] !== 105) - throw "Error in loop: bad values[1]: " + result.values[1]; - if (result.values[2] !== 106) - throw "Error in loop: bad values[2]: " + result.values[2]; - if (o.f != 102 + 103) - throw "Error in loop: bad value of o.f: " + o.f; -} - -// Now throw an exception. -var o = {}; -o.__defineSetter__("f", function() { - throw "Error42"; -}); -var result = foo(o, 108); -if (result.outcome !== "exception") - throw "Error at end: bad outcome: " + result.outcome; -if (result.values.length !== 3) - throw "Error at end: bad number of values: " + result.values.length; -if (result.values[0] !== o) - throw "Error at end: bad values[0]: " + result.values[0]; -if (result.values[1] !== 103) - throw "Error at end: bad values[1]: " + result.values[1]; -if (result.values[2] !== 102) - throw "Error at end: bad values[2]: " + result.values[2]; - diff --git a/implementation-contributed/javascriptcore/stress/ftl-putbyid.js b/implementation-contributed/javascriptcore/stress/ftl-putbyid.js deleted file mode 100644 index 9dfd9e4be6..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-putbyid.js +++ /dev/null @@ -1,13 +0,0 @@ - -Object.prototype.__defineSetter__("r", function(val){ o = val }) - -function foo(x){ - var n = { } - n.r = x; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) - foo(i); - diff --git a/implementation-contributed/javascriptcore/stress/ftl-putbyiddirect.js b/implementation-contributed/javascriptcore/stress/ftl-putbyiddirect.js deleted file mode 100644 index b50ad0dcb2..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-putbyiddirect.js +++ /dev/null @@ -1,12 +0,0 @@ -function foo(x){ - return { 0 : 1 , a : x } -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) - o = foo(i); - -if (o.a != 99999 || o[0] != 1) - throw "Error" - diff --git a/implementation-contributed/javascriptcore/stress/ftl-reallocatepropertystorage.js b/implementation-contributed/javascriptcore/stress/ftl-reallocatepropertystorage.js deleted file mode 100644 index ddebc8e9a3..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-reallocatepropertystorage.js +++ /dev/null @@ -1,28 +0,0 @@ -function foo(x){ - x.a0 = 0; - x.a1 = 1; - x.a2 = 2; - x.a3 = 3; - x.a4 = 4; - x.a5 = 5; - x.a6 = 6; - x.a7 = 7; - x.a8 = 8; - x.a9 = 9; - x.a10 = 10; -} - -noInline(foo); - -var c = {}; -for (var i = 0; i < 100000; ++i) { - var b = {}; - foo(b); - c = b; -} - -for (var j = 0; j <= 10 ; ++j) - if (c['a'+j] != j) - throw "Error "+c['a'+j]; - - diff --git a/implementation-contributed/javascriptcore/stress/ftl-regexp-exec.js b/implementation-contributed/javascriptcore/stress/ftl-regexp-exec.js deleted file mode 100644 index 03149a9d71..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-regexp-exec.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo(s) { - return /foo/.exec(s); -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo("foo"); - if (!result) - throw "Error: bad result for foo"; - if (result.length != 1) - throw "Error: bad result for foo: " + result; - if (result[0] != "foo") - throw "Error: bad result for foo: " + result; - if (foo("bar")) - throw "Error: bad result for bar"; -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-regexp-test.js b/implementation-contributed/javascriptcore/stress/ftl-regexp-test.js deleted file mode 100644 index da377a1ad7..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-regexp-test.js +++ /dev/null @@ -1,12 +0,0 @@ -function foo(s) { - return /foo/.test(s); -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - if (!foo("foo")) - throw "Error: bad result for foo"; - if (foo("bar")) - throw "Error: bad result for bar"; -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-shr-exception.js b/implementation-contributed/javascriptcore/stress/ftl-shr-exception.js deleted file mode 100644 index 5003d7ffd3..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-shr-exception.js +++ /dev/null @@ -1,19 +0,0 @@ -function foo(a, b) { - try { - return a >> b; - } catch (e) { - return e; - } -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo((i & 1) ? 32 : "32", 2); - if (result !== 8) - throw "Error: bad result: " + result; -} - -var result = foo({valueOf: function() { throw "error42"; }}, 2); -if (result !== "error42") - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/ftl-string-equality.js b/implementation-contributed/javascriptcore/stress/ftl-string-equality.js deleted file mode 100644 index 3f803e6dce..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-string-equality.js +++ /dev/null @@ -1,35 +0,0 @@ -function makeString(char) { - var result = ""; - for (var i = 0; i < 10; ++i) - result += char; - return result; -} - -var array = [ "a", "b", "c", "d" ]; - -for (var i = 0; i < array.length; ++i) - array[i] = makeString(array[i]); - -function foo(array, s) { - for (var i = 0; i < array.length; ++i) { - if (array[i] == s) - return i; - } - return null; -} - -noInline(foo); - -var array2 = [ "a", "b", "c", "d", "e" ]; - -for (var i = 0; i < array2.length; ++i) - array2[i] = makeString(array2[i]); - -for (var i = 0; i < 100000; ++i) { - var index = i % array2.length; - var result = foo(array, array2[index]); - var expected = index >= array.length ? null : index - if (result !== expected) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/ftl-string-ident-equality.js b/implementation-contributed/javascriptcore/stress/ftl-string-ident-equality.js deleted file mode 100644 index ccb36d839d..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-string-ident-equality.js +++ /dev/null @@ -1,18 +0,0 @@ -var array = [ "a", "b", "c", "d" ]; - -function foo(array, s) { - for (var i = 0; i < array.length; ++i) { - if (array[i] == s) - return true; - } - return false; -} - -noInline(foo); - -var result = 0; -for (var i = 0; i < 100000; ++i) - result += foo(array, "d"); - -if (result != 100000) - throw "Bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/ftl-string-strict-equality.js b/implementation-contributed/javascriptcore/stress/ftl-string-strict-equality.js deleted file mode 100644 index 043a7607a4..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-string-strict-equality.js +++ /dev/null @@ -1,35 +0,0 @@ -function makeString(char) { - var result = ""; - for (var i = 0; i < 10; ++i) - result += char; - return result; -} - -var array = [ "a", "b", "c", "d" ]; - -for (var i = 0; i < array.length; ++i) - array[i] = makeString(array[i]); - -function foo(array, s) { - for (var i = 0; i < array.length; ++i) { - if (array[i] === s) - return i; - } - return null; -} - -noInline(foo); - -var array2 = [ "a", "b", "c", "d", "e" ]; - -for (var i = 0; i < array2.length; ++i) - array2[i] = makeString(array2[i]); - -for (var i = 0; i < 100000; ++i) { - var index = i % array2.length; - var result = foo(array, array2[index]); - var expected = index >= array.length ? null : index - if (result !== expected) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/ftl-sub-exception.js b/implementation-contributed/javascriptcore/stress/ftl-sub-exception.js deleted file mode 100644 index 6fb3471d9d..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-sub-exception.js +++ /dev/null @@ -1,19 +0,0 @@ -function foo(a, b) { - try { - return a - b; - } catch (e) { - return e; - } -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo((i & 1) ? 32 : "32", 10); - if (result !== 22) - throw "Error: bad result: " + result; -} - -var result = foo({valueOf: function() { throw "error42"; }}, 10); -if (result !== "error42") - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/ftl-switch-string-slow-duplicate-cases.js b/implementation-contributed/javascriptcore/stress/ftl-switch-string-slow-duplicate-cases.js deleted file mode 100644 index ec9db4cdf5..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-switch-string-slow-duplicate-cases.js +++ /dev/null @@ -1,31 +0,0 @@ -function foo(s) { - switch (s) { - case "ƑẦÇÅ": - case "ÌŅ": - case "ṤĻÅâ±²": - case "ṔÄȚĦ": - return 42; - case "due": - case "to": - case "16-bit": - case "strings": - return 43; - default: - return 44; - } -} - -noInline(foo); - -function cat(a, b) { - return a + b; -} - -for (var i = 0; i < 10000; ++i) { - var result = foo(cat("16-", "bit")); - if (result != 43) - throw "Error: bad result (1): " + result; - result = foo("ƑẦÇÅ"); - if (result != 42) - throw "Error: bad result (2): " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-tail-call-throw-exception-from-slow-path-recover-stack-values.js b/implementation-contributed/javascriptcore/stress/ftl-tail-call-throw-exception-from-slow-path-recover-stack-values.js deleted file mode 100644 index c2cbaa82da..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-tail-call-throw-exception-from-slow-path-recover-stack-values.js +++ /dev/null @@ -1,31 +0,0 @@ -var theParent = function () { }; - -function test1() { - var base = class C extends theParent { - static getParentStaticValue() { - let arrow = (a,b,c) => super.getStaticValue(a,b,c); - return arrow(1,1,1); - } - }; - - for (let i = 0; i < 10000; i++) { - try { base.getParentStaticValue() } catch (e) {} - try { base.getParentStaticValue() } catch (e) {} - } -} -test1(); - -function test2() { - var base = class C extends theParent { - static getParentStaticValue() { - let arrow = () => super.getStaticValue(); - return arrow(); - } - }; - - for (let i = 0; i < 10000; i++) { - try { base.getParentStaticValue() } catch (e) {} - try { base.getParentStaticValue() } catch (e) {} - } -} -test2(); diff --git a/implementation-contributed/javascriptcore/stress/ftl-tail-call.js b/implementation-contributed/javascriptcore/stress/ftl-tail-call.js deleted file mode 100644 index c78269e368..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-tail-call.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; - -function foo(a, b, c) { - return a + b * 2 + c * 3; -} - -noInline(foo); - -function bar(a, b, c) { - return foo(a.f, b.g, c.h); -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var result = bar({f: 4}, {g: 5}, {h: 6}); - if (result != 4 + 5 * 2 + 6 * 3) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/ftl-to-ftl-arity-fixup.js b/implementation-contributed/javascriptcore/stress/ftl-to-ftl-arity-fixup.js deleted file mode 100644 index 19b9c9a106..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-to-ftl-arity-fixup.js +++ /dev/null @@ -1,36 +0,0 @@ -function foo(a, b, c) { - return (a|0) + (b|0) + (c|0); -} - -function bar(o) { - // Save a bunch of state in local variables. - var a = o.f; - var b = o.g; - var c = o.h; - var d = o.i; - var e = o.j; - var f = o.k; - var g = o.l; - // Make a call that will be subject to arity fixup and then use the saved state. We're - // counting on LLVM to put those variables in callee-saves, since that's pretty much the - // only sensible choice. - return foo(42) + a + b + c + d + e + f + g; -} - -noInline(foo); -noInline(bar); - -for (var i = 0; i < 100000; ++i) { - // Call bar() in such a way that all of those callee-save variables have fairly unique - // looking values, to maximize the chances of foo() clobbering them in a recognizable - // way. - var result = bar({ - f:i * 3, g:i - 1, h:(i / 2)|0, i:-i, j:13 + ((i / 5)|0), k:14 - ((i / 6)|0), - l:1 - i}); - - var expected = 42 + i * 3 + i - 1 + ((i / 2)|0) - i + 13 + ((i / 5)|0) + 14 - - ((i / 6)|0) + 1 - i; - - if (result != expected) - throw "Error: for iteration " + i + " expected " + expected + " but got " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-try-catch-arith-sub-exception.js b/implementation-contributed/javascriptcore/stress/ftl-try-catch-arith-sub-exception.js deleted file mode 100644 index c6c7185e59..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-try-catch-arith-sub-exception.js +++ /dev/null @@ -1,59 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("uh oh"); -} - -let flag = false; -let o = { - valueOf() { - if (flag) - throw new Error("by by"); - return 13.5; - } -}; -noInline(o.valueOf); - -function baz() { return 1.5; } -noInline(baz); - -function foo(x, o) { - let r = baz(); - try { - r = x - o - r; - } catch(e) { } - return r; -} -noInline(foo); - -let x = 20.5; -for (let i = 0; i < 10000; i++) { - assert(foo(x, o) === 5.5); -} -flag = true; -assert(foo(x, o) === 1.5); - - -function bar(x, o) { - let caughtException = false; - var r = null; - try { - // This tests aliasing of left/right with result register in a SubGenerator - // and ensures that the sub will spill the register properly and that we value - // recover properly. - r = x - o; - } catch(e) { - caughtException = true; - assert(r === null); - } - if (!caughtException) - assert(r === 7); - return caughtException; -} -noInline(bar); - -flag = false; -for (let i = 0; i < 10000; i++) { - assert(bar(x, o) === false); -} -flag = true; -assert(bar(x, o) === true); diff --git a/implementation-contributed/javascriptcore/stress/ftl-try-catch-getter-ic-fail-to-call-operation-throw-error.js b/implementation-contributed/javascriptcore/stress/ftl-try-catch-getter-ic-fail-to-call-operation-throw-error.js deleted file mode 100644 index 08c99b8b88..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-try-catch-getter-ic-fail-to-call-operation-throw-error.js +++ /dev/null @@ -1,49 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("bad value") -} -noInline(assert); - -let oThrow = { - x: 20, - y: 40, - z: 50, - get f() { throw new Error("Hello World!"); } -}; - -let o1 = { - x: 20, - f: 40 -}; - -let o2 = { - x: 20, - y: 50, - get f() { return 20; } -}; - -function foo(f) { - let o = f(); - try { - o = o.f; - } catch(e) { - assert(o === oThrow); // Make sure this is not undefined when we have an IC miss and an exception at the same time. - } -} -noInline(foo); - -let i; -let flag = false; -function f() { - if (flag) - return oThrow; - if (i % 2) - return o1; - return o2; -} -noInline(f); -for (i = 0; i < 100000; i++) { - foo(f); -} -flag = true; -foo(f); diff --git a/implementation-contributed/javascriptcore/stress/ftl-try-catch-getter-throw-interesting-value-recovery.js b/implementation-contributed/javascriptcore/stress/ftl-try-catch-getter-throw-interesting-value-recovery.js deleted file mode 100644 index 79014a7d19..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-try-catch-getter-throw-interesting-value-recovery.js +++ /dev/null @@ -1,65 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("bad value") -} -noInline(assert); - -function random() { - return "blah"; -} -noInline(random); - -function identity(x) { - return x; -} -noInline(identity); - -let o1 = { - g: 20, - y: 40, - f: "get f" -}; - -let o2 = { - g: "g", - y: "y", - get f() { - return "get f"; - } -} - -let o4 = {}; - -let o3 = { - get f() { - throw new Error("blah"); - } -} - -function foo(o, a) { - let x = o.g; - let y = o.y; - let oo = identity(o); - let j = random(); - try { - j = o.f; - } catch(e) { - assert(j === "blah"); - assert(oo === o3); - return x + y + 1; - } - return x + y; -} - -noInline(foo); -for (let i = 0; i < 100000; i++) { - if (i % 3 == 0) { - assert(foo(o1) === 60); - } else if (i % 3 === 1) { - assert(foo(o2) === "gy"); - } else { - foo(o4); - } -} - -foo(o3); diff --git a/implementation-contributed/javascriptcore/stress/ftl-try-catch-getter-throw.js b/implementation-contributed/javascriptcore/stress/ftl-try-catch-getter-throw.js deleted file mode 100644 index 586a20a8d9..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-try-catch-getter-throw.js +++ /dev/null @@ -1,57 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("bad value") -} -noInline(assert); - -function random() { - return "blah"; -} -noInline(random); - -function foo(o, a) { - let x = o.g; - let y = o.y; - let j = random(); - try { - j = o.f; - } catch(e) { - assert(j === "blah"); - return x + y + 1; - } - return x + y; -} - -noInline(foo); -var flag = false; -function f(arg1, arg2, arg3) { - if (flag) - throw new Error("blah") - return arg1; -} -noInline(f); -let o1 = { - g: 20, - y: 40, - f: "get f" -}; - -let o2 = { - g: "g", - y: "y", - get f() { - if (flag) - throw new Error("blah"); - return "get f"; - } -} - -for (let i = 0; i < 100000; i++) { - if (i % 2) { - assert(foo(o1) === 60); - } else { - assert(foo(o2) === "gy"); - } -} -flag = true; -assert(foo(o2) === "gy1"); diff --git a/implementation-contributed/javascriptcore/stress/ftl-try-catch-oom-error-lazy-slow-path.js b/implementation-contributed/javascriptcore/stress/ftl-try-catch-oom-error-lazy-slow-path.js deleted file mode 100644 index a8f2b18d17..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-try-catch-oom-error-lazy-slow-path.js +++ /dev/null @@ -1,69 +0,0 @@ -forceGCSlowPaths(); // Force OOM error in FTL MakeRope to happen in a lazy slow path. - -function assert(b) { - if (!b) - throw new Error("Bad assertion"); -} - -function a() { return "a"; } -noInline(a); -function b() { return "b"; } -noInline(b); -function c() { return "c"; } -noInline(c); -function d() { return "d"; } -noInline(d); -function e() { return "e"; } -noInline(e); -function f() { return "f"; } -noInline(f); -function g() { return "g"; } -noInline(g); - -let expString = "a"; -let exponentialBlowup = false; -let shouldBreak = false; -function foo(fun, left, right) { - let x = fun(); - let r = left + right; - - var _a = a(); - var _b = b(); - var _c = c(); - var _d = d(); - var _e = e(); - var _f = f(); - var _g = g(); - try { - expString = expString + expString; - } catch(e) { - shouldBreak = true; - - assert(_b === "b"); - assert(_c === "c"); - assert(_d === "d"); - assert(_e === "e"); - assert(_f === "f"); - assert(_g === "g"); - } - return x + r; -} -noInline(foo); - - - -function blah() { return "blah"; } -noInline(blah); - -for (let i = 0; i < 100000; i++) { - assert(foo(blah, "b", "a") === "blahba"); - if (!exponentialBlowup) - expString = "a"; -} - -exponentialBlowup = true; -while (true) { - assert(foo(blah, "a", "b") === "blahab"); - if (shouldBreak) - break; -} diff --git a/implementation-contributed/javascriptcore/stress/ftl-try-catch-patchpoint-with-volatile-registers.js b/implementation-contributed/javascriptcore/stress/ftl-try-catch-patchpoint-with-volatile-registers.js deleted file mode 100644 index 753f21fd5a..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-try-catch-patchpoint-with-volatile-registers.js +++ /dev/null @@ -1,73 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad value.") -} -noInline(assert); - -var v1 = 100; -var v2 = 200; -var flag = false; -var o1 = { - get f() { - if (flag) - throw new Error("gotcha!"); - return v1; - } -} - -function a() { return "a"; } -noInline(a); -function b() { return "b"; } -noInline(b); -function c() { return "c"; } -noInline(c); -function d() { return "d"; } -noInline(d); -function e() { return "e"; } -noInline(e); -function f() { return "f"; } -noInline(f); -function g() { return "g"; } -noInline(g); - -var o2 = { - get f() { - assert(true); - assert(true); - assert(true); - assert(true); - assert(true); - assert(true); - assert(true); - return v2; - } -} - -function foo(o) { - try { - var _a = a(); - var _b = b(); - var _c = c(); - var _d = d(); - var _e = e(); - var _f = f(); - var _g = g(); - - o = o.f; - - } catch(e) { - assert(o === o1); - assert(_b === "b"); - assert(_c === "c"); - assert(_d === "d"); - assert(_e === "e"); - assert(_f === "f"); - assert(_g === "g"); - } -} -noInline(foo); - -for (var i = 0; i < 1000000; i++) - foo(i % 2 ? o1 : o2); -flag = true; -foo(o1); diff --git a/implementation-contributed/javascriptcore/stress/ftl-try-catch-setter-throw.js b/implementation-contributed/javascriptcore/stress/ftl-try-catch-setter-throw.js deleted file mode 100644 index ae347d1792..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-try-catch-setter-throw.js +++ /dev/null @@ -1,46 +0,0 @@ -function foo(o, a) { - let x = o.g; - let y = o.y; - try { - o.f = 20; - } catch(e) { - return x + y + 1; - } - return x + y; -} - -function assert(b) { - if (!b) - throw new Error("bad value") -} -noInline(assert); - -noInline(foo); -var flag = false; -function f(arg1, arg2, arg3) { - if (flag) - throw new Error("blah") - return arg1; -} -noInline(f); -let o1 = { - g: 20, - y: 40, - f: null -}; - -let o2 = { - g: "g", - y: "y", - set f(v) { if (flag) throw new Error("blah"); } -} - -for (let i = 0; i < 100000; i++) { - if (i % 2) { - assert(foo(o1) === 60); - } else { - assert(foo(o2) === "gy"); - } -} -flag = true; -assert(foo(o2) === "gy1"); diff --git a/implementation-contributed/javascriptcore/stress/ftl-try-catch-tail-call-inilned-caller.js b/implementation-contributed/javascriptcore/stress/ftl-try-catch-tail-call-inilned-caller.js deleted file mode 100644 index 3dfd0a66e2..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-try-catch-tail-call-inilned-caller.js +++ /dev/null @@ -1,60 +0,0 @@ -// This test ensures the TailCallInilnedCaller has the correct -// stack trace in the FTL inside a try block. -// This case arises when you have a situation like this: -// foo makes a call to bar, bar is inlined in foo. bar makes a call -// to baz and baz is inlined in bar. And then baz makes a tail-call to jaz, -// and jaz is inlined in baz. We want the callframe for jaz to appear to -// have caller be bar. - - -"use strict"; -function value() { - return "value"; -} -noInline(value); - -function assert(b) { - if (!b) - throw new Error("bad value"); -} -noInline(assert); - -function validate(stack) { - let arr = stack.split("\n"); - assert(arr[0].indexOf("jaz") !== -1); - assert(arr[1].indexOf("bar") !== -1); - assert(arr[2].indexOf("foo") !== -1); -} - -function foo() { - let v = value(); - try { - return bar() + 1; - } catch(e) { - assert(v === "value"); - validate(e.stack); - } -} -noInline(foo); - -function bar() { - return baz() + 1; -} - -function baz() { - return jaz(); -} - -let flag = false; -function jaz() { - if (flag) - throw new Error("lol"); - return 20; -} -noInline(jaz); - -for (var i = 0; i < 50000; i++) { - foo(); -} -flag = true; -foo(); diff --git a/implementation-contributed/javascriptcore/stress/ftl-try-catch-varargs-call-throws.js b/implementation-contributed/javascriptcore/stress/ftl-try-catch-varargs-call-throws.js deleted file mode 100644 index 6cf84454d3..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-try-catch-varargs-call-throws.js +++ /dev/null @@ -1,32 +0,0 @@ -function foo(o, a) { - let resetFlag = false; - if (flag) { - resetFlag = true; - flag = false; - } - let x = o(10); - let y = o(20); - if (resetFlag) - flag = true; - try { - o.apply(null, a); - } catch(e) { - if (x !== 10) - throw new Error("Not 10") - return x + y; - } -} -noInline(foo); -var flag = false; -function f(arg1, arg2, arg3) { - if (flag) - throw new Error("blah") - return arg1; -} -noInline(f); - -for (let i = 0; i < 100000; i++) { - foo(f, [10, 20, 30]); -} -flag = true; -foo(f, [10, 20, 30]); diff --git a/implementation-contributed/javascriptcore/stress/ftl-xor-exception.js b/implementation-contributed/javascriptcore/stress/ftl-xor-exception.js deleted file mode 100644 index 0038b5b8d2..0000000000 --- a/implementation-contributed/javascriptcore/stress/ftl-xor-exception.js +++ /dev/null @@ -1,19 +0,0 @@ -function foo(a, b) { - try { - return a ^ b; - } catch (e) { - return e; - } -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo((i & 1) ? 32 : "32", 10); - if (result !== 42) - throw "Error: bad result: " + result; -} - -var result = foo({valueOf: function() { throw "error42"; }}, 10); -if (result !== "error42") - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/generator-and-super.js b/implementation-contributed/javascriptcore/stress/generator-and-super.js deleted file mode 100644 index 5ed52408f5..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-and-super.js +++ /dev/null @@ -1,42 +0,0 @@ -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -testSyntaxError(` -class Base { - hello() - { - print("Hello"); - } - - *ok() - { - super.hello(); - } -} - -class Hello extends Base { - *gen() - { - super(); - } -} -`, `SyntaxError: super is not valid in this context.`); - - -testSyntaxError(` -function *hello() -{ - super.hello(); -} -`, `SyntaxError: super is not valid in this context.`); diff --git a/implementation-contributed/javascriptcore/stress/generator-arguments-from-function.js b/implementation-contributed/javascriptcore/stress/generator-arguments-from-function.js deleted file mode 100644 index 7ca587907c..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-arguments-from-function.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function *gen(a, b, c) -{ - function test() - { - return arguments; - } - - return test; -} - -let g = gen(1, 2, 3); -let {value: func} = g.next(); -shouldBe(func().length, 0); diff --git a/implementation-contributed/javascriptcore/stress/generator-arguments.js b/implementation-contributed/javascriptcore/stress/generator-arguments.js deleted file mode 100644 index b26478fa23..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-arguments.js +++ /dev/null @@ -1,107 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -(function () { - function *g1(a, b, c) - { - yield arguments; - yield arguments; - } - - var g = g1(0, 1, 2); - shouldBe(JSON.stringify(g.next().value), `{"0":0,"1":1,"2":2}`); - shouldBe(JSON.stringify(g.next().value), `{"0":0,"1":1,"2":2}`); - - function *g2(a, b, c) - { - yield arguments; - yield arguments; - a = yield a; - yield arguments; - b = yield b; - yield arguments; - c = yield c; - yield arguments; - } - var g = g2(0, 1, 2); - shouldBe(JSON.stringify(g.next().value), `{"0":0,"1":1,"2":2}`); - shouldBe(JSON.stringify(g.next().value), `{"0":0,"1":1,"2":2}`); - shouldBe(g.next().value, 0); - shouldBe(JSON.stringify(g.next(42).value), `{"0":42,"1":1,"2":2}`); - shouldBe(g.next().value, 1); - shouldBe(JSON.stringify(g.next(42).value), `{"0":42,"1":42,"2":2}`); - shouldBe(g.next().value, 2); - shouldBe(JSON.stringify(g.next(42).value), `{"0":42,"1":42,"2":42}`); -}()); - -(function () { - function *g1(a, b, c) - { - "use strict"; - yield arguments; - yield arguments; - } - - var g = g1(0, 1, 2); - shouldBe(JSON.stringify(g.next().value), `{"0":0,"1":1,"2":2}`); - shouldBe(JSON.stringify(g.next().value), `{"0":0,"1":1,"2":2}`); - - function *g2(a, b, c) - { - "use strict"; - yield arguments; - yield arguments; - a = yield a; - yield arguments; - b = yield b; - yield arguments; - c = yield c; - yield arguments; - } - var g = g2(0, 1, 2); - shouldBe(JSON.stringify(g.next().value), `{"0":0,"1":1,"2":2}`); - shouldBe(JSON.stringify(g.next().value), `{"0":0,"1":1,"2":2}`); - shouldBe(g.next().value, 0); - shouldBe(JSON.stringify(g.next(42).value), `{"0":0,"1":1,"2":2}`); - shouldBe(g.next().value, 1); - shouldBe(JSON.stringify(g.next(42).value), `{"0":0,"1":1,"2":2}`); - shouldBe(g.next().value, 2); - shouldBe(JSON.stringify(g.next(42).value), `{"0":0,"1":1,"2":2}`); -}()); - -(function () { - "use strict"; - function *g1(a, b, c) - { - yield arguments; - yield arguments; - } - - var g = g1(0, 1, 2); - shouldBe(JSON.stringify(g.next().value), `{"0":0,"1":1,"2":2}`); - shouldBe(JSON.stringify(g.next().value), `{"0":0,"1":1,"2":2}`); - - function *g2(a, b, c) - { - yield arguments; - yield arguments; - a = yield a; - yield arguments; - b = yield b; - yield arguments; - c = yield c; - yield arguments; - } - var g = g2(0, 1, 2); - shouldBe(JSON.stringify(g.next().value), `{"0":0,"1":1,"2":2}`); - shouldBe(JSON.stringify(g.next().value), `{"0":0,"1":1,"2":2}`); - shouldBe(g.next().value, 0); - shouldBe(JSON.stringify(g.next(42).value), `{"0":0,"1":1,"2":2}`); - shouldBe(g.next().value, 1); - shouldBe(JSON.stringify(g.next(42).value), `{"0":0,"1":1,"2":2}`); - shouldBe(g.next().value, 2); - shouldBe(JSON.stringify(g.next(42).value), `{"0":0,"1":1,"2":2}`); -}()); diff --git a/implementation-contributed/javascriptcore/stress/generator-class-methods-syntax.js b/implementation-contributed/javascriptcore/stress/generator-class-methods-syntax.js deleted file mode 100644 index 2a8a0ce9c7..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-class-methods-syntax.js +++ /dev/null @@ -1,48 +0,0 @@ -function testSyntax(script) { - try { - eval(script); - } catch (error) { - if (error instanceof SyntaxError) - throw new Error("Bad error: " + String(error)); - } -} - -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -testSyntaxError(` -class Cocoa { - *constructor() - { - } -} -`, `SyntaxError: Cannot declare a generator function named 'constructor'.`); - -testSyntax(` -class Cocoa { - *ok() - { - yield 42; - } -} -`); - -testSyntax(` -class Cocoa { - static *ok() - { - yield 42; - } -} -`); diff --git a/implementation-contributed/javascriptcore/stress/generator-class-methods.js b/implementation-contributed/javascriptcore/stress/generator-class-methods.js deleted file mode 100644 index 21f5a54a2d..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-class-methods.js +++ /dev/null @@ -1,62 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -class A { - *gen() - { - yield this; - yield this; - return 42; - } - - static *staticGen() - { - yield this; - yield this; - return 42; - } -} -{ - let a = new A(); - let g = a.gen(); - shouldBe(g.next().value, a); - shouldBe(g.next().value, a); - shouldBe(g.next().value, 42); - shouldBe(g.next().done, true); -} -{ - let a = new A(); - shouldThrow(() => { - let g = new a.gen(); - }, `TypeError: function is not a constructor (evaluating 'new a.gen()')`); -} - -{ - let g = A.staticGen(); - shouldBe(g.next().value, A); - shouldBe(g.next().value, A); - shouldBe(g.next().value, 42); - shouldBe(g.next().done, true); -} -{ - shouldThrow(() => { - let g = new A.staticGen(); - }, `TypeError: function is not a constructor (evaluating 'new A.staticGen()')`); -} diff --git a/implementation-contributed/javascriptcore/stress/generator-eval-this.js b/implementation-contributed/javascriptcore/stress/generator-eval-this.js deleted file mode 100644 index f5766def74..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-eval-this.js +++ /dev/null @@ -1,65 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -function *gen() { - yield eval("this"); -} - -shouldThrow(() => { - var g = new gen(); - g.next().value; -}, `TypeError: function is not a constructor (evaluating 'new gen()')`); - -class B { } - -(function() { - eval('this'); - eval('this'); -}()); - -class A extends B { - constructor() - { - return eval('this'); - } -} - -shouldThrow(() => { - new A(); -}, `ReferenceError: Cannot access uninitialized variable.`); - -class C { - *generator() - { - yield eval('this'); - } -} - -shouldThrow(() => { - let c = new C(); - let g = new c.generator(); - g.next(); -}, `TypeError: function is not a constructor (evaluating 'new c.generator()')`); - -(function () { - let c = new C(); - let g = c.generator(); - shouldBe(g.next().value, c); -}()); diff --git a/implementation-contributed/javascriptcore/stress/generator-fib-ftl-and-array.js b/implementation-contributed/javascriptcore/stress/generator-fib-ftl-and-array.js deleted file mode 100644 index fe939812fd..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-fib-ftl-and-array.js +++ /dev/null @@ -1,23 +0,0 @@ -(function () { - function *fib() - { - let a = 1; - let b = 1; - let c = [ 0 ]; - while (true) { - c[0] = a; - yield c; - [a, b] = [b, a + b]; - } - } - - let value = 0; - for (let i = 0; i < 1e4; ++i) { - let f = fib(); - for (let i = 0; i < 100; ++i) { - value = f.next().value; - } - if (value[0] !== 354224848179262000000) - throw new Error(`bad value:${result}`); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/generator-fib-ftl-and-object.js b/implementation-contributed/javascriptcore/stress/generator-fib-ftl-and-object.js deleted file mode 100644 index 667340f2ea..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-fib-ftl-and-object.js +++ /dev/null @@ -1,23 +0,0 @@ -(function () { - function *fib() - { - let a = 1; - let b = 1; - let c = { fib: 0 }; - while (true) { - c.fib = a; - yield c; - [a, b] = [b, a + b]; - } - } - - let value = 0; - for (let i = 0; i < 1e4; ++i) { - let f = fib(); - for (let i = 0; i < 100; ++i) { - value = f.next().value; - } - if (value.fib !== 354224848179262000000) - throw new Error(`bad value:${result}`); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/generator-fib-ftl-and-string.js b/implementation-contributed/javascriptcore/stress/generator-fib-ftl-and-string.js deleted file mode 100644 index 438ae6ab33..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-fib-ftl-and-string.js +++ /dev/null @@ -1,22 +0,0 @@ -(function () { - function *fib() - { - let a = 1; - let b = 1; - let c = "Result! "; - while (true) { - yield c + a; - [a, b] = [b, a + b]; - } - } - - let value = 0; - for (let i = 0; i < 1e4; ++i) { - let f = fib(); - for (let i = 0; i < 100; ++i) { - value = f.next().value; - } - if (value !== `Result! 354224848179262000000`) - throw new Error(`bad value:${result}`); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/generator-fib-ftl.js b/implementation-contributed/javascriptcore/stress/generator-fib-ftl.js deleted file mode 100644 index 340e33dbc8..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-fib-ftl.js +++ /dev/null @@ -1,21 +0,0 @@ -(function () { - function *fib() - { - let a = 1; - let b = 1; - while (true) { - yield a; - [a, b] = [b, a + b]; - } - } - - let value = 0; - for (let i = 0; i < 1e4; ++i) { - let f = fib(); - for (let i = 0; i < 100; ++i) { - value = f.next().value; - } - if (value !== 354224848179262000000) - throw new Error(`bad value:${result}`); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/generator-frame-empty.js b/implementation-contributed/javascriptcore/stress/generator-frame-empty.js deleted file mode 100644 index 59e8855bfa..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-frame-empty.js +++ /dev/null @@ -1,34 +0,0 @@ -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -shouldThrow(function () { - function *fib(flag) - { - let a = 1; - let b = 1; - yield 42; - if (flag) - return c; - let c = 500; - } - - let value = 0; - for (let i = 0; i < 1e4; ++i) { - for (let v of fib(false)) { - } - } - for (let v of fib(true)) { - } -}, `ReferenceError: Cannot access uninitialized variable.`); diff --git a/implementation-contributed/javascriptcore/stress/generator-function-constructor-is-subclassible.js b/implementation-contributed/javascriptcore/stress/generator-function-constructor-is-subclassible.js deleted file mode 100644 index 8b13b71140..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-function-constructor-is-subclassible.js +++ /dev/null @@ -1,24 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var GeneratorFunction = (function *() { }).constructor; - -class DerivedGeneratorFunction extends GeneratorFunction { - constructor() - { - super("yield 42"); - } - - hello() - { - return 50; - } -} - -let DerivedGenerator = new DerivedGeneratorFunction(); -shouldBe(DerivedGenerator.__proto__, DerivedGeneratorFunction.prototype); -shouldBe(DerivedGenerator.hello(), 50); -let gen = DerivedGenerator(); -shouldBe(gen.next().value, 42); diff --git a/implementation-contributed/javascriptcore/stress/generator-function-constructor.js b/implementation-contributed/javascriptcore/stress/generator-function-constructor.js deleted file mode 100644 index fb9aaff02d..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-function-constructor.js +++ /dev/null @@ -1,31 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -var global = (new Function("return this"))(); -shouldBe(typeof global.GeneratorFunction, 'undefined'); -var generatorFunctionConstructor = (function *() { }).constructor; -shouldBe(generatorFunctionConstructor.__proto__, Function); -shouldBe(generatorFunctionConstructor.prototype.constructor, generatorFunctionConstructor); -shouldBe(generatorFunctionConstructor() instanceof generatorFunctionConstructor, true); -shouldBe(generatorFunctionConstructor("a") instanceof generatorFunctionConstructor, true); -shouldBe(generatorFunctionConstructor("a", "b") instanceof generatorFunctionConstructor, true); - -// Generator functions created by the GeneratorFunction constructor are not themselves constructors. -shouldThrow(() => new (generatorFunctionConstructor()), "TypeError: function is not a constructor (evaluating 'new (generatorFunctionConstructor())')"); \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/generator-function-create-optimized.js b/implementation-contributed/javascriptcore/stress/generator-function-create-optimized.js deleted file mode 100644 index 9f4f409777..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-function-create-optimized.js +++ /dev/null @@ -1,33 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - - -function *g() { } -var GeneratorFunctionPrototype = g.__proto__; - -function test() -{ - return function *gen() - { - yield 42; - }; -} -noInline(test); - -function test2() -{ - function *gen() - { - yield 42; - } - - return gen; -} -noInline(test2); - -for (var i = 0; i < 1e4; ++i) { - shouldBe(test().__proto__, GeneratorFunctionPrototype); - shouldBe(test2().__proto__, GeneratorFunctionPrototype); -} diff --git a/implementation-contributed/javascriptcore/stress/generator-function-declaration-sinking-no-double-allocate.js b/implementation-contributed/javascriptcore/stress/generator-function-declaration-sinking-no-double-allocate.js deleted file mode 100644 index 412bdbfc36..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-function-declaration-sinking-no-double-allocate.js +++ /dev/null @@ -1,36 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} -var GeneratorFunctionPrototype = (function*(){}).__proto__; - -function call(o) { o.x = 3; } -noInline(call); - -function sink (p, q) { - function *f() { }; - if (p) { - call(f); // Force allocation of f - if (q) { - OSRExit(); - } - return f; - } - return { 'x': 2 }; -} -noInline(sink); - -for (var i = 0; i < 100000; ++i) { - var o = sink(true, false); - shouldBe(o.__proto__, GeneratorFunctionPrototype); - if (o.x != 3) - throw "Error: expected o.x to be 2 but is " + result; -} - -// At this point, the function should be compiled down to the FTL - -// Check that the function is properly allocated on OSR exit -var f = sink(true, true); -shouldBe(f.__proto__, GeneratorFunctionPrototype); -if (f.x != 3) - throw "Error: expected o.x to be 3 but is " + result; diff --git a/implementation-contributed/javascriptcore/stress/generator-function-declaration-sinking-osrexit.js b/implementation-contributed/javascriptcore/stress/generator-function-declaration-sinking-osrexit.js deleted file mode 100644 index 3be9e31da8..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-function-declaration-sinking-osrexit.js +++ /dev/null @@ -1,30 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} -var GeneratorFunctionPrototype = (function*(){}).__proto__; - -function sink (p, q) { - function *g(x) { return x; }; - if (p) { if (q) OSRExit(); return g; } - function *f(x) { return x; }; - return f; -} -noInline(sink); - -for (var i = 0; i < 10000; ++i) { - var f = sink(true, false); - shouldBe(f.__proto__, GeneratorFunctionPrototype); - var result = f(42); - if (result.next().value != 42) - throw "Error: expected 42 but got " + result; -} - -// At this point, the function should be compiled down to the FTL - -// Check that the function is properly allocated on OSR exit -var f = sink(true, true); -shouldBe(f.__proto__, GeneratorFunctionPrototype); -var result = f(42); -if (result.next().value != 42) - throw "Error: expected 42 but got " + result; diff --git a/implementation-contributed/javascriptcore/stress/generator-function-declaration-sinking-put.js b/implementation-contributed/javascriptcore/stress/generator-function-declaration-sinking-put.js deleted file mode 100644 index 3deca57d3d..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-function-declaration-sinking-put.js +++ /dev/null @@ -1,38 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} -var GeneratorFunctionPrototype = (function*(){}).__proto__; - -function sink (p, q) { - function *g(x) { return x; }; - if (p) { if (q) g.inner = 42; return g; } - function *f(x) { return x; }; - return f; -} -noInline(sink); - -for (var i = 0; i < 10000; ++i) { - var f = sink(true, true); - shouldBe(f.__proto__, GeneratorFunctionPrototype); - var result = f(42); - if (result.next().value != 42) - throw "Error: expected 42 but got " + result; -} - -// At this point, the function should be compiled down to the FTL - -// Test the allocation on the implicit inner else branch -var f = sink(true, false); -shouldBe(f.__proto__, GeneratorFunctionPrototype); -var result = f(12); -if (result.next().value != 12) - // This shouldn't matter as it should be either correct or completely crash - throw "Error: expected 12 but got " + result; - -// Check that the allocation did not sink beyond the property assignment -var f = sink(true, true); -shouldBe(f.__proto__, GeneratorFunctionPrototype); -var result = f.inner; -if (result != 42) - throw "Error: inner should be 42 but is " + result; diff --git a/implementation-contributed/javascriptcore/stress/generator-function-expression-sinking-no-double-allocate.js b/implementation-contributed/javascriptcore/stress/generator-function-expression-sinking-no-double-allocate.js deleted file mode 100644 index 020e6f0e71..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-function-expression-sinking-no-double-allocate.js +++ /dev/null @@ -1,36 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} -var GeneratorFunctionPrototype = (function*(){}).__proto__; - -function call(o) { o.x = 3; } -noInline(call); - -function sink (p, q) { - var f = function *() { }; - if (p) { - call(f); // Force allocation of f - if (q) { - OSRExit(); - } - return f; - } - return { 'x': 2 }; -} -noInline(sink); - -for (var i = 0; i < 100000; ++i) { - var o = sink(true, false); - shouldBe(o.__proto__, GeneratorFunctionPrototype); - if (o.x != 3) - throw "Error: expected o.x to be 2 but is " + result; -} - -// At this point, the function should be compiled down to the FTL - -// Check that the function is properly allocated on OSR exit -var f = sink(true, true); -shouldBe(f.__proto__, GeneratorFunctionPrototype); -if (f.x != 3) - throw "Error: expected o.x to be 3 but is " + result; diff --git a/implementation-contributed/javascriptcore/stress/generator-function-expression-sinking-osrexit.js b/implementation-contributed/javascriptcore/stress/generator-function-expression-sinking-osrexit.js deleted file mode 100644 index d836581457..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-function-expression-sinking-osrexit.js +++ /dev/null @@ -1,29 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} -var GeneratorFunctionPrototype = (function*(){}).__proto__; - -function sink (p, q) { - var g = function *(x) { return x; }; - if (p) { if (q) OSRExit(); return g; } - return function *(x) { return x; }; -} -noInline(sink); - -for (var i = 0; i < 10000; ++i) { - var f = sink(true, false); - shouldBe(f.__proto__, GeneratorFunctionPrototype); - var result = f(42); - if (result.next().value != 42) - throw "Error: expected 42 but got " + result; -} - -// At this point, the function should be compiled down to the FTL - -// Check that the function is properly allocated on OSR exit -var f = sink(true, true); -shouldBe(f.__proto__, GeneratorFunctionPrototype); -var result = f(42); -if (result.next().value != 42) - throw "Error: expected 42 but got " + result; diff --git a/implementation-contributed/javascriptcore/stress/generator-function-expression-sinking-put.js b/implementation-contributed/javascriptcore/stress/generator-function-expression-sinking-put.js deleted file mode 100644 index 43f50917d8..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-function-expression-sinking-put.js +++ /dev/null @@ -1,37 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} -var GeneratorFunctionPrototype = (function*(){}).__proto__; - -function sink (p, q) { - var g = function *(x) { return x; }; - if (p) { if (q) g.inner = 42; return g; } - return function *(x) { return x; }; -} -noInline(sink); - -for (var i = 0; i < 10000; ++i) { - var f = sink(true, true); - shouldBe(f.__proto__, GeneratorFunctionPrototype); - var result = f(42); - if (result.next().value != 42) - throw "Error: expected 42 but got " + result; -} - -// At this point, the function should be compiled down to the FTL - -// Test the allocation on the implicit inner else branch -var f = sink(true, false); -shouldBe(f.__proto__, GeneratorFunctionPrototype); -var result = f(12); -if (result.next().value != 12) - // This shouldn't matter as it should be either correct or completely crash - throw "Error: expected 12 but got " + result; - -// Check that the allocation did not sink beyond the property assignment -var f = sink(true, true); -shouldBe(f.__proto__, GeneratorFunctionPrototype); -var result = f.inner; -if (result != 42) - throw "Error: inner should be 42 but is " + result; diff --git a/implementation-contributed/javascriptcore/stress/generator-function-name.js b/implementation-contributed/javascriptcore/stress/generator-function-name.js deleted file mode 100644 index f4341efadd..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-function-name.js +++ /dev/null @@ -1,19 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var ok = function *generator() -{ - yield generator; -}; - -var g = ok(); -shouldBe(g.next().value, ok); - -function* generator2(factory) -{ - shouldBe(generator2, factory); -}; - -generator2(generator2).next(); diff --git a/implementation-contributed/javascriptcore/stress/generator-is-not-constructible.js b/implementation-contributed/javascriptcore/stress/generator-is-not-constructible.js deleted file mode 100644 index 35736c1427..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-is-not-constructible.js +++ /dev/null @@ -1,41 +0,0 @@ -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -function *gen() -{ -} - -shouldThrow(() => { - new gen(); -}, `TypeError: function is not a constructor (evaluating 'new gen()')`); - -class A { - static *staticGen() - { - } - - *gen() - { - } -}; - -shouldThrow(() => { - let a = new A(); - new a.gen(); -}, `TypeError: function is not a constructor (evaluating 'new a.gen()')`); - -shouldThrow(() => { - new A.staticGen(); -}, `TypeError: function is not a constructor (evaluating 'new A.staticGen()')`); diff --git a/implementation-contributed/javascriptcore/stress/generator-methods-with-non-generator.js b/implementation-contributed/javascriptcore/stress/generator-methods-with-non-generator.js deleted file mode 100644 index 4561d93076..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-methods-with-non-generator.js +++ /dev/null @@ -1,31 +0,0 @@ -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -function *gen() { -} -var g = gen(); - -shouldThrow(() => { - g.next.call({}); -}, `TypeError: |this| should be a generator`); - - -shouldThrow(() => { - g.throw.call({}); -}, `TypeError: |this| should be a generator`); - -shouldThrow(() => { - g.return.call({}); -}, `TypeError: |this| should be a generator`); diff --git a/implementation-contributed/javascriptcore/stress/generator-methods.js b/implementation-contributed/javascriptcore/stress/generator-methods.js deleted file mode 100644 index 444de6836c..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-methods.js +++ /dev/null @@ -1,60 +0,0 @@ -class Hello { - *gen() { - yield; - } - - static *gen() { - yield; - } - - *get() { - } - - static *get() { - } - - *set() { - } - - static *set() { - } - - *"Hello"() { - } - - static *"Hello"() { - } - - *20() { - } - - static *20() { - } - - *[42]() { - } - - static *[42]() { - } -} - -let object = { - *gen() { - yield; - }, - - *get() { - }, - - *set() { - }, - - *"Hello"() { - }, - - *20() { - }, - - *[42]() { - } -} diff --git a/implementation-contributed/javascriptcore/stress/generator-prototype-copy.js b/implementation-contributed/javascriptcore/stress/generator-prototype-copy.js deleted file mode 100644 index 977308f431..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-prototype-copy.js +++ /dev/null @@ -1,12 +0,0 @@ -function* gen() { yield; } -let foo = gen(); -let obj = {}; -obj.__proto__ = foo; - -try { - obj.next().value; - throw "bad"; -} catch (e) { - if (!(e instanceof TypeError)) - throw e; -} diff --git a/implementation-contributed/javascriptcore/stress/generator-reduced-save-point-put-to-scope.js b/implementation-contributed/javascriptcore/stress/generator-reduced-save-point-put-to-scope.js deleted file mode 100644 index c0c75fa491..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-reduced-save-point-put-to-scope.js +++ /dev/null @@ -1,28 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function error() -{ - throw "ok"; -} - -function* gen() -{ - var value = 42; - try { - yield 300; - value = 500; - error(); - } catch (e) { - yield 42; - return value; - } - return 200; -} - -var g = gen(); -shouldBe(g.next().value, 300); -shouldBe(g.next().value, 42); -shouldBe(g.next().value, 500); diff --git a/implementation-contributed/javascriptcore/stress/generator-relations.js b/implementation-contributed/javascriptcore/stress/generator-relations.js deleted file mode 100644 index efa4dc8ce0..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-relations.js +++ /dev/null @@ -1,30 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function *generatorFunction() { -} -let generator = generatorFunction(); - -shouldBe(generator instanceof generatorFunction, true); -shouldBe(typeof generator.__proto__, 'object'); -shouldBe(generator.__proto__, generatorFunction.prototype); - -let GeneratorPrototype = generator.__proto__.__proto__; - -let GeneratorFunctionPrototype = generatorFunction.__proto__; -let GeneratorFunction = generatorFunction.__proto__.constructor; -shouldBe(GeneratorFunction.prototype, GeneratorFunctionPrototype); -shouldBe(generatorFunction instanceof GeneratorFunction, true); -shouldBe(GeneratorFunction.__proto__, Function); -shouldBe(GeneratorFunctionPrototype.__proto__, Function.prototype); - -shouldBe(GeneratorFunctionPrototype.prototype, GeneratorPrototype); -shouldBe(GeneratorPrototype.constructor, GeneratorFunctionPrototype); - -let arrayIterator = [][Symbol.iterator](); -let ArrayIteratorPrototype = arrayIterator.__proto__; -let IteratorPrototype = ArrayIteratorPrototype.__proto__; - -shouldBe(IteratorPrototype, GeneratorPrototype.__proto__); diff --git a/implementation-contributed/javascriptcore/stress/generator-return-before-first-call.js b/implementation-contributed/javascriptcore/stress/generator-return-before-first-call.js deleted file mode 100644 index ce6debcb1f..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-return-before-first-call.js +++ /dev/null @@ -1,23 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldBeIteratorResult(actual, { value, done }) -{ - shouldBe(actual.value, value); - shouldBe(actual.done, done); -} - -function unreachable() -{ - throw new Error("NG"); -} - -function *gen() -{ - unreachable(); -} - -var g = gen(); -shouldBeIteratorResult(g.return("Hello"), { value: "Hello", done: true }); diff --git a/implementation-contributed/javascriptcore/stress/generator-return.js b/implementation-contributed/javascriptcore/stress/generator-return.js deleted file mode 100644 index 7f569a0f70..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-return.js +++ /dev/null @@ -1,133 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function shouldBeIteratorResult(actual, { value, done }) -{ - shouldBe(actual.value, value); - shouldBe(actual.done, done); -} - -function unreachable() -{ - throw new Error('unreachable'); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -(function () { - function *gen() { - yield yield 20; - yield 42; - } - - { - let g = gen(); - shouldBeIteratorResult(g.next(0), { value: 20, done: false }); - shouldBeIteratorResult(g.return(20), { value: 20, done: true }); - shouldBeIteratorResult(g.return(20), { value: 20, done: true }); - shouldBeIteratorResult(g.next(42), { value: undefined, done: true }); - } - { - let g = gen(); - shouldBeIteratorResult(g.return(42), { value: 42, done: true }); - shouldBeIteratorResult(g.next(42), { value: undefined, done: true }); - shouldBeIteratorResult(g.return(42), { value: 42, done: true }); - } -}()); - -(function () { - function *gen() { - return 42; - } - - { - let g = gen(); - shouldBeIteratorResult(g.next(), { value: 42, done: true }); - shouldBeIteratorResult(g.return(0), { value: 0, done: true }); - } - { - let g = gen(); - shouldBeIteratorResult(g.return(0), { value: 0, done: true }); - shouldBeIteratorResult(g.next(), { value: undefined, done: true }); - shouldBeIteratorResult(g.return(42), { value: 42, done: true }); - } -}()); - -(function () { - function *gen() { - } - - { - let g = gen(); - shouldBeIteratorResult(g.next(), { value: undefined, done: true }); - shouldBeIteratorResult(g.return(0), { value: 0, done: true }); - } - { - let g = gen(); - shouldBeIteratorResult(g.return(0), { value: 0, done: true }); - shouldBeIteratorResult(g.next(), { value: undefined, done: true }); - shouldBeIteratorResult(g.return(42), { value: 42, done: true }); - } -}()); - -(function () { - function *gen() { - try { - yield 42; - } finally { - return 400; - } - } - - { - let g = gen(); - shouldBeIteratorResult(g.next(), { value: 42, done: false }); - shouldBeIteratorResult(g.return(0), { value: 400, done: true }); - shouldBeIteratorResult(g.return(0), { value: 0, done: true }); - } - { - let g = gen(); - shouldBeIteratorResult(g.return(0), { value: 0, done: true }); - shouldBeIteratorResult(g.next(), { value: undefined, done: true }); - shouldBeIteratorResult(g.return(42), { value: 42, done: true }); - } -}()); - - -(function () { - function *gen() { - try { - yield 42; - } finally { - throw new Error("thrown"); - } - } - - { - let g = gen(); - shouldBeIteratorResult(g.next(), { value: 42, done: false }); - shouldThrow(() => g.return(0), `Error: thrown`); - shouldBeIteratorResult(g.return(0), { value: 0, done: true }); - } - { - let g = gen(); - shouldBeIteratorResult(g.return(0), { value: 0, done: true }); - shouldBeIteratorResult(g.next(), { value: undefined, done: true }); - shouldBeIteratorResult(g.return(42), { value: 42, done: true }); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/generator-syntax.js b/implementation-contributed/javascriptcore/stress/generator-syntax.js deleted file mode 100644 index 862c2a5936..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-syntax.js +++ /dev/null @@ -1,166 +0,0 @@ -function testSyntax(script) { - try { - eval(script); - } catch (error) { - if (error instanceof SyntaxError) - throw new Error("Bad error: " + String(error)); - } -} - -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -testSyntaxError(` -class Hello { - get *gen() { - } -} -`, `SyntaxError: Unexpected token '*'. Expected an opening '(' before a method's parameter list.`); - - -testSyntaxError(` -class Hello { - set *gen(value) { - } -} -`, `SyntaxError: Unexpected token '*'. Expected an opening '(' before a method's parameter list.`); - -testSyntaxError(` -function ** gen() { } -`, `SyntaxError: Unexpected token '**'`); - -// "yield" is never a YieldExpression in a ConciseBody (per http://ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions -// and https://tc39.github.io/ecma262/#prod-ConciseBody) -testSyntax(` -var value = () => { - yield -} -`); - -testSyntax(` -var value = (val = yield) => { -} -`); - -// Confusingly, FormalParameters[~Yield] does not product a SyntaxError for "yield", even -// inside of a generator (https://tc39.github.io/ecma262/#prod-FunctionDeclaration), -// but instead resolves "yield" as a BindingIdentifier -testSyntax(` -function *gen() { - function ng(val = yield) { - } -} -`); - -// Arrow formal parameters within Generators are parameterized with [+Yield], but are -// still forbidden from including YieldExpressions in ArrowFormalParameters. -// (https://tc39.github.io/ecma262/#prod-ArrowFormalParameters) -testSyntaxError(` -var yield; -function *gen() { - var ng = (val = yield) => { - } -} -`, `SyntaxError: Unexpected keyword 'yield'. Cannot use yield expression out of generator.`); - -(function testYieldBindingIdentifier() { - var yield = "hello!"; - function* gen() { - yield (function(x = yield) { return x; })(); - } - var result = gen().next(); - if (result.value !== "hello!") - throw new Error("Expected BindingIdentifier bound to 'hello!', but found " + JSON.stringify(result)); -})(); - -testSyntax(` -function* gen() { - var ng = (it = function*() { yield 1; }) => { - return it().next(); - } - yield ng(); -} -`); - -testSyntaxError(` -function* gen() { - var ng = (it = function() { yield 1; }) => { - return it().next(); - } - yield ng(); -} -`, `SyntaxError: Unexpected number '1'`); - -testSyntax(` -function gen(val = yield) { -} -`); - -// http://ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions-static-semantics-early-errors -testSyntaxError(` -function *gen(val = yield) { -} -`, `SyntaxError: Unexpected keyword 'yield'. Cannot use yield expression within parameters.`); - -testSyntaxError(` -function *gen(val = yield 20) { -} -`, `SyntaxError: Unexpected keyword 'yield'. Cannot use yield expression within parameters.`); - -testSyntaxError(` -function *gen(val = yield * g) { -} -`, `SyntaxError: Unexpected keyword 'yield'. Cannot use yield expression within parameters.`); - - -testSyntax(` -function *gen(g = function *() { yield }) { -} -`); - -testSyntaxError(` -function* gen(arguments) { - "use strict"; -} -`, `SyntaxError: Invalid parameters or function name in strict mode.`); - -testSyntaxError(` -function* gen(eval) { - "use strict"; -} -`, `SyntaxError: Invalid parameters or function name in strict mode.`); - -testSyntaxError(` -function* arguments() { - "use strict"; -} -`, `SyntaxError: 'arguments' is not a valid function name in strict mode.`); - -testSyntaxError(` -function* eval() { - "use strict"; -} -`, `SyntaxError: 'eval' is not a valid function name in strict mode.`); - -testSyntaxError(` -function* gen(a) { - let a = 1; -} -`, `SyntaxError: Cannot declare a let variable twice: 'a'.`); - -testSyntaxError(` -function* gen(b) { - const b = 1; -} -`, `SyntaxError: Cannot declare a const variable twice: 'b'.`); diff --git a/implementation-contributed/javascriptcore/stress/generator-this.js b/implementation-contributed/javascriptcore/stress/generator-this.js deleted file mode 100644 index 10450a793d..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-this.js +++ /dev/null @@ -1,67 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - - -var global = new Function('return this')(); - -(function () { - function *gen() { - yield this; - } - - { - let g = gen(); - shouldBe(g.next().value, global); - } - { - shouldThrow(() => { - let g = new gen(); - g.next(); - }, `TypeError: function is not a constructor (evaluating 'new gen()')`); - } - { - let thisObject = {}; - let g = gen.call(thisObject); - shouldBe(g.next().value, thisObject); - } -}()); - -(function () { - function *gen() { - "use strict"; - yield this; - } - - { - let g = gen(); - shouldBe(g.next().value, undefined); - } - { - shouldThrow(() => { - let g = new gen(); - g.next(); - }, `TypeError: function is not a constructor (evaluating 'new gen()')`); - } - { - let thisObject = {}; - let g = gen.call(thisObject); - shouldBe(g.next().value, thisObject); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/generator-throw-before-first-call.js b/implementation-contributed/javascriptcore/stress/generator-throw-before-first-call.js deleted file mode 100644 index e46cb4f97e..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-throw-before-first-call.js +++ /dev/null @@ -1,20 +0,0 @@ -function unreachable() -{ - throw new Error("NG"); -} - -function *gen() -{ - unreachable(); -} - -var g = gen(); -var error = new Error("OK"); -var thrown = null; -try { - g.throw(error); -} catch (e) { - thrown = e; -} -if (thrown !== error) - unreachable(); diff --git a/implementation-contributed/javascriptcore/stress/generator-throw.js b/implementation-contributed/javascriptcore/stress/generator-throw.js deleted file mode 100644 index ce2269f53c..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-throw.js +++ /dev/null @@ -1,132 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function shouldBeIteratorResult(actual, { value, done }) -{ - shouldBe(actual.value, value); - shouldBe(actual.done, done); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -class CallSite { - constructor() - { - this.count = 0; - } - - call() - { - return this.count++; - } -} - -(function () { - function *gen() { - yield yield 20; - yield 42; - } - - { - let g = gen(); - shouldBeIteratorResult(g.next(0), { value: 20, done: false }); - shouldThrow(() => g.throw(20), `20`); - shouldThrow(() => g.throw(20), `20`); - shouldBeIteratorResult(g.next(42), { value: undefined, done: true }); - shouldBeIteratorResult(g.return(42), { value: 42, done: true }); - } - { - let g = gen(); - shouldThrow(() => g.throw(42), `42`); - shouldBeIteratorResult(g.next(42), { value: undefined, done: true }); - shouldBeIteratorResult(g.return(42), { value: 42, done: true }); - shouldThrow(() => g.throw(42), `42`); - } -}()); - -(function () { - function *gen() { - return 42; - } - - { - let g = gen(); - shouldBeIteratorResult(g.next(), { value: 42, done: true }); - shouldThrow(() => g.throw(0), `0`); - } - { - let g = gen(); - shouldBeIteratorResult(g.return(0), { value: 0, done: true }); - shouldBeIteratorResult(g.next(), { value: undefined, done: true }); - shouldThrow(() => g.throw(42), `42`); - } -}()); - -(function () { - function *gen() { - } - - { - let g = gen(); - shouldBeIteratorResult(g.next(), { value: undefined, done: true }); - shouldThrow(() => g.throw(0), `0`); - } - { - let g = gen(); - shouldBeIteratorResult(g.return(0), { value: 0, done: true }); - shouldBeIteratorResult(g.next(), { value: undefined, done: true }); - shouldThrow(() => g.throw(42), `42`); - } -}()); - -(function () { - let site = new CallSite(); - function *gen() { - try { - yield 42; - } catch (e) { - shouldBe(e, 0); - site.call(); - } - return 42; - } - - { - let g = gen(); - shouldBeIteratorResult(g.next(), { value: 42, done: false }); - shouldBeIteratorResult(g.throw(0), { value: 42, done: true }); - shouldBe(site.count, 1); - } -}()); - -(function () { - function *gen() { - try { - yield 42; - } finally { - return 42; - } - } - - { - let g = gen(); - shouldBeIteratorResult(g.next(), { value: 42, done: false }); - shouldBeIteratorResult(g.throw(0), { value: 42, done: true }); - shouldThrow(() => g.throw(0), `0`); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/generator-transfer-register-beyond-mutiple-yields.js b/implementation-contributed/javascriptcore/stress/generator-transfer-register-beyond-mutiple-yields.js deleted file mode 100644 index fe208f5812..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-transfer-register-beyond-mutiple-yields.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - - -function *gen() -{ - var test = 42; - yield 32; - yield 33; - yield test; -} - -var g = gen(); -shouldBe(g.next().value, 32); -shouldBe(g.next().value, 33); -shouldBe(g.next().value, 42); diff --git a/implementation-contributed/javascriptcore/stress/generator-type-check.js b/implementation-contributed/javascriptcore/stress/generator-type-check.js deleted file mode 100644 index 37432c7cf6..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-type-check.js +++ /dev/null @@ -1,54 +0,0 @@ -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -var iterator; - -var a = []; - -function* foo(index) { - while (1) { - var q = a.pop(); - if(q){ - q.__proto__ = iterator; - q.next(); - } - yield index++; - } -} - -function* foo2(){ - yield; -} - -var temp = foo2(0); - -for(var i = 0; i < 10; i++) { // make a few objects with @generatorState set - var q = {}; - q.__proto__ = temp; - shouldThrow(() => { - q.next(); - }, `TypeError: |this| should be a generator`); - q.__proto__ = {}; - a.push(q); - -} - -iterator = foo(0); - -var q = {}; -q.__proto__ = iterator; -shouldThrow(() => { - q.next(); -}, `TypeError: |this| should be a generator`); diff --git a/implementation-contributed/javascriptcore/stress/generator-with-new-target.js b/implementation-contributed/javascriptcore/stress/generator-with-new-target.js deleted file mode 100644 index ba5013e179..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-with-new-target.js +++ /dev/null @@ -1,31 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -function *gen() -{ - yield new.target; -} - -var g = gen(); -shouldBe(g.next().value, undefined); - -shouldThrow(() => { - var g2 = new gen(); -}, `TypeError: function is not a constructor (evaluating 'new gen()')`); diff --git a/implementation-contributed/javascriptcore/stress/generator-with-super.js b/implementation-contributed/javascriptcore/stress/generator-with-super.js deleted file mode 100644 index 427e62ee2e..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-with-super.js +++ /dev/null @@ -1,80 +0,0 @@ -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - function test() { - return eval('super'); - } - - shouldThrow(() => test(), "SyntaxError: super is not valid in this context."); -}()); - -(function () { - class B { - gen() { - return 42; - } - } - - class A extends B { - *gen() { - return eval('super.gen()'); - } - } - - let a = new A(); - shouldBe(a.gen().next().value, 42); -}()); - -(function () { - class B { - gen() { - return 42; - } - } - - class A extends B { - *gen() { - yield super.gen(); - } - } - - let a = new A(); - shouldBe(a.gen().next().value, 42); -}()); - -(function () { - class B { - gen() { - return 42; - } - } - - class A extends B { - *gen() { - yield super.gen(); - } - } - - let a = new A(); - shouldThrow(() => { - new a.gen(); - }, `TypeError: function is not a constructor (evaluating 'new a.gen()')`); -}()); diff --git a/implementation-contributed/javascriptcore/stress/generator-with-this-strict.js b/implementation-contributed/javascriptcore/stress/generator-with-this-strict.js deleted file mode 100644 index d19cb6044b..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-with-this-strict.js +++ /dev/null @@ -1,20 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function* generator() -{ - 'use strict' - return this; -} - -function target() -{ - var gen = generator(); - return gen.next().value; -} -noInline(target); - -for (var i = 0; i < 1e6; ++i) - shouldBe(target(), undefined); diff --git a/implementation-contributed/javascriptcore/stress/generator-with-this.js b/implementation-contributed/javascriptcore/stress/generator-with-this.js deleted file mode 100644 index 171e174b3c..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-with-this.js +++ /dev/null @@ -1,20 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function* generator() -{ - return this; -} - -function target() -{ - var gen = generator(); - return gen.next().value; -} -noInline(target); - -var result = this; -for (var i = 0; i < 1e6; ++i) - shouldBe(target(), result); diff --git a/implementation-contributed/javascriptcore/stress/generator-yield-star.js b/implementation-contributed/javascriptcore/stress/generator-yield-star.js deleted file mode 100644 index 748a835a37..0000000000 --- a/implementation-contributed/javascriptcore/stress/generator-yield-star.js +++ /dev/null @@ -1,329 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -class CallSite { - constructor() - { - this.count = 0; - } - - call() - { - return this.count++; - } -} - -(function () { - class Arrays { - constructor() - { - this.first = [ 0, 1, 2, 3 ]; - this.second = [ 4, 5, 6, 7 ]; - } - - *[Symbol.iterator]() - { - yield * this.first; - yield * this.second; - } - } - - var arrays = new Arrays; - let i = 0; - for (let value of arrays) - shouldBe(i++, value); -}()); - -(function () { - // throw should be propagated. - let c1 = new CallSite; - class Iterator { - next(value) - { - return { value, done: false }; - } - - 'throw'(value) { - shouldBe(value, 42); - c1.call(); - throw new Error("OK"); - } - - [Symbol.iterator]() - { - return this; - } - } - - function *gen() - { - let iter = new Iterator(); - yield * iter; - } - - let g = gen(); - shouldBe(g.next(0).value, undefined); - shouldBe(g.next(1).value, 1); - shouldBe(g.next(2).value, 2); - shouldThrow(() => { - g.throw(42); - }, `Error: OK`); - shouldThrow(() => { - g.throw(44); - }, `44`); - shouldBe(c1.count, 1); -}()); - -(function () { - // No `throw` method. - let c1 = new CallSite; - class Iterator { - next(value) - { - return { value, done: false }; - } - - 'return'(value) - { - shouldBe(value, undefined); - c1.call(); - return { value, done: true }; - } - - [Symbol.iterator]() - { - return this; - } - } - - function *gen() - { - let iter = new Iterator(); - yield * iter; - } - - let g = gen(); - shouldBe(g.next(0).value, undefined); - shouldBe(g.next(1).value, 1); - shouldBe(g.next(2).value, 2); - shouldThrow(() => { - g.throw(42); - }, `TypeError: Delegated generator does not have a 'throw' method.`); - shouldThrow(() => { - g.throw(44); - }, `44`); - shouldBe(c1.count, 1); -}()); - -(function () { - // No `throw` method, `return` returns an incorrect result. - let c1 = new CallSite; - class Iterator { - next(value) - { - return { value, done: false }; - } - - 'return'(value) - { - shouldBe(value, undefined); - c1.call(); - } - - [Symbol.iterator]() - { - return this; - } - } - - function *gen() - { - let iter = new Iterator(); - yield * iter; - } - - let g = gen(); - shouldBe(g.next(0).value, undefined); - shouldBe(g.next(1).value, 1); - shouldBe(g.next(2).value, 2); - shouldThrow(() => { - g.throw(42); - }, `TypeError: Iterator result interface is not an object.`); - shouldThrow(() => { - g.throw(44); - }, `44`); - shouldBe(c1.count, 1); -}()); - -(function () { - // No `throw` method, No `return` method. - class Iterator { - next(value) - { - return { value, done: false }; - } - - [Symbol.iterator]() - { - return this; - } - } - - function *gen() - { - let iter = new Iterator(); - yield * iter; - } - - let g = gen(); - shouldBe(g.next(0).value, undefined); - shouldBe(g.next(1).value, 1); - shouldBe(g.next(2).value, 2); - shouldThrow(() => { - g.throw(42); - }, `TypeError: Delegated generator does not have a 'throw' method.`); - shouldThrow(() => { - g.throw(44); - }, `44`); -}()); - - -(function () { - // `throw` does not throw. Not returns a object. - class Iterator { - next(value) - { - return { value, done: false }; - } - - 'throw'(value) - { - } - - [Symbol.iterator]() - { - return this; - } - } - - function *gen() - { - let iter = new Iterator(); - yield * iter; - } - - let g = gen(); - shouldBe(g.next(0).value, undefined); - shouldBe(g.next(1).value, 1); - shouldBe(g.next(2).value, 2); - shouldThrow(() => { - g.throw(42); - }, `TypeError: Iterator result interface is not an object.`); - shouldThrow(() => { - g.throw(44); - }, `44`); -}()); - -(function () { - // `throw` does not throw. If returned iterator result is marked as done, it becomes `return`. - class Iterator { - next(value) - { - return { value, done: false }; - } - - 'throw'(value) - { - return { value, done: true }; - } - - [Symbol.iterator]() - { - return this; - } - } - - function *gen() - { - let iter = new Iterator(); - let result = yield * iter; - shouldBe(result, 42); - yield 21; - } - - let g = gen(); - shouldBe(g.next(0).value, undefined); - shouldBe(g.next(1).value, 1); - shouldBe(g.next(2).value, 2); - shouldBe(g.throw(42).value, 21); - shouldBe(g.next().done, true); - shouldThrow(() => { - g.throw(44); - }, `44`); -}()); - -(function () { - // `return` returns done: false. - class Iterator { - next(value) - { - return { value, done: false }; - } - - 'return'(value) - { - return { value, done: false }; - } - - [Symbol.iterator]() - { - return this; - } - } - - function *gen() - { - let iter = new Iterator(); - let result = yield * iter; - yield result; - yield 42; - } - - let g = gen(); - shouldBe(g.next(0).value, undefined); - shouldBe(g.next(1).value, 1); - shouldBe(g.next(2).value, 2); - shouldBe(g.return(42).value, 42); - shouldBe(g.return(42).done, false); -}()); - -(function () { - function *gen() - { - let result = yield * [ 0, 1, 2 ]; - yield result; - } - - let g = gen(); - shouldBe(g.next().value, 0); - shouldBe(g.next().value, 1); - shouldBe(g.next().value, 2); - shouldBe(g.next().value, undefined); -}()); diff --git a/implementation-contributed/javascriptcore/stress/generic-arguments-correct-delete-behavior.js b/implementation-contributed/javascriptcore/stress/generic-arguments-correct-delete-behavior.js deleted file mode 100644 index f76813938a..0000000000 --- a/implementation-contributed/javascriptcore/stress/generic-arguments-correct-delete-behavior.js +++ /dev/null @@ -1,47 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad") -} - -function makeTest(shouldCaptureArgument, deleteTwice, zeroAsString) { - return eval(` - function foo(x) { - ${shouldCaptureArgument ? `function bar() { return x; }` : ""} - - assert(x === null); - - let prop = ${zeroAsString ? "'0'" : "0"}; - Object.defineProperty(arguments, "0", {enumerable: false, value:45}); - assert(arguments[prop] === 45); - assert(x === 45); - - let result = delete arguments[prop]; - assert(result); - ${deleteTwice ? `assert(delete arguments[prop]);` : ""}; - - assert(arguments[prop] === undefined); // don't crash here. - assert(!(prop in arguments)); - - arguments[prop] = 50; - - assert(arguments[prop] === 50); - assert(x === 45); - }; foo; - `); -} - -let functions = []; -functions.push(makeTest(false, false, true)); -functions.push(makeTest(false, false, false)); -functions.push(makeTest(false, true, false)); -functions.push(makeTest(false, true, true)); -functions.push(makeTest(true, false, true)); -functions.push(makeTest(true, false, false)); -functions.push(makeTest(true, true, false)); -functions.push(makeTest(true, true, true)); - -for (let f of functions) { - noInline(f); - for (let i = 0; i < 1000; ++i) - f(null); -} diff --git a/implementation-contributed/javascriptcore/stress/get-argument-by-val-in-inlined-varargs-call-out-of-bounds.js b/implementation-contributed/javascriptcore/stress/get-argument-by-val-in-inlined-varargs-call-out-of-bounds.js deleted file mode 100644 index 0f210ce724..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-argument-by-val-in-inlined-varargs-call-out-of-bounds.js +++ /dev/null @@ -1,31 +0,0 @@ -var gi; - -function foo() { - return arguments[gi]; -} - -function bar(array, i) { - gi = i; - return foo.apply(this, array); -} - -noInline(bar); - -var bigArray = []; -for (var i = 0; i < 50; ++i) - bigArray.push(42); - -for (var i = 0; i < 10000; ++i) { - var mi = i % 50; - var result = bar(bigArray, mi); - if (result !== 42) - throw "Bad result in first loop: " + result + "; expected: " + 42; -} - -for (var i = 0; i < 10000; ++i) { - var mi = i % 100; - var result = bar([42], mi); - var expected = mi ? void 0 : 42; - if (result !== expected) - throw "Bad result in second loop: " + result + "; expected: " + expected; -} diff --git a/implementation-contributed/javascriptcore/stress/get-argument-by-val-safe-in-inlined-varargs-call-out-of-bounds.js b/implementation-contributed/javascriptcore/stress/get-argument-by-val-safe-in-inlined-varargs-call-out-of-bounds.js deleted file mode 100644 index 9fb3c1c4a7..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-argument-by-val-safe-in-inlined-varargs-call-out-of-bounds.js +++ /dev/null @@ -1,35 +0,0 @@ -var gi; - -function foo() { - if (!effectful42()) - arguments = "hello"; - return arguments[gi]; -} - -function bar(array, i) { - gi = i; - return foo.apply(this, array); -} - -noInline(bar); - -var bigArray = []; -for (var i = 0; i < 50; ++i) - bigArray.push(42); - -for (var i = 0; i < 10000; ++i) { - var mi = i % 50; - var result = bar(bigArray, mi); - if (result !== 42) - throw "Bad result in first loop: " + result + "; expected: " + 42; -} - - -for (var i = 0; i < 10000; ++i) { - var mi = i % 100; - var result = bar([42], mi); - var expected = mi ? void 0 : 42; - if (result !== expected) - throw "Bad result in second loop: " + result + "; expected: " + expected; -} - diff --git a/implementation-contributed/javascriptcore/stress/get-array-length-on-undecided.js b/implementation-contributed/javascriptcore/stress/get-array-length-on-undecided.js deleted file mode 100644 index 943866dffa..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-array-length-on-undecided.js +++ /dev/null @@ -1,76 +0,0 @@ -function forceTransition() { - // We want to test the StructureCheck in testSparseArray(), not this watchpoint. - // We start with the transition so that it's nothing new. - let array = new Array(); - array[100001] = "WebKit!"; -} -forceTransition(); - -function opaqueGetArrayLength(array) -{ - return array.length; -} -noInline(opaqueGetArrayLength); - -function testEmptyArray() -{ - let array = []; - for (let i = 0; i < 1e6; ++i) { - if (opaqueGetArrayLength(array) !== 0) { - throw "Failed testEmptyArray"; - } - } - - array = new Array(); - for (let i = 0; i < 1e6; ++i) { - if (opaqueGetArrayLength(array) !== 0) { - throw "Failed testEmptyArray"; - } - } -} -testEmptyArray(); - - -function testUnitializedArray() -{ - let array = new Array(32); - for (let i = 0; i < 1e6; ++i) { - if (opaqueGetArrayLength(array) !== 32) { - throw "Failed testUnitializedArray"; - } - } - - array = new Array(); - array.length = 64 - for (let i = 0; i < 1e6; ++i) { - if (opaqueGetArrayLength(array) !== 64) { - throw "Failed testUnitializedArray"; - } - } -} -testUnitializedArray(); - -function testOversizedArray() -{ - let array = new Array(100001); - for (let i = 0; i < 1e6; ++i) { - if (opaqueGetArrayLength(array) !== 100001) { - throw "Failed testOversizedArray"; - } - } -} -testOversizedArray(); - -// This should OSR Exit and fallback to GetById to get the length. -function testSparseArray() -{ - let array = new Array(); - array[100001] = "WebKit!"; - for (let i = 0; i < 1e6; ++i) { - if (opaqueGetArrayLength(array) !== 100002) { - throw "Failed testOversizedArray"; - } - } -} -testSparseArray(); - diff --git a/implementation-contributed/javascriptcore/stress/get-array-length-phantom-new-array-buffer.js b/implementation-contributed/javascriptcore/stress/get-array-length-phantom-new-array-buffer.js deleted file mode 100644 index 0810c7822a..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-array-length-phantom-new-array-buffer.js +++ /dev/null @@ -1,14 +0,0 @@ -function effects() {} -noInline(effects); - -function foo() { - let x = [1,2,3]; - effects(); - return x.length; -} -noInline(foo); - -for (let i = 0; i < 100000; ++i) { - if (foo() !== 3) - throw new Error(); -} diff --git a/implementation-contributed/javascriptcore/stress/get-array-length-undecided.js b/implementation-contributed/javascriptcore/stress/get-array-length-undecided.js deleted file mode 100644 index 2ea3943647..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-array-length-undecided.js +++ /dev/null @@ -1,10 +0,0 @@ -function test(array) { - return array.length; -} -noInline(test); - -let array = new Array(10); -for (let i = 0; i < 10000; i++) { - if (test(array) !== 10) - throw new Error("bad result"); -} diff --git a/implementation-contributed/javascriptcore/stress/get-by-id-strict-arguments.js b/implementation-contributed/javascriptcore/stress/get-by-id-strict-arguments.js deleted file mode 100644 index f5607f4ca4..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-id-strict-arguments.js +++ /dev/null @@ -1,28 +0,0 @@ -let warm = 1000; - -function foo(f) { - return f.arguments; -} -noInline(foo); - -function bar() { - for (let i = 0; i < warm; ++i) - foo(bar); -} -function baz() { - "use strict"; - foo(baz); -} - -bar(); - -let caught = false; - -try { - baz(); -} catch (e) { - caught = true; -} - -if (!caught) - throw new Error(`bad!`); diff --git a/implementation-contributed/javascriptcore/stress/get-by-id-strict-callee.js b/implementation-contributed/javascriptcore/stress/get-by-id-strict-callee.js deleted file mode 100644 index 929d65e782..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-id-strict-callee.js +++ /dev/null @@ -1,24 +0,0 @@ -let warm = 1000; - -function bar() { - for (let i = 0; i < warm; ++i) - arguments.callee; -} - -function baz() { - "use strict"; - arguments.callee; -} - -bar(); - -let caught = false; - -try { - baz(); -} catch (e) { - caught = true; -} - -if (!caught) - throw new Error(`bad!`); diff --git a/implementation-contributed/javascriptcore/stress/get-by-id-strict-caller.js b/implementation-contributed/javascriptcore/stress/get-by-id-strict-caller.js deleted file mode 100644 index 3462ec070c..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-id-strict-caller.js +++ /dev/null @@ -1,28 +0,0 @@ -let warm = 1000; - -function foo(f) { - return f.caller; -} -noInline(foo); - -function bar() { - for (let i = 0; i < warm; ++i) - foo(bar); -} -function baz() { - "use strict"; - foo(baz); -} - -bar(); - -let caught = false; - -try { - baz(); -} catch (e) { - caught = true; -} - -if (!caught) - throw new Error(`bad!`); diff --git a/implementation-contributed/javascriptcore/stress/get-by-id-strict-nested-arguments-2.js b/implementation-contributed/javascriptcore/stress/get-by-id-strict-nested-arguments-2.js deleted file mode 100644 index fdfc9a8644..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-id-strict-nested-arguments-2.js +++ /dev/null @@ -1,42 +0,0 @@ -let warm = 1000; - -function foo(f) { - return f.arguments; -} -noInline(foo); - -let caught = 0; - -function bar() { - for (let i = 0; i < warm; ++i) - foo(bar); - const x = function baz1() { "use strict"; return 42; }; - const y = function baz2() { "use strict"; return 0xc0defefe; }; - return [x, y]; -} - -bar(); -bar(); -const [baz1, baz2] = bar(); - - -if (baz1() !== 42) - throw new Error(`bad!`); - -if (baz2() !== 0xc0defefe) - throw new Error(`bad!`); - -try { - foo(baz1); -} catch (e) { - ++caught; -} - -try { - foo(baz2); -} catch (e) { - ++caught; -} - -if (caught !== 2) - throw new Error(`bad!`); diff --git a/implementation-contributed/javascriptcore/stress/get-by-id-strict-nested-arguments.js b/implementation-contributed/javascriptcore/stress/get-by-id-strict-nested-arguments.js deleted file mode 100644 index 0d3ceedcc2..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-id-strict-nested-arguments.js +++ /dev/null @@ -1,27 +0,0 @@ -let warm = 1000; - -function foo(f) { - return f.arguments; -} -noInline(foo); - -let caught = false; - -function bar() { - for (let i = 0; i < warm; ++i) - foo(bar); - function baz() { - "use strict"; - try { - foo(baz); - } catch (e) { - caught = true; - } - } - baz(); -} - -bar(); - -if (!caught) - throw new Error(`bad!`); diff --git a/implementation-contributed/javascriptcore/stress/get-by-id-throw-from-getter-through-optimized-code.js b/implementation-contributed/javascriptcore/stress/get-by-id-throw-from-getter-through-optimized-code.js deleted file mode 100644 index 1b301d769d..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-id-throw-from-getter-through-optimized-code.js +++ /dev/null @@ -1,37 +0,0 @@ -function foo(o) { - return o.f + 1; -} - -noInline(foo); - -var shouldThrow = false; - -function makeWithGetter() { - var o = {}; - o.__defineGetter__("f", function() { - if (shouldThrow) - throw "hello"; - return 42; - }); - return o; -} - -for (var i = 0; i < 100000; ++i) { - var result = foo({f:23}); - if (result != 24) - throw "Error: bad result: " + result; - result = foo(makeWithGetter()); - if (result != 43) - throw "Error: bad result: " + result; -} - -var didThrow; -try { - shouldThrow = true; - foo(makeWithGetter()); -} catch (e) { - didThrow = e; -} - -if (didThrow != "hello") - throw "Error: didn't throw or threw wrong exception: " + didThrow; diff --git a/implementation-contributed/javascriptcore/stress/get-by-id-throw-from-unexpected-getter-through-optimized-code-that-does-not-exit.js b/implementation-contributed/javascriptcore/stress/get-by-id-throw-from-unexpected-getter-through-optimized-code-that-does-not-exit.js deleted file mode 100644 index e14d0ceb6e..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-id-throw-from-unexpected-getter-through-optimized-code-that-does-not-exit.js +++ /dev/null @@ -1,35 +0,0 @@ -function foo(o) { - return o.f; -} - -noInline(foo); - -function makeWithGetter() { - var o = {}; - o.__defineGetter__("f", function() { - throw "hello"; - }); - return o; -} - -for (var i = 0; i < 100000; ++i) { - var result = foo({f:23}); - if (result != 23) - throw "Error: bad result: " + result; - result = foo({g:12, f:13}); - if (result != 13) - throw "Error: bad result: " + result; - result = foo({g:12, h:13, f:14}); - if (result != 14) - throw "Error: bad result: " + result; -} - -var didThrow; -try { - foo(makeWithGetter()); -} catch (e) { - didThrow = e; -} - -if (didThrow != "hello") - throw "Error: didn't throw or threw wrong exception: " + didThrow; diff --git a/implementation-contributed/javascriptcore/stress/get-by-id-throw-from-unexpected-getter-through-optimized-code.js b/implementation-contributed/javascriptcore/stress/get-by-id-throw-from-unexpected-getter-through-optimized-code.js deleted file mode 100644 index 1ef7726a48..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-id-throw-from-unexpected-getter-through-optimized-code.js +++ /dev/null @@ -1,35 +0,0 @@ -function foo(o) { - return o.f + 1; -} - -noInline(foo); - -function makeWithGetter() { - var o = {}; - o.__defineGetter__("f", function() { - throw "hello"; - }); - return o; -} - -for (var i = 0; i < 100000; ++i) { - var result = foo({f:23}); - if (result != 24) - throw "Error: bad result: " + result; - result = foo({g:12, f:13}); - if (result != 14) - throw "Error: bad result: " + result; - result = foo({g:12, h:13, f:14}); - if (result != 15) - throw "Error: bad result: " + result; -} - -var didThrow; -try { - foo(makeWithGetter()); -} catch (e) { - didThrow = e; -} - -if (didThrow != "hello") - throw "Error: didn't throw or threw wrong exception: " + didThrow; diff --git a/implementation-contributed/javascriptcore/stress/get-by-id-untyped.js b/implementation-contributed/javascriptcore/stress/get-by-id-untyped.js deleted file mode 100644 index 8995d8015d..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-id-untyped.js +++ /dev/null @@ -1,21 +0,0 @@ -function foo(o) { - return o.f; -} - -noInline(foo); - -String.prototype.f = 42; -Number.prototype.f = 24; - -for (var i = 0; i < 100000; ++i) { - var result = foo("hello"); - if (result != 42) - throw "Error: bad result for string: " + result; - result = foo(13); - if (result != 24) - throw "Error: bad result for number: " + result; - result = foo({f:84}); - if (result != 84) - throw "Error: bad result for object: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/get-by-offset-double.js b/implementation-contributed/javascriptcore/stress/get-by-offset-double.js deleted file mode 100644 index 402155aa12..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-offset-double.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(o, p) { - if (p) - return o.f; - else - return [o * 1.1, o * 1.2, o * 1.3]; -} - -for (var i = 0; i < 100; ++i) - foo({f:42}, true); - -function bar() { - var x = 4.5; - for (var i = 0; i < 10; ++i) { - x *= 1.1; - x += 0.05; - foo(x, false); - } - return x * 1.03; -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) - bar(); - diff --git a/implementation-contributed/javascriptcore/stress/get-by-pname-only-prototype-properties.js b/implementation-contributed/javascriptcore/stress/get-by-pname-only-prototype-properties.js deleted file mode 100644 index e1d6ce8248..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-pname-only-prototype-properties.js +++ /dev/null @@ -1,50 +0,0 @@ -var foo = function (C, A) { - for(var B in (A||{})) { - C[B]=A[B]; - } - return C; -} - -var protos = []; -for (var i = 0; i < 256; i++) { - var proto = Object.create(null); - protos.push(proto); - proto.aa = 1; - proto.ab = 1; - proto.ac = 1; - proto.ad = 1; - proto.ae = 1; - proto.af = 1; - proto.ag = 1; - proto.ah = 1; - proto.ai = 1; - proto.aj = 1; - proto.ak = 1; - proto.al = 1; - proto.am = 1; - proto.an = 1; - proto.ao = 1; - proto.ap = 1; - proto.aq = 1; - proto.ar = 1; - proto.as = 1; - proto.at = 1; - proto.au = 1; - proto.av = 1; - proto.aw = 1; - proto.ax = 1; - proto.ay = 1; - proto.az = 1; - proto.ba = 1; - proto.bb = 1; - proto.bc = 1; - proto.bd = 1; - proto.be = 1; - proto.bf = 1; - var weirdObject = Object.create(proto); - var result = foo({}, weirdObject); - for (var p in result) { - if (result[p] !== result["" + p]) - throw new Error("OUT"); - } -} diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-double-predicted-int.js b/implementation-contributed/javascriptcore/stress/get-by-val-double-predicted-int.js deleted file mode 100644 index 6af1fd73c9..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-double-predicted-int.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, i) { - var x = a[i]; - predictInt32(x); - return x + 2000000000; -} - -noInline(foo); - -var array = [2000000000.5]; - -for (var i = 0; i < 1000000; ++i) { - var result = foo(array, 0); - if (result != 4000000000.5) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-fold-did-clobber-world.js b/implementation-contributed/javascriptcore/stress/get-by-val-fold-did-clobber-world.js deleted file mode 100644 index 27a6f4ccea..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-fold-did-clobber-world.js +++ /dev/null @@ -1,9 +0,0 @@ -var __v_1673 = [16]; -function __f_443() { - for (var __v_1679 = 0; __v_1679 < 1e5; ++__v_1679) { - for (var __v_1680 = 0; __v_1680 < 7; ++__v_1680) { - var __v_1681 = __v_1673[__v_1680]; - } - } -} -__f_443() diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-array-type.js b/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-array-type.js deleted file mode 100644 index b5b01f2c86..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-array-type.js +++ /dev/null @@ -1,358 +0,0 @@ -"use strict" - -// Test in-bounds access. -function opaqueGetByVal1(array, index) { - return array[index]; -} -noInline(opaqueGetByVal1); - -function testAccessInBounds() { - const target = new Array(100); - - // We start with an original array. Those GetByVal can be eliminated. - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal1(target, i % 100); - if (value !== undefined) - throw "opaqueGetByVal1() case 1 failed for i = " + i + " value = " + value; - } - - // Adding non-indexed properties to change the kind of array we are dealing with. - target["webkit"] = "awesome!"; - target[-5] = "Uh?"; - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal1(target, i % 100); - if (value !== undefined) - throw "opaqueGetByVal1() case 2 failed for i = " + i + " value = " + value; - } - - if (target["webkit"] !== "awesome!") - throw "Failed to retrieve \"webkit\""; - if (opaqueGetByVal1(target, -5) !== "Uh?") - throw "Failed to retrive -5"; -} -testAccessInBounds(); - -// Empty array access. -function opaqueGetByVal2(array, index) { - return array[index]; -} -noInline(opaqueGetByVal2); - -function testEmptyArrayAccess() { - const target = new Array(); - - // We start with an original array. Those GetByVal can be eliminated. - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal2(target, i % 100); - if (value !== undefined) - throw "opaqueGetByVal2() case 1 failed for i = " + i + " value = " + value; - } - - // Adding non-indexed properties to change the kind of array we are dealing with. - target["webkit"] = "awesome!"; - target[-5] = "Uh?"; - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal2(target, i % 100); - if (value !== undefined) - throw "opaqueGetByVal2() case 2 failed for i = " + i + " value = " + value; - } - if (target["webkit"] !== "awesome!") - throw "Failed to retrieve \"webkit\""; - if (opaqueGetByVal2(target, -5) !== "Uh?") - throw "Failed to retrive -5"; -} -testEmptyArrayAccess(); - -// Out of bounds array access. -function opaqueGetByVal3(array, index) { - return array[index]; -} -noInline(opaqueGetByVal3); - -function testOutOfBoundsArrayAccess() { - const target = new Array(42); - - // We start with an original array. Those GetByVal can be eliminated. - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal3(target, i + 43); - if (value !== undefined) - throw "opaqueGetByVal3() case 1 failed for i = " + i + " value = " + value; - } - - // Adding non-indexed properties to change the kind of array we are dealing with. - target["webkit"] = "awesome!"; - target[-5] = "Uh?"; - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal3(target, i + 43); - if (value !== undefined) - throw "opaqueGetByVal3() case 2 failed for i = " + i + " value = " + value; - } - if (target["webkit"] !== "awesome!") - throw "Failed to retrieve \"webkit\""; - if (opaqueGetByVal3(target, -5) !== "Uh?") - throw "Failed to retrive -5"; -} -testOutOfBoundsArrayAccess(); - -// In-and-out of bounds. -function opaqueGetByVal4(array, index) { - return array[index]; -} -noInline(opaqueGetByVal4); - -function testInAndOutOfBoundsArrayAccess() { - const target = new Array(71); - - // We start with an original array. Those GetByVal can be eliminated. - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal4(target, i); - if (value !== undefined) - throw "opaqueGetByVal4() case 1 failed for i = " + i + " value = " + value; - } - - // Adding non-indexed properties to change the kind of array we are dealing with. - target["webkit"] = "awesome!"; - target[-5] = "Uh?"; - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal4(target, i); - if (value !== undefined) - throw "opaqueGetByVal4() case 2 failed for i = " + i + " value = " + value; - } - if (target["webkit"] !== "awesome!") - throw "Failed to retrieve \"webkit\""; - if (opaqueGetByVal4(target, -5) !== "Uh?") - throw "Failed to retrive -5"; -} -testInAndOutOfBoundsArrayAccess(); - -// Negative index. -function opaqueGetByVal5(array, index) { - return array[index]; -} -noInline(opaqueGetByVal5); - -function testNegativeIndex() { - const target = new Array(); - - // We start with an original array. Those GetByVal can be eliminated. - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal5(target, -1 - i); - if (value !== undefined) - throw "opaqueGetByVal5() case 1 failed for i = " + i + " value = " + value; - } - - // Adding non-indexed properties to change the kind of array we are dealing with. - target["webkit"] = "awesome!"; - target[-5] = "Uh?"; - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal5(target, -1 - i); - if (i === 4) { - if (value !== "Uh?") - throw "opaqueGetByVal5() case 2 failed for i = " + i + " value = " + value; - } else if (value !== undefined) - throw "opaqueGetByVal5() case 2 failed for i = " + i + " value = " + value; - } - if (target["webkit"] !== "awesome!") - throw "Failed to retrieve \"webkit\""; - if (opaqueGetByVal5(target, -5) !== "Uh?") - throw "Failed to retrive -5"; -} -testNegativeIndex(); - -// Test integer boundaries. -function opaqueGetByVal6(array, index) { - return array[index]; -} -noInline(opaqueGetByVal6); - -function testIntegerBoundaries() { - const target = new Array(42); - - for (let i = 0; i < 1e4; ++i) { - // 2^31 - 1 - let value = opaqueGetByVal6(target, 2147483647); - if (value !== undefined) - throw "opaqueGetByVal6() case 1 failed for 2147483647 value = " + value; - - // 2^31 - value = opaqueGetByVal6(target, 2147483648); - if (value !== undefined) - throw "opaqueGetByVal6() case 1 failed for 2147483648 value = " + value; - - // 2^32 - 1 - value = opaqueGetByVal6(target, 4294967295); - if (value !== undefined) - throw "opaqueGetByVal6() case 1 failed for 4294967295 value = " + value; - - // 2^32 - value = opaqueGetByVal6(target, 4294967296); - if (value !== undefined) - throw "opaqueGetByVal6() case 1 failed for 4294967296 value = " + value; - - // 2^52 - value = opaqueGetByVal6(target, 4503599627370496); - if (value !== undefined) - throw "opaqueGetByVal6() case 1 failed for 4503599627370496 value = " + value; - } -} -testIntegerBoundaries(); - -// Use a constant index. -function opaqueGetByVal7_zero(array) { - return array[0]; -} -noInline(opaqueGetByVal7_zero); - -function opaqueGetByVal7_doubleZero(array) { - return array[1.5 - 1.5]; -} -noInline(opaqueGetByVal7_doubleZero); - -function opaqueGetByVal7_101(array) { - return array[101]; -} -noInline(opaqueGetByVal7_101); - -function opaqueGetByVal7_double101(array) { - return array[101.0000]; -} -noInline(opaqueGetByVal7_double101); - -function opaqueGetByVal7_1038(array) { - return array[1038]; -} -noInline(opaqueGetByVal7_1038); - -function testContantIndex() { - const emptyArray = new Array(); - - for (let i = 0; i < 1e4; ++i) { - let value = opaqueGetByVal7_zero(emptyArray); - if (value !== undefined) - throw "opaqueGetByVal7() case 1 failed for 0 value = " + value; - - value = opaqueGetByVal7_doubleZero(emptyArray); - if (value !== undefined) - throw "opaqueGetByVal7_doubleZero() case 1 failed for 0 value = " + value; - - value = opaqueGetByVal7_101(emptyArray); - if (value !== undefined) - throw "opaqueGetByVal7() case 1 failed for 101 value = " + value; - - value = opaqueGetByVal7_double101(emptyArray); - if (value !== undefined) - throw "opaqueGetByVal7() case 1 failed for 101 value = " + value; - } - - const uninitializedArray = new Array(1038); - - for (let i = 0; i < 1e4; ++i) { - let value = opaqueGetByVal7_zero(uninitializedArray); - if (value !== undefined) - throw "opaqueGetByVal7() case 2 failed for 0 value = " + value; - - value = opaqueGetByVal7_doubleZero(uninitializedArray); - if (value !== undefined) - throw "opaqueGetByVal7_doubleZero() case 2 failed for 0 value = " + value; - - value = opaqueGetByVal7_101(uninitializedArray); - if (value !== undefined) - throw "opaqueGetByVal7() case 2 failed for 101 value = " + value; - - value = opaqueGetByVal7_double101(uninitializedArray); - if (value !== undefined) - throw "opaqueGetByVal7_double101() case 2 failed for 101 value = " + value; - - value = opaqueGetByVal7_1038(uninitializedArray); - if (value !== undefined) - throw "opaqueGetByVal7() case 2 failed for 1038 value = " + value; - } - -} -testContantIndex(); - -// Test natural integer proggression. -function testValueIsUndefinedInNaturalProgression(value) { - if (value !== undefined) - throw "Invalid value in natural progression test" -} -noInline(testValueIsUndefinedInNaturalProgression); - -function testNaturalProgression() { - const target = new Array(42); - - for (let i = 0; i < 10; ++i) { - const value = target[i]; - testValueIsUndefinedInNaturalProgression(value); - } - - const emptyTarget = new Array(); - for (let i = 10; i--;) { - const value = emptyTarget[i]; - testValueIsUndefinedInNaturalProgression(value); - } -} -noInline(testNaturalProgression); -for (let i = 0; i < 1e4; ++i) - testNaturalProgression(); - -// PutByVal changes the array type. -function getUndecidedArray() -{ - return new Array(50); -} -noInline(getUndecidedArray); - -for (let i = 0; i < 1e4; ++i) { - // Warm up getUndecidedArray() without any useful profiling information. - getUndecidedArray(); -} - -function getByValAfterPutByVal() -{ - const array = getUndecidedArray(); - - for (let i = 0; i < array.length + 1; ++i) { - if (array[i] !== undefined) - throw "Invalid access on the empty array in getByValAfterPutByVal()"; - } - - array[5] = 42; - - for (let i = array.length + 1; i--;) { - if (i === 5) { - if (array[i] !== 42) - throw "array[5] !== 42" - } else if (array[i] !== undefined) - throw "Invalid access on the mostly empty array in getByValAfterPutByVal()"; - } -} -noInline(getByValAfterPutByVal); - -for (let i = 0; i < 1e4; ++i) - getByValAfterPutByVal(); - -// Push changes the array type. -function getByValAfterPush() -{ - const array = getUndecidedArray(); - - for (let i = 0; i < array.length + 1; ++i) { - if (array[i] !== undefined) - throw "Invalid access on the empty array in getByValAfterPush()"; - } - - array.push(43); - - for (let i = array.length + 1; i--;) { - if (i === 50) { - if (array[i] !== 43) - throw "array[50] !== 43" - } else if (array[i] !== undefined) - throw "Invalid access on the mostly empty array in getByValAfterPush()"; - } -} -noInline(getByValAfterPutByVal); - -for (let i = 0; i < 1e4; ++i) - getByValAfterPush(); diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-out-of-bounds.js b/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-out-of-bounds.js deleted file mode 100644 index a9aa5674e1..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-out-of-bounds.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict" - -function opaqueGetByValKnownArray(value) -{ - let array = []; - return array[value]; -} -noInline(opaqueGetByValKnownArray); - -// Warm up without out-of-bounds access. -for (let i = 0; i < 1e3; ++i) { - if (opaqueGetByValKnownArray(0) !== undefined) - throw "Failed opaqueGetByValKnownArray(0)"; -} - -// Then access out of bounds. -for (let i = 0; i < 1e3; ++i) { - if (opaqueGetByValKnownArray(-1) !== undefined) - throw "Failed opaqueGetByValKnownArray(-1)"; -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-1.js b/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-1.js deleted file mode 100644 index be3afb1ac4..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-1.js +++ /dev/null @@ -1,63 +0,0 @@ -"use strict" - -// Test in-bounds access. -function opaqueGetByVal1(array, index) { - return array[index]; -} -noInline(opaqueGetByVal1); - -function testAccessInBounds() { - const target = new Array(100); - - // We start with an original array. Those GetByVal can be eliminated. - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal1(target, i % 100); - if (value !== undefined) - throw "opaqueGetByVal1() case 1 failed for i = " + i + " value = " + value; - } - - Array.prototype[42] = "Uh!"; - - for (let i = 0; i < 1e4; ++i) { - const index = i % 100; - const value = opaqueGetByVal1(target, index); - if (index == 42) { - if (value !== "Uh!") - throw "opaqueGetByVal1() case 2 failed on 42, value = " + value; - } else if (value !== undefined) - throw "opaqueGetByVal1() case 2 failed for i = " + i + " value = " + value; - } - - delete Array.prototype[42]; -} -testAccessInBounds(); - -// Test in-bounds access. -function opaqueGetByVal2(array, index) { - return array[index]; -} -noInline(opaqueGetByVal2); - -function testAccessOnEmpty() { - const target = new Array(); - - // We start with an original array. Those GetByVal can be eliminated. - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal2(target, i % 100); - if (value !== undefined) - throw "opaqueGetByVal2() case 1 failed for i = " + i + " value = " + value; - } - - Array.prototype[5] = "Uh!"; - - for (let i = 0; i < 1e4; ++i) { - const index = i % 100; - const value = opaqueGetByVal2(target, index); - if (index == 5) { - if (value !== "Uh!") - throw "opaqueGetByVal2() case 2 failed on 42, value = " + value; - } else if (value !== undefined) - throw "opaqueGetByVal2() case 2 failed for i = " + i + " value = " + value; - } -} -testAccessOnEmpty(); diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-2.js b/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-2.js deleted file mode 100644 index 22450a0290..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-2.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict" - -// Test in-bounds access. -function opaqueGetByVal1(array, index) { - return array[index]; -} -noInline(opaqueGetByVal1); - -function testAccessInBounds() { - const target = new Array(100); - - // We start with an original array. Those GetByVal can be eliminated. - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal1(target, i % 100); - if (value !== undefined) - throw "opaqueGetByVal1() case 1 failed for i = " + i + " value = " + value; - } - - Object.prototype[42] = "Uh!"; - - for (let i = 0; i < 1e4; ++i) { - const index = i % 100; - const value = opaqueGetByVal1(target, index); - if (index == 42) { - if (value !== "Uh!") - throw "opaqueGetByVal1() case 2 failed on 42, value = " + value; - } else if (value !== undefined) - throw "opaqueGetByVal1() case 2 failed for i = " + i + " value = " + value; - } -} -testAccessInBounds(); - -// Test in-bounds access. -function opaqueGetByVal2(array, index) { - return array[index]; -} -noInline(opaqueGetByVal2); - -function testAccessOnEmpty() { - const target = new Array(); - - for (let i = 0; i < 1e4; ++i) { - const index = i % 100; - const value = opaqueGetByVal2(target, index); - if (index == 42) { - if (value !== "Uh!") - throw "opaqueGetByVal2() case 2 failed on 42, value = " + value; - } else if (value !== undefined) - throw "opaqueGetByVal2() case 2 failed for i = " + i + " value = " + value; - } -} -testAccessOnEmpty(); diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-3.js b/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-3.js deleted file mode 100644 index ef1c404d74..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-3.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict" - -// Test in-bounds access. -function opaqueGetByVal1(array, index) { - return array[index]; -} -noInline(opaqueGetByVal1); - -function testUninitializedArray() { - const target = new Array(100); - - // We start with an original array. Those GetByVal can be eliminated. - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal1(target, i); - if (value !== undefined) - throw "opaqueGetByVal1() case 1 failed for i = " + i + " value = " + value; - } - - Array.prototype[-1] = "Uh!"; - - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal1(target, i); - if (value !== undefined) - throw "opaqueGetByVal1() case 2 failed for i = " + i + " value = " + value; - } - const prototypeValue = opaqueGetByVal1(target, -1) - if (prototypeValue !== "Uh!") - throw "prototypeValue value = " + value; - -} -testUninitializedArray(); - -// Test in-bounds access. -function opaqueGetByVal2(array, index) { - return array[index]; -} -noInline(opaqueGetByVal2); - -function testAccessOnEmpty() { - const target = new Array(); - - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal2(target, i); - if (value !== undefined) - throw "opaqueGetByVal2() case 1 failed for i = " + i + " value = " + value; - } - const prototypeValue = opaqueGetByVal2(target, -1) - if (prototypeValue !== "Uh!") - throw "prototypeValue value = " + value; -} -testAccessOnEmpty(); diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-4.js b/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-4.js deleted file mode 100644 index f11d9744c3..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-4.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict" - -// Test in-bounds access. -function opaqueGetByVal1(array, index) { - return array[index]; -} -noInline(opaqueGetByVal1); - -const IntMax = Math.pow(2, 31) - 1; - -function testUninitializedArray() { - const target = new Array(100); - - // We start with an original array. Those GetByVal can be eliminated. - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal1(target, i); - if (value !== undefined) - throw "opaqueGetByVal1() case 1 failed for i = " + i + " value = " + value; - } - - Array.prototype[IntMax] = "Uh!"; - - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal1(target, i); - if (value !== undefined) - throw "opaqueGetByVal1() case 2 failed for i = " + i + " value = " + value; - } - const prototypeValue = opaqueGetByVal1(target, IntMax) - if (prototypeValue !== "Uh!") - throw "prototypeValue value = " + value; - -} -testUninitializedArray(); - -// Test in-bounds access. -function opaqueGetByVal2(array, index) { - return array[index]; -} -noInline(opaqueGetByVal2); - -function testAccessOnEmpty() { - const target = new Array(); - - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal2(target, i); - if (value !== undefined) - throw "opaqueGetByVal2() case 1 failed for i = " + i + " value = " + value; - } - const prototypeValue = opaqueGetByVal2(target, IntMax) - if (prototypeValue !== "Uh!") - throw "prototypeValue value = " + value; -} -testAccessOnEmpty(); diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-5.js b/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-5.js deleted file mode 100644 index 4334db3584..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-5.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict" - -// Test in-bounds access. -function opaqueGetByVal1(array, index) { - return array[index]; -} -noInline(opaqueGetByVal1); - -const IntMaxPlusOne = Math.pow(2, 31); - -function testUninitializedArray() { - const target = new Array(100); - - // We start with an original array. Those GetByVal can be eliminated. - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal1(target, i); - if (value !== undefined) - throw "opaqueGetByVal1() case 1 failed for i = " + i + " value = " + value; - } - - Array.prototype[IntMaxPlusOne] = "Uh!"; - - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal1(target, i); - if (value !== undefined) - throw "opaqueGetByVal1() case 2 failed for i = " + i + " value = " + value; - } - const prototypeValue = opaqueGetByVal1(target, IntMaxPlusOne) - if (prototypeValue !== "Uh!") - throw "prototypeValue value = " + value; - -} -testUninitializedArray(); - -// Test in-bounds access. -function opaqueGetByVal2(array, index) { - return array[index]; -} -noInline(opaqueGetByVal2); - -function testAccessOnEmpty() { - const target = new Array(); - - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal2(target, i); - if (value !== undefined) - throw "opaqueGetByVal2() case 1 failed for i = " + i + " value = " + value; - } - const prototypeValue = opaqueGetByVal2(target, IntMaxPlusOne) - if (prototypeValue !== "Uh!") - throw "prototypeValue value = " + value; -} -testAccessOnEmpty(); diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-6.js b/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-6.js deleted file mode 100644 index e24a7c2258..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-sane-chain-6.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict" - -// Test in-bounds access. -function opaqueGetByVal1(array, index) { - return array[index]; -} -noInline(opaqueGetByVal1); - -// The max unsigned 32bits integer is the first integer not considered an indexing property. -const NotIndexInteger = 0xFFFFFFFF; - -function testUninitializedArray() { - const target = new Array(100); - - // We start with an original array. Those GetByVal can be eliminated. - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal1(target, i); - if (value !== undefined) - throw "opaqueGetByVal1() case 1 failed for i = " + i + " value = " + value; - } - - Array.prototype[NotIndexInteger] = "Uh!"; - - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal1(target, i); - if (value !== undefined) - throw "opaqueGetByVal1() case 2 failed for i = " + i + " value = " + value; - } - const prototypeValue = opaqueGetByVal1(target, NotIndexInteger) - if (prototypeValue !== "Uh!") - throw "prototypeValue value = " + value; - -} -testUninitializedArray(); - -// Test in-bounds access. -function opaqueGetByVal2(array, index) { - return array[index]; -} -noInline(opaqueGetByVal2); - -function testAccessOnEmpty() { - const target = new Array(); - - for (let i = 0; i < 1e4; ++i) { - const value = opaqueGetByVal2(target, i); - if (value !== undefined) - throw "opaqueGetByVal2() case 1 failed for i = " + i + " value = " + value; - } - const prototypeValue = opaqueGetByVal2(target, NotIndexInteger) - if (prototypeValue !== "Uh!") - throw "prototypeValue value = " + value; -} -testAccessOnEmpty(); diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-trivial.js b/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-trivial.js deleted file mode 100644 index 22e371c015..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-on-undecided-trivial.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict" - -// Trivial case where everything could be eliminated. -function iterateEmptyArray() -{ - const array = new Array(); - for (let i = 0; i < 100; ++i) { - if (array[i] !== undefined) - throw "Unexpected value in empty array at index i = " + i; - } -} -noInline(iterateEmptyArray); - -for (let i = 1e4; i--;) { - iterateEmptyArray(); -} - -// Trivial case but the array needs to be checked. -function getArrayOpaque() -{ - return new Array(10); -} -noInline(getArrayOpaque); - -function iterateOpaqueEmptyArray() -{ - const array = getArrayOpaque(); - for (let i = 0; i < 100; ++i) { - if (array[i] !== undefined) - throw "Unexpected value in empty array at index i = " + i; - } -} -noInline(iterateEmptyArray); - -for (let i = 1e4; i--;) { - iterateOpaqueEmptyArray(); -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-out-of-bounds-basics.js b/implementation-contributed/javascriptcore/stress/get-by-val-out-of-bounds-basics.js deleted file mode 100644 index 0d70fd47cd..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-out-of-bounds-basics.js +++ /dev/null @@ -1,221 +0,0 @@ -// Get early out-of-bound data. -function opaqueGetByValOnInt32ArrayEarlyOutOfBounds(array, index) -{ - return array[index]; -} -noInline(opaqueGetByValOnInt32ArrayEarlyOutOfBounds); - -function testInt32ArrayEarlyOutOfBounds() -{ - // Warm up with an immediate out of bounds. - var int32Array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; - for (var i = 0; i <= 10; ++i) { - var value = opaqueGetByValOnInt32ArrayEarlyOutOfBounds(int32Array, i); - if ((i < 10 && value !== i) || (i >= 10 && value !== undefined)) - throw "Failed opaqueGetByValOnInt32ArrayEarlyOutOfBounds(int32Array, i) warmup with i = " + i + " value = " + value; - } - - // We then do plenty of in-bounds accesses. - for (var i = 0; i < 1e4; ++i) { - for (var j = 0; j < 10; ++j) { - var value = opaqueGetByValOnInt32ArrayEarlyOutOfBounds(int32Array, j); - if (j < 10 && value !== j) - throw "Failed opaqueGetByValOnInt32ArrayEarlyOutOfBounds(int32Array, j) in-bounds with j = " + j + " value = " + value; - } - } - - // Followed by plenty of out-of-bounds accesses. - for (var i = 0; i < 1e4; ++i) { - for (var j = 0; j <= 10; ++j) { - var value = opaqueGetByValOnInt32ArrayEarlyOutOfBounds(int32Array, j); - if ((j < 10 && value !== j) || (j >= 10 && value !== undefined)) - throw "Failed opaqueGetByValOnInt32ArrayEarlyOutOfBounds(int32Array, j) out-of-bounds with j = " + j + " value = " + value; - } - } -} -testInt32ArrayEarlyOutOfBounds(); - -// One more access, with a completely different array type. -function testIndexingTypeChangesOnInt32Array() -{ - var doubleArray = [-0, 5.5, -42.1]; - var value = opaqueGetByValOnInt32ArrayEarlyOutOfBounds(doubleArray, 0); - if (value || 1 / value !== -Infinity) - throw "Failed opaqueGetByValOnInt32ArrayEarlyOutOfBounds(doubleArray, 0)"; - var value = opaqueGetByValOnInt32ArrayEarlyOutOfBounds(doubleArray, 1); - if (value !== 5.5) - throw "Failed opaqueGetByValOnInt32ArrayEarlyOutOfBounds(doubleArray, 1)"; - var value = opaqueGetByValOnInt32ArrayEarlyOutOfBounds(doubleArray, 2); - if (value !== -42.1) - throw "Failed opaqueGetByValOnInt32ArrayEarlyOutOfBounds(doubleArray, 2)"; -} -testIndexingTypeChangesOnInt32Array(); - - - -// Get out-of-bound data after a thousand run. -function opaqueGetByValOnStringArrayHotOutOfBounds(array, index) -{ - return array[index]; -} -noInline(opaqueGetByValOnStringArrayHotOutOfBounds); - -function testStringArrayHotOutOfBounds() -{ - // Warm up with in bounds access. - var stringArray = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]; - for (var i = 0; i < 1e2; ++i) { - for (var j = 0; j < 10; ++j) { - var value = opaqueGetByValOnStringArrayHotOutOfBounds(stringArray, j); - if (value !== "" + j) - throw "Failed opaqueGetByValOnStringArrayHotOutOfBounds(stringArray, j) in-bounds with j = " + j + " value = " + value; - } - } - - // Do a single out of bounds after warmup. - var value = opaqueGetByValOnStringArrayHotOutOfBounds(stringArray, 10); - if (value !== undefined) - throw "Failed opaqueGetByValOnStringArrayHotOutOfBounds(stringArray, 10) with i = " + i + " value = " + value; - - // We then do plenty of in-bounds accesses. - for (var i = 0; i < 1e3; ++i) { - for (var j = 0; j < 10; ++j) { - var value = opaqueGetByValOnStringArrayHotOutOfBounds(stringArray, j); - if (value !== "" + j) - throw "Failed opaqueGetByValOnStringArrayHotOutOfBounds(stringArray, j) in-bounds with j = " + j + " value = " + value; - } - } - - // Followed by plenty of out-of-bounds accesses. - for (var i = 0; i < 1e3; ++i) { - for (var j = 0; j <= 10; ++j) { - var value = opaqueGetByValOnStringArrayHotOutOfBounds(stringArray, j); - if ((j < 10 && value !== "" + j) || (j >= 10 && value !== undefined)) - throw "Failed opaqueGetByValOnStringArrayHotOutOfBounds(stringArray, j) out-of-bounds with j = " + j + " value = " + value; - } - } -} -testStringArrayHotOutOfBounds(); - -function testIndexingTypeChangesOnStringArray() -{ - var doubleArray = [-0, 5.5, -42.1]; - var value = opaqueGetByValOnStringArrayHotOutOfBounds(doubleArray, 0); - if (value || 1 / value !== -Infinity) - throw "Failed opaqueGetByValOnStringArrayHotOutOfBounds(doubleArray, 0)"; - var value = opaqueGetByValOnStringArrayHotOutOfBounds(doubleArray, 1); - if (value !== 5.5) - throw "Failed opaqueGetByValOnStringArrayHotOutOfBounds(doubleArray, 1)"; - var value = opaqueGetByValOnStringArrayHotOutOfBounds(doubleArray, 2); - if (value !== -42.1) - throw "Failed opaqueGetByValOnStringArrayHotOutOfBounds(doubleArray, 2)"; -} -testIndexingTypeChangesOnStringArray(); - - - -// Get out-of-bound data after a thousand run, but from a different array type. -function opaqueGetByValOnStringAndInt32ArrayHotOutOfBounds(array, index) -{ - return array[index]; -} -noInline(opaqueGetByValOnStringAndInt32ArrayHotOutOfBounds); - -function testStringAndInt32ArrayHotOutOfBounds() -{ - // Warm up with in bounds access. - var stringArray = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]; - for (var i = 0; i < 1e2; ++i) { - for (var j = 0; j < 10; ++j) { - var value = opaqueGetByValOnStringAndInt32ArrayHotOutOfBounds(stringArray, j); - if (value !== "" + j) - throw "Failed opaqueGetByValOnStringAndInt32ArrayHotOutOfBounds(stringArray, j) in-bounds with j = " + j + " value = " + value; - } - } - - // Do a single out of bounds after warmup. - var int32Array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; - var value = opaqueGetByValOnStringAndInt32ArrayHotOutOfBounds(int32Array, 10); - if (value !== undefined) - throw "Failed opaqueGetByValOnStringAndInt32ArrayHotOutOfBounds(stringArray, 10) with i = " + i + " value = " + value; - - // We then do plenty of in-bounds accesses. - for (var i = 0; i < 1e3; ++i) { - for (var j = 0; j < 10; ++j) { - var value = opaqueGetByValOnStringAndInt32ArrayHotOutOfBounds(stringArray, j); - if (value !== "" + j) - throw "Failed opaqueGetByValOnStringAndInt32ArrayHotOutOfBounds(stringArray, j) in-bounds with j = " + j + " value = " + value; - - var value = opaqueGetByValOnStringAndInt32ArrayHotOutOfBounds(int32Array, j); - if (value !== j) - throw "Failed opaqueGetByValOnStringAndInt32ArrayHotOutOfBounds(int32Array, j) in-bounds with j = " + j + " value = " + value; - } - } - - // Followed by plenty of out-of-bounds accesses. - for (var i = 0; i < 1e3; ++i) { - for (var j = 0; j <= 10; ++j) { - var value = opaqueGetByValOnStringAndInt32ArrayHotOutOfBounds(int32Array, j); - if ((j < 10 && value !== j) || (j >= 10 && value !== undefined)) - throw "Failed opaqueGetByValOnStringAndInt32ArrayHotOutOfBounds(int32Array, j) out-of-bounds with j = " + j + " value = " + value; - - var value = opaqueGetByValOnStringAndInt32ArrayHotOutOfBounds(stringArray, j); - if ((j < 10 && value !== "" + j) || (j >= 10 && value !== undefined)) - throw "Failed opaqueGetByValOnStringAndInt32ArrayHotOutOfBounds(stringArray, j) out-of-bounds with j = " + j + " value = " + value; - } - } -} -testStringAndInt32ArrayHotOutOfBounds(); - - -// Get out-of-bound data from a hole after a thousand run. -function opaqueGetByValOnDoubleArrayHotOutOfBounds(array, index) -{ - return array[index]; -} -noInline(opaqueGetByValOnDoubleArrayHotOutOfBounds); - -function testStringArrayHotOutOfBounds() -{ - // Warm up with in bounds access. - var doubleArray = new Array(10); - for (var i = 0; i < 10; ++i) { - if (i !== 5) - doubleArray[i] = i + 0.5; - } - for (var i = 0; i < 1e2; ++i) { - for (var j = 0; j < 10; ++j) { - if (j !== 5) { - var value = opaqueGetByValOnDoubleArrayHotOutOfBounds(doubleArray, j); - if (value !== j + 0.5) - throw "Failed opaqueGetByValOnDoubleArrayHotOutOfBounds(doubleArray, j) in-bounds with j = " + j + " value = " + value; - } - } - } - - // Do a single out of bounds after warmup. - var value = opaqueGetByValOnDoubleArrayHotOutOfBounds(doubleArray, 5); - if (value !== undefined) - throw "Failed opaqueGetByValOnDoubleArrayHotOutOfBounds(doubleArray, 5) with i = " + i + " value = " + value; - - // We then do plenty of in-bounds accesses. - for (var i = 0; i < 1e3; ++i) { - for (var j = 0; j < 10; ++j) { - if (j !== 5) { - var value = opaqueGetByValOnDoubleArrayHotOutOfBounds(doubleArray, j); - if (value !== j + 0.5) - throw "Failed opaqueGetByValOnDoubleArrayHotOutOfBounds(doubleArray, j) in-bounds with j = " + j + " value = " + value; - } - } - } - - // Followed by plenty of out-of-bounds accesses. - for (var i = 0; i < 1e3; ++i) { - for (var j = 0; j < 10; ++j) { - var value = opaqueGetByValOnDoubleArrayHotOutOfBounds(doubleArray, j); - if ((j !== 5 && value !== j + 0.5) || (j === 10 && value !== undefined)) - throw "Failed opaqueGetByValOnDoubleArrayHotOutOfBounds(doubleArray, j) out-of-bounds with j = " + j + " value = " + value; - } - } -} -testStringArrayHotOutOfBounds(); \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-string.js b/implementation-contributed/javascriptcore/stress/get-by-val-string.js deleted file mode 100644 index 7d77ec02de..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-string.js +++ /dev/null @@ -1,66 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var object = {}; -object[42] = 42; -object[43] = function tag() { return 42; }; - -shouldBe(object['43']`Hello`, 42); - - -class Hello { - constructor() - { - this['44'] = 42; - shouldBe(this['42'], 42); - shouldBe(this['43'](), 42); - shouldBe(this['44'], 42); - } - - get 42() - { - return 42; - } - - 43() - { - return 42; - } -} - -class Derived extends Hello { - constructor() - { - super(); - shouldBe(super['42'], 42); - shouldBe(super['43'](), 42); - shouldBe(this['44']++, 42); - shouldBe(++this['44'], 44); - } -} - -var derived = new Derived(); - -var test = { 42: '' }; - -for (test['42'] in { a: 'a' }) - shouldBe(test['42'], 'a'); -shouldBe(test['42'], 'a'); - -for (test['42'] of [ 'b' ]) - shouldBe(test['42'], 'b'); -shouldBe(test['42'], 'b'); - -{ - let { '42': a } = { '42': '42' }; - shouldBe(a, '42'); -} - -{ - let object = { 42: 42 }; - let objectAlias = object; - object['42'] = (object = 30); - shouldBe(objectAlias['42'], 30); -} diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-to-id-with-getter.js b/implementation-contributed/javascriptcore/stress/get-by-val-to-id-with-getter.js deleted file mode 100644 index b46c16516e..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-to-id-with-getter.js +++ /dev/null @@ -1,25 +0,0 @@ - -// Test GetByVal => GetById conversion works correctly when inlining a getter in the DFG. -function foo(obj, val) { - if (obj[val]) { - return 1; - } - return 0; -} -noInline(foo); - - -o = { num: 0, - get hello() { - if (this.num === 1) - return true; - return false; - } - }; - -for(i = 0; i < 100000; ++i) { - let num = i % 2; - o.num = num; - if (foo(o, "hello") !== num) - throw new Error("bad result on iteration: " + i); -} diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-with-string-constructor.js b/implementation-contributed/javascriptcore/stress/get-by-val-with-string-constructor.js deleted file mode 100644 index ac5851602e..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-with-string-constructor.js +++ /dev/null @@ -1,23 +0,0 @@ -var symbol = "@@species"; -function Hello() { -} - -Object.defineProperty(Hello, symbol, { - get: function () { - return this; - } -}); - -Hello.prototype.generate = function () { - return new this.constructor[symbol](); -}; - -function ok() { - var object = new Hello(); - if (!(object.generate() instanceof Hello)) - throw new Error("bad instance"); -} -noInline(ok); - -for (var i = 0; i < 10000; ++i) - ok(); diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-with-string-exit.js b/implementation-contributed/javascriptcore/stress/get-by-val-with-string-exit.js deleted file mode 100644 index 9aa262d64a..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-with-string-exit.js +++ /dev/null @@ -1,34 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function getByVal(object, name) -{ - return object[name]; -} -noInline(getByVal); - -function getStr1() -{ - return "hello"; -} -noInline(getStr1); - -function getStr2() -{ - return "hello"; -} -noInline(getStr2); - -var object = { - hello: 42 -}; - -for (var i = 0; i < 100; ++i) - shouldBe(getByVal(object, i % 2 === 0 ? getStr1() : getStr2()), 42); -shouldBe(getByVal(object, { toString() { return 'hello'; } }), 42); - -for (var i = 0; i < 10000; ++i) - shouldBe(getByVal(object, i % 2 === 0 ? getStr1() : getStr2()), 42); -shouldBe(getByVal(object, { toString() { return 'hello'; } }), 42); diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-with-string-generated.js b/implementation-contributed/javascriptcore/stress/get-by-val-with-string-generated.js deleted file mode 100644 index e813a7e140..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-with-string-generated.js +++ /dev/null @@ -1,33 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function getByVal(object, name) -{ - return object[name]; -} -noInline(getByVal); - -var value = 'lo'; - -function getStr1() -{ - return "hel" + value; -} -noInline(getStr1); - -function getStr2() -{ - return "hello"; -} -noInline(getStr2); - -var object = { - hello: 42, - world: 50 -}; - -for (var i = 0; i < 10000; ++i) - shouldBe(getByVal(object, i % 2 === 0 ? getStr1() : getStr2()), 42); -shouldBe(getByVal(object, 'world'), 50); diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-with-string-getter.js b/implementation-contributed/javascriptcore/stress/get-by-val-with-string-getter.js deleted file mode 100644 index 858ec0a86d..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-with-string-getter.js +++ /dev/null @@ -1,16 +0,0 @@ - -var object = { - get hello() { - return 42; - } -}; - -function ok() { - var value = 'hello'; - if (object[value] + 20 !== 62) - throw new Error(); -} -noInline(ok); - -for (var i = 0; i < 10000; ++i) - ok(); diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-with-string.js b/implementation-contributed/javascriptcore/stress/get-by-val-with-string.js deleted file mode 100644 index 6db33d9bec..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-with-string.js +++ /dev/null @@ -1,31 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function getByVal(object, name) -{ - return object[name]; -} -noInline(getByVal); - -function getStr1() -{ - return "hello"; -} -noInline(getStr1); - -function getStr2() -{ - return "hello"; -} -noInline(getStr2); - -var object = { - hello: 42, - world: 50 -}; - -for (var i = 0; i < 10000; ++i) - shouldBe(getByVal(object, i % 2 === 0 ? getStr1() : getStr2()), 42); -shouldBe(getByVal(object, 'world'), 50); diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-with-symbol-constructor.js b/implementation-contributed/javascriptcore/stress/get-by-val-with-symbol-constructor.js deleted file mode 100644 index 2895c26451..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-with-symbol-constructor.js +++ /dev/null @@ -1,23 +0,0 @@ -var symbol = Symbol(); -function Hello() { -} - -Object.defineProperty(Hello, symbol, { - get: function () { - return this; - } -}); - -Hello.prototype.generate = function () { - return new this.constructor[symbol](); -}; - -function ok() { - var object = new Hello(); - if (!(object.generate() instanceof Hello)) - throw new Error("bad instance"); -} -noInline(ok); - -for (var i = 0; i < 10000; ++i) - ok(); diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-with-symbol-exit.js b/implementation-contributed/javascriptcore/stress/get-by-val-with-symbol-exit.js deleted file mode 100644 index c0cdcb676d..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-with-symbol-exit.js +++ /dev/null @@ -1,38 +0,0 @@ -var symbol1 = Symbol(); -var symbol2 = Object.getOwnPropertySymbols({ [symbol1]: 42 })[0]; - -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function getByVal(object, name) -{ - return object[name]; -} -noInline(getByVal); - -function getSym1() -{ - return symbol1; -} -noInline(getSym1); - -function getSym2() -{ - return symbol2; -} -noInline(getSym2); - -var object = { - [symbol1]: 42, - hello: 50 -}; - -for (var i = 0; i < 100; ++i) - shouldBe(getByVal(object, i % 2 === 0 ? getSym1() : getSym2()), 42); -shouldBe(getByVal(object, 'hello'), 50); - -for (var i = 0; i < 10000; ++i) - shouldBe(getByVal(object, i % 2 === 0 ? getSym1() : getSym2()), 42); -shouldBe(getByVal(object, 'hello'), 50); diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-with-symbol-getter.js b/implementation-contributed/javascriptcore/stress/get-by-val-with-symbol-getter.js deleted file mode 100644 index 7035e4b038..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-with-symbol-getter.js +++ /dev/null @@ -1,23 +0,0 @@ - -var object = { - get hello() { - return 42; - } -}; - -var symbol = Symbol(); - -Object.defineProperty(object, symbol, { - get: function () { - return 42; - } -}); - -function ok() { - if (object[symbol] + 20 !== 62) - throw new Error(); -} -noInline(ok); - -for (var i = 0; i < 10000; ++i) - ok(); diff --git a/implementation-contributed/javascriptcore/stress/get-by-val-with-symbol.js b/implementation-contributed/javascriptcore/stress/get-by-val-with-symbol.js deleted file mode 100644 index 2c834eb26b..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-by-val-with-symbol.js +++ /dev/null @@ -1,33 +0,0 @@ -var symbol1 = Symbol(); -var symbol2 = Object.getOwnPropertySymbols({ [symbol1]: 42 })[0]; - -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function getByVal(object, name) -{ - return object[name]; -} -noInline(getByVal); - -function getSym1() -{ - return symbol1; -} -noInline(getSym1); - -function getSym2() -{ - return symbol2; -} -noInline(getSym2); - -var object = { - [symbol1]: 42, - hello: 50 -}; - -for (var i = 0; i < 10000; ++i) - shouldBe(getByVal(object, i % 2 === 0 ? getSym1() : getSym2()), 42); diff --git a/implementation-contributed/javascriptcore/stress/get-declared-unpassed-argument-in-direct-arguments.js b/implementation-contributed/javascriptcore/stress/get-declared-unpassed-argument-in-direct-arguments.js deleted file mode 100644 index 57d380afbb..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-declared-unpassed-argument-in-direct-arguments.js +++ /dev/null @@ -1,13 +0,0 @@ -function foo(a) { - if (!effectful42()) - return arguments; - return a; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(); - if (result !== void 0) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/get-declared-unpassed-argument-in-scoped-arguments.js b/implementation-contributed/javascriptcore/stress/get-declared-unpassed-argument-in-scoped-arguments.js deleted file mode 100644 index a85cd9537b..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-declared-unpassed-argument-in-scoped-arguments.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo(a) { - if (!effectful42()) { - (function() { a = 43; })(); - return arguments; - } - return a; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(); - if (result !== void 0) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/get-from-scope-dynamic-onto-proxy.js b/implementation-contributed/javascriptcore/stress/get-from-scope-dynamic-onto-proxy.js deleted file mode 100644 index bb9cbca687..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-from-scope-dynamic-onto-proxy.js +++ /dev/null @@ -1,106 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -// LLInt slow path operation. -shouldThrow(function () { - var target = {}; - var handler = { - has: function (receiver, name) - { - return name === 'i'; - }, - get: function (target, name, receiver) - { - if (name === 'i') - throw new Error("NG"); - return 42; - } - }; - var proxy = new Proxy(target, handler); - with (proxy) { - i; - } -}, `Error: NG`); - -// Baseline JIT operation. -shouldThrow(function () { - var flag = false; - var target = {}; - var handler = { - has: function (receiver, name) - { - return name === 'i'; - }, - get: function (target, name, receiver) - { - if (name === 'i' && flag) - throw new Error("NG"); - return 42; - } - }; - var proxy = new Proxy(target, handler); - for (var i = 0; i < 1e4; ++i) { - with (proxy) { - i; - } - if (i === 1e3) - flag = true; - } -}, `Error: NG`); - -// DFG JIT operation. -var thrown = null; -try { - (() => { - var flag = false; - var target = { - __proto__: null - }; - var handler = { - has: function (receiver, name) - { - return name === 'arguments'; - }, - - get: function (target, name, receiver) - { - if (name === 'arguments' && flag) - throw new Error("NG"); - return 42; - } - }; - var proxy = new Proxy(target, handler); - proxy.__proto__ = null; - Object.prototype.__proto__ = { - __proto__: proxy, - }; - (() => { - for (var i = 0; i < 1e4; ++i) { - arguments; - if (i === (1e4 - 2)) - flag = true; - } - })(); - })(); -} catch (e) { - thrown = e; -} -Object.prototype.__proto__ = null; -shouldBe(String(thrown), `TypeError: Cannot set prototype of immutable prototype object`); diff --git a/implementation-contributed/javascriptcore/stress/get-local-elimination.js b/implementation-contributed/javascriptcore/stress/get-local-elimination.js deleted file mode 100644 index 612f9d51a9..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-local-elimination.js +++ /dev/null @@ -1,15 +0,0 @@ -var True = true; - -function foo(a) { - var x = a; - if (True) - return a + x; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(42); - if (result != 84) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-constant-folding.js b/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-constant-folding.js deleted file mode 100644 index 1eb8b0372f..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-constant-folding.js +++ /dev/null @@ -1,14 +0,0 @@ -function test() { - for (var i = 0; i < 1000000; ++i) { - try { - (function () { - return arguments[-9]; - })(42); - } catch (e) {} - } -} -noInline(test); - -try { - test(42); -} catch (e) {} diff --git a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-creates-arguments.js b/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-creates-arguments.js deleted file mode 100644 index ec8c0cf3e1..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-creates-arguments.js +++ /dev/null @@ -1,42 +0,0 @@ -function blah(args) { - var array = []; - for (var i = 0; i < args.length; ++i) - array.push(args[i]); - return array; -} - -function foo() { - // Force creation of arguments by doing out-of-bounds access. - var tmp = arguments[42]; - - // Use the created arguments object. - return blah(arguments); -} - -function bar(array) { - return foo.apply(this, array); -} - -noInline(blah); -noInline(bar); - -function checkEqual(a, b) { - if (a.length != b.length) - throw "Error: length mismatch: " + a + " versus " + b; - for (var i = a.length; i--;) { - if (a[i] != b[i]) - throw "Error: mismatch at i = " + i + ": " + a + " versus " + b; - } -} - -function test(array) { - var actual = bar(array); - checkEqual(actual, array); -} - -for (var i = 0; i < 10000; ++i) { - var array = []; - for (var j = 0; j < i % 6; ++j) - array.push(j); - test(array); -} diff --git a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-for-inlined-escaped-arguments.js b/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-for-inlined-escaped-arguments.js deleted file mode 100644 index f5bdd784ee..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-for-inlined-escaped-arguments.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo() { - return arguments; -} - -function bar(a, b, c, i) { - var args = foo(b, c, 42); - return args[i]; -} - -noInline(bar); - -var expected = [2, 3, 42]; -for (var i = 0; i < 10000; ++i) { - var result = bar(1, 2, 3, i % 3); - if (result != expected[i % 3]) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-inlined-no-formal-parameters.js b/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-inlined-no-formal-parameters.js deleted file mode 100644 index eef298f5b3..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-inlined-no-formal-parameters.js +++ /dev/null @@ -1,33 +0,0 @@ -var index; - -function foo() { - if (index >= 0) - return arguments[index]; - else - return 13; -} - -function bar() { - return foo(); -} - -noInline(bar); - -for (var i = 0; i < 100; ++i) { - index = i & 1; - var result = foo(42, 53); - if (result != [42, 53][index]) - throw "Error: bad result in first loop: " + result; -} - -for (var i = 0; i < 100000; ++i) { - index = -(i & 1) - 1; - var result = bar(); - if (result !== 13) - throw "Error: bad result in second loop: " + result; -} - -index = 0; -var result = bar(); -if (result !== void 0) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-out-of-bounds-no-warm-up.js b/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-out-of-bounds-no-warm-up.js deleted file mode 100644 index 5058e6bf1a..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-out-of-bounds-no-warm-up.js +++ /dev/null @@ -1,9 +0,0 @@ -function foo(index) { - return arguments[index]; -} - -noInline(foo); - -var result = foo(1); -if (result !== void 0) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-out-of-bounds.js b/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-out-of-bounds.js deleted file mode 100644 index c8ee317044..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-out-of-bounds.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo(index) { - return arguments[index]; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(1, 42); - if (result != 42) - throw "Error: bad result in loop: " + result; -} - -var result = foo(1); -if (result !== void 0) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-safe-out-of-bounds.js b/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-safe-out-of-bounds.js deleted file mode 100644 index 3737db6d77..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-safe-out-of-bounds.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo(index) { - if (index > 1000) - arguments = [1, 2, 3]; - return arguments[index]; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(1, 42); - if (result != 42) - throw "Error: bad result in loop: " + result; -} - -var result = foo(1); -if (result !== void 0) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-safe-wrap-around.js b/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-safe-wrap-around.js deleted file mode 100644 index 4a7e3f8f32..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-safe-wrap-around.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo(index) { - if (index > 1000) - arguments = [1, 2, 3]; - return arguments[index]; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(1, 42); - if (result != 42) - throw "Error: bad result in loop: " + result; -} - -var result = foo(-1); -if (result !== void 0) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-wrap-around-no-warm-up.js b/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-wrap-around-no-warm-up.js deleted file mode 100644 index a6a16576cb..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-wrap-around-no-warm-up.js +++ /dev/null @@ -1,9 +0,0 @@ -function foo(index) { - return arguments[index]; -} - -noInline(foo); - -var result = foo(-1); -if (result !== void 0) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-wrap-around.js b/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-wrap-around.js deleted file mode 100644 index 770b451b8a..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-my-argument-by-val-wrap-around.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo(index) { - return arguments[index]; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(1, 42); - if (result != 42) - throw "Error: bad result in loop: " + result; -} - -var result = foo(-1); -if (result !== void 0) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/get-prototype-create-this-effectful.js b/implementation-contributed/javascriptcore/stress/get-prototype-create-this-effectful.js deleted file mode 100644 index 7b73e676a9..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-prototype-create-this-effectful.js +++ /dev/null @@ -1,40 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} - -function test1() { - let boundFunction = function () {}.bind(); - Object.defineProperty(boundFunction, "prototype", { - get() { - throw Error("Hello"); - } - }); - - let threw = false; - try { - Reflect.construct(function() {}, [], boundFunction); - } catch(e) { - threw = true; - assert(e.message === "Hello"); - } - assert(threw); -} -test1(); - -function test2() { - let boundFunction = function () {}.bind(); - let counter = 0; - Object.defineProperty(boundFunction, "prototype", { - get() { - ++counter; - return {}; - } - }); - - const iters = 1000; - for (let i = 0; i < iters; ++i) - Reflect.construct(function() {}, [], boundFunction); - assert(counter === iters); -} -test2(); diff --git a/implementation-contributed/javascriptcore/stress/get-stack-identity-due-to-sinking.js b/implementation-contributed/javascriptcore/stress/get-stack-identity-due-to-sinking.js deleted file mode 100644 index 7f74135446..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-stack-identity-due-to-sinking.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo(p, a) { - if (p) { - var tmp = arguments; - } - return a; -} - -function bar(p, a) { - return foo(p, a); -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var result = bar(false, 42); - if (result != 42) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/get-stack-mapping-with-dead-get-stack.js b/implementation-contributed/javascriptcore/stress/get-stack-mapping-with-dead-get-stack.js deleted file mode 100644 index e158ccb6c0..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-stack-mapping-with-dead-get-stack.js +++ /dev/null @@ -1,27 +0,0 @@ -function bar() { - if (foo.arguments[0] === void 0) - throw "Error: foo.arguments[0] should not be undefined but is." -} - -noInline(bar); - -function foo(a, p) { - var tmp = a; - effectful42(); - for (var i = 0; i < 10; ++i) { - bar(); - a = i; - } - if (p) { - var tmp = arguments; - } - return a; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(0, false); - if (result != 9) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/get-stack-mapping.js b/implementation-contributed/javascriptcore/stress/get-stack-mapping.js deleted file mode 100644 index c62f0de736..0000000000 --- a/implementation-contributed/javascriptcore/stress/get-stack-mapping.js +++ /dev/null @@ -1,26 +0,0 @@ -function bar() { - if (foo.arguments[0] === void 0) - throw "Error: foo.arguments[0] should not be undefined but is." -} - -noInline(bar); - -function foo(a, p) { - effectful42(); - for (var i = 0; i < 10; ++i) { - bar(); - a = i; - } - if (p) { - var tmp = arguments; - } - return a; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(0, false); - if (result != 9) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/instance-of-on-poly-proto-opc-should-not-crash.js b/implementation-contributed/javascriptcore/stress/instance-of-on-poly-proto-opc-should-not-crash.js deleted file mode 100644 index 8d3d1bc07a..0000000000 --- a/implementation-contributed/javascriptcore/stress/instance-of-on-poly-proto-opc-should-not-crash.js +++ /dev/null @@ -1,28 +0,0 @@ -function makePolyProtoObject() { - function foo() { - class C { - constructor() { - this._field = 42; - this.hello = 33; - } - }; - return new C; - } - for (let i = 0; i < 15; ++i) - foo(); - return foo(); -} - -function foo(o, c) { - return o instanceof c; -} -noInline(foo); - -class C { } - -let o = makePolyProtoObject(); -o.__proto__= new C; -let x = {__proto__: o}; -for (let i = 0; i < 1000; ++i) { - foo(x, C); -} diff --git a/implementation-contributed/javascriptcore/stress/instanceof-custom-hasinstancesymbol.js b/implementation-contributed/javascriptcore/stress/instanceof-custom-hasinstancesymbol.js deleted file mode 100644 index 12f24230c3..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof-custom-hasinstancesymbol.js +++ /dev/null @@ -1,24 +0,0 @@ -function Constructor(x) {} - -Object.defineProperty(Constructor, Symbol.hasInstance, {value: function() { return false; }}); - -x = new Constructor(); - -function instanceOf(a, b) { - return a instanceof b; -} -noInline(instanceOf); - -function body() { - var result = 0; - for (var i = 0; i < 100000; i++) { - if (instanceOf(x, Constructor)) - result++; - } - - return result; -} -noInline(body); - -if (body()) - throw "result incorrect"; diff --git a/implementation-contributed/javascriptcore/stress/instanceof-dynamic-proxy-check-structure.js b/implementation-contributed/javascriptcore/stress/instanceof-dynamic-proxy-check-structure.js deleted file mode 100644 index 0b86b538bf..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof-dynamic-proxy-check-structure.js +++ /dev/null @@ -1,159 +0,0 @@ -class Foo0 { } -class Foo1 { } -class Foo2 { } -class Foo3 { } -class Foo4 { } -class Foo5 { } -class Foo6 { } -class Foo7 { } -class Foo8 { } -class Foo9 { } -class Foo10 { } -class Foo11 { } -class Foo12 { } -class Foo13 { } -class Foo14 { } -class Foo15 { } -class Foo16 { } -class Foo17 { } -class Foo18 { } -class Foo19 { } -class Foo20 { } -class Foo21 { } -class Foo22 { } -class Foo23 { } -class Foo24 { } -class Foo25 { } -class Foo26 { } -class Foo27 { } -class Foo28 { } -class Foo29 { } -class Foo30 { } -class Foo31 { } -class Foo32 { } -class Foo33 { } -class Foo34 { } -class Foo35 { } -class Foo36 { } -class Foo37 { } -class Foo38 { } -class Foo39 { } -class Foo40 { } -class Foo41 { } -class Foo42 { } -class Foo43 { } -class Foo44 { } -class Foo45 { } -class Foo46 { } -class Foo47 { } -class Foo48 { } -class Foo49 { } -class Foo50 { } -class Foo51 { } -class Foo52 { } -class Foo53 { } -class Foo54 { } -class Foo55 { } -class Foo56 { } -class Foo57 { } -class Foo58 { } -class Foo59 { } -class Foo60 { } -class Foo61 { } -class Foo62 { } -class Foo63 { } -class Foo64 { } -class Foo65 { } -class Foo66 { } -class Foo67 { } -class Foo68 { } -class Foo69 { } -class Foo70 { } -class Foo71 { } -class Foo72 { } -class Foo73 { } -class Foo74 { } -class Foo75 { } -class Foo76 { } -class Foo77 { } -class Foo78 { } -class Foo79 { } -class Foo80 { } -class Foo81 { } -class Foo82 { } -class Foo83 { } -class Foo84 { } -class Foo85 { } -class Foo86 { } -class Foo87 { } -class Foo88 { } -class Foo89 { } -class Foo90 { } -class Foo91 { } -class Foo92 { } -class Foo93 { } -class Foo94 { } -class Foo95 { } -class Foo96 { } -class Foo97 { } -class Foo98 { } -class Foo99 { } - -var foos = [new Foo0(), new Foo1(), new Foo2(), new Foo3(), new Foo4(), new Foo5(), new Foo6(), new Foo7(), new Foo8(), new Foo9(), new Foo10(), new Foo11(), new Foo12(), new Foo13(), new Foo14(), new Foo15(), new Foo16(), new Foo17(), new Foo18(), new Foo19(), new Foo20(), new Foo21(), new Foo22(), new Foo23(), new Foo24(), new Foo25(), new Foo26(), new Foo27(), new Foo28(), new Foo29(), new Foo30(), new Foo31(), new Foo32(), new Foo33(), new Foo34(), new Foo35(), new Foo36(), new Foo37(), new Foo38(), new Foo39(), new Foo40(), new Foo41(), new Foo42(), new Foo43(), new Foo44(), new Foo45(), new Foo46(), new Foo47(), new Foo48(), new Foo49(), new Foo50(), new Foo51(), new Foo52(), new Foo53(), new Foo54(), new Foo55(), new Foo56(), new Foo57(), new Foo58(), new Foo59(), new Foo60(), new Foo61(), new Foo62(), new Foo63(), new Foo64(), new Foo65(), new Foo66(), new Foo67(), new Foo68(), new Foo69(), new Foo70(), new Foo71(), new Foo72(), new Foo73(), new Foo74(), new Foo75(), new Foo76(), new Foo77(), new Foo78(), new Foo79(), new Foo80(), new Foo81(), new Foo82(), new Foo83(), new Foo84(), new Foo85(), new Foo86(), new Foo87(), new Foo88(), new Foo89(), new Foo90(), new Foo91(), new Foo92(), new Foo93(), new Foo94(), new Foo95(), new Foo96(), new Foo97(), new Foo98(), new Foo99()]; - -class Foo { } - -function Bar() { } - -var numberOfGetPrototypeOfCalls = 0; - -var doBadThings = function() { }; - -Bar.prototype = new Proxy( - {}, - { - getPrototypeOf() - { - numberOfGetPrototypeOfCalls++; - doBadThings(); - return Foo.prototype; - } - }); - -// Break some watchpoints. -var o = {f:42}; -o.g = 43; - -function foo(o, p, q) -{ - var result = o.f; - var _ = p instanceof Foo; - q.f = 11; - return result + o.f; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo({f:42}, foos[i % foos.length], {f:0}); - if (result != 84) - throw "Error: bad result in loop: " + result; -} - -var globalO = {f:42}; -var didCallGetter = false; -doBadThings = function() { - delete globalO.f; - globalO.__defineGetter__("f", function() { - didCallGetter = true; - return 43; - }); -}; - -var result = foo(globalO, new Bar(), {f:0}); -if (result != 85) - throw "Error: bad result at end: " + result; -if (!didCallGetter) - throw "Error: did not call getter"; -if (numberOfGetPrototypeOfCalls != 1) - throw "Error: did not call getPrototypeOf() the right number of times at end"; diff --git a/implementation-contributed/javascriptcore/stress/instanceof-dynamic-proxy-loop.js b/implementation-contributed/javascriptcore/stress/instanceof-dynamic-proxy-loop.js deleted file mode 100644 index 50065e983e..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof-dynamic-proxy-loop.js +++ /dev/null @@ -1,159 +0,0 @@ -class Foo0 { } -class Foo1 { } -class Foo2 { } -class Foo3 { } -class Foo4 { } -class Foo5 { } -class Foo6 { } -class Foo7 { } -class Foo8 { } -class Foo9 { } -class Foo10 { } -class Foo11 { } -class Foo12 { } -class Foo13 { } -class Foo14 { } -class Foo15 { } -class Foo16 { } -class Foo17 { } -class Foo18 { } -class Foo19 { } -class Foo20 { } -class Foo21 { } -class Foo22 { } -class Foo23 { } -class Foo24 { } -class Foo25 { } -class Foo26 { } -class Foo27 { } -class Foo28 { } -class Foo29 { } -class Foo30 { } -class Foo31 { } -class Foo32 { } -class Foo33 { } -class Foo34 { } -class Foo35 { } -class Foo36 { } -class Foo37 { } -class Foo38 { } -class Foo39 { } -class Foo40 { } -class Foo41 { } -class Foo42 { } -class Foo43 { } -class Foo44 { } -class Foo45 { } -class Foo46 { } -class Foo47 { } -class Foo48 { } -class Foo49 { } -class Foo50 { } -class Foo51 { } -class Foo52 { } -class Foo53 { } -class Foo54 { } -class Foo55 { } -class Foo56 { } -class Foo57 { } -class Foo58 { } -class Foo59 { } -class Foo60 { } -class Foo61 { } -class Foo62 { } -class Foo63 { } -class Foo64 { } -class Foo65 { } -class Foo66 { } -class Foo67 { } -class Foo68 { } -class Foo69 { } -class Foo70 { } -class Foo71 { } -class Foo72 { } -class Foo73 { } -class Foo74 { } -class Foo75 { } -class Foo76 { } -class Foo77 { } -class Foo78 { } -class Foo79 { } -class Foo80 { } -class Foo81 { } -class Foo82 { } -class Foo83 { } -class Foo84 { } -class Foo85 { } -class Foo86 { } -class Foo87 { } -class Foo88 { } -class Foo89 { } -class Foo90 { } -class Foo91 { } -class Foo92 { } -class Foo93 { } -class Foo94 { } -class Foo95 { } -class Foo96 { } -class Foo97 { } -class Foo98 { } -class Foo99 { } - -var foos = [new Foo0(), new Foo1(), new Foo2(), new Foo3(), new Foo4(), new Foo5(), new Foo6(), new Foo7(), new Foo8(), new Foo9(), new Foo10(), new Foo11(), new Foo12(), new Foo13(), new Foo14(), new Foo15(), new Foo16(), new Foo17(), new Foo18(), new Foo19(), new Foo20(), new Foo21(), new Foo22(), new Foo23(), new Foo24(), new Foo25(), new Foo26(), new Foo27(), new Foo28(), new Foo29(), new Foo30(), new Foo31(), new Foo32(), new Foo33(), new Foo34(), new Foo35(), new Foo36(), new Foo37(), new Foo38(), new Foo39(), new Foo40(), new Foo41(), new Foo42(), new Foo43(), new Foo44(), new Foo45(), new Foo46(), new Foo47(), new Foo48(), new Foo49(), new Foo50(), new Foo51(), new Foo52(), new Foo53(), new Foo54(), new Foo55(), new Foo56(), new Foo57(), new Foo58(), new Foo59(), new Foo60(), new Foo61(), new Foo62(), new Foo63(), new Foo64(), new Foo65(), new Foo66(), new Foo67(), new Foo68(), new Foo69(), new Foo70(), new Foo71(), new Foo72(), new Foo73(), new Foo74(), new Foo75(), new Foo76(), new Foo77(), new Foo78(), new Foo79(), new Foo80(), new Foo81(), new Foo82(), new Foo83(), new Foo84(), new Foo85(), new Foo86(), new Foo87(), new Foo88(), new Foo89(), new Foo90(), new Foo91(), new Foo92(), new Foo93(), new Foo94(), new Foo95(), new Foo96(), new Foo97(), new Foo98(), new Foo99()]; - -class Foo { } - -function Bar() { } - -var numberOfGetPrototypeOfCalls = 0; - -var doBadThings = function() { }; - -Bar.prototype = new Proxy( - {}, - { - getPrototypeOf() - { - numberOfGetPrototypeOfCalls++; - doBadThings(); - return Foo.prototype; - } - }); - -// Break some watchpoints. -var o = {f:42}; -o.g = 43; - -function foo(o, p) -{ - var result = o.f; - for (var i = 0; i < 5; ++i) - var _ = p instanceof Foo; - return result + o.f; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo({f:42}, foos[i % foos.length]); - if (result != 84) - throw "Error: bad result in loop: " + result; -} - -var globalO = {f:42}; -var didCallGetter = false; -doBadThings = function() { - delete globalO.f; - globalO.__defineGetter__("f", function() { - didCallGetter = true; - return 43; - }); -}; - -var result = foo(globalO, new Bar()); -if (result != 85) - throw "Error: bad result at end: " + result; -if (!didCallGetter) - throw "Error: did not call getter"; -if (numberOfGetPrototypeOfCalls != 5) - throw "Error: did not call getPrototypeOf() the right number of times at end"; diff --git a/implementation-contributed/javascriptcore/stress/instanceof-dynamic-proxy.js b/implementation-contributed/javascriptcore/stress/instanceof-dynamic-proxy.js deleted file mode 100644 index 54abfcca6f..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof-dynamic-proxy.js +++ /dev/null @@ -1,150 +0,0 @@ -class Foo0 { } -class Foo1 { } -class Foo2 { } -class Foo3 { } -class Foo4 { } -class Foo5 { } -class Foo6 { } -class Foo7 { } -class Foo8 { } -class Foo9 { } -class Foo10 { } -class Foo11 { } -class Foo12 { } -class Foo13 { } -class Foo14 { } -class Foo15 { } -class Foo16 { } -class Foo17 { } -class Foo18 { } -class Foo19 { } -class Foo20 { } -class Foo21 { } -class Foo22 { } -class Foo23 { } -class Foo24 { } -class Foo25 { } -class Foo26 { } -class Foo27 { } -class Foo28 { } -class Foo29 { } -class Foo30 { } -class Foo31 { } -class Foo32 { } -class Foo33 { } -class Foo34 { } -class Foo35 { } -class Foo36 { } -class Foo37 { } -class Foo38 { } -class Foo39 { } -class Foo40 { } -class Foo41 { } -class Foo42 { } -class Foo43 { } -class Foo44 { } -class Foo45 { } -class Foo46 { } -class Foo47 { } -class Foo48 { } -class Foo49 { } -class Foo50 { } -class Foo51 { } -class Foo52 { } -class Foo53 { } -class Foo54 { } -class Foo55 { } -class Foo56 { } -class Foo57 { } -class Foo58 { } -class Foo59 { } -class Foo60 { } -class Foo61 { } -class Foo62 { } -class Foo63 { } -class Foo64 { } -class Foo65 { } -class Foo66 { } -class Foo67 { } -class Foo68 { } -class Foo69 { } -class Foo70 { } -class Foo71 { } -class Foo72 { } -class Foo73 { } -class Foo74 { } -class Foo75 { } -class Foo76 { } -class Foo77 { } -class Foo78 { } -class Foo79 { } -class Foo80 { } -class Foo81 { } -class Foo82 { } -class Foo83 { } -class Foo84 { } -class Foo85 { } -class Foo86 { } -class Foo87 { } -class Foo88 { } -class Foo89 { } -class Foo90 { } -class Foo91 { } -class Foo92 { } -class Foo93 { } -class Foo94 { } -class Foo95 { } -class Foo96 { } -class Foo97 { } -class Foo98 { } -class Foo99 { } - -var foos = [new Foo0(), new Foo1(), new Foo2(), new Foo3(), new Foo4(), new Foo5(), new Foo6(), new Foo7(), new Foo8(), new Foo9(), new Foo10(), new Foo11(), new Foo12(), new Foo13(), new Foo14(), new Foo15(), new Foo16(), new Foo17(), new Foo18(), new Foo19(), new Foo20(), new Foo21(), new Foo22(), new Foo23(), new Foo24(), new Foo25(), new Foo26(), new Foo27(), new Foo28(), new Foo29(), new Foo30(), new Foo31(), new Foo32(), new Foo33(), new Foo34(), new Foo35(), new Foo36(), new Foo37(), new Foo38(), new Foo39(), new Foo40(), new Foo41(), new Foo42(), new Foo43(), new Foo44(), new Foo45(), new Foo46(), new Foo47(), new Foo48(), new Foo49(), new Foo50(), new Foo51(), new Foo52(), new Foo53(), new Foo54(), new Foo55(), new Foo56(), new Foo57(), new Foo58(), new Foo59(), new Foo60(), new Foo61(), new Foo62(), new Foo63(), new Foo64(), new Foo65(), new Foo66(), new Foo67(), new Foo68(), new Foo69(), new Foo70(), new Foo71(), new Foo72(), new Foo73(), new Foo74(), new Foo75(), new Foo76(), new Foo77(), new Foo78(), new Foo79(), new Foo80(), new Foo81(), new Foo82(), new Foo83(), new Foo84(), new Foo85(), new Foo86(), new Foo87(), new Foo88(), new Foo89(), new Foo90(), new Foo91(), new Foo92(), new Foo93(), new Foo94(), new Foo95(), new Foo96(), new Foo97(), new Foo98(), new Foo99()]; - -class Foo { } - -function Bar() { } - -var numberOfGetPrototypeOfCalls = 0; - -var doBadThings = function() { }; - -Bar.prototype = new Proxy( - {}, - { - getPrototypeOf() - { - numberOfGetPrototypeOfCalls++; - doBadThings(); - return Foo.prototype; - } - }); - -var o = {f:42}; - -function foo(o, p) -{ - var result = o.f; - var _ = p instanceof Foo; - return result + o.f; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo({f:42}, foos[i % foos.length]); - if (result != 84) - throw "Error: bad result in loop: " + result; -} - -var globalO = {f:42}; -var didCallGetter = false; -doBadThings = function() { - globalO.f = 43; -}; - -var result = foo(globalO, new Bar()); -if (result != 85) - throw "Error: bad result at end: " + result; -if (numberOfGetPrototypeOfCalls != 1) - throw "Error: did not call getPrototypeOf() the right number of times at end"; diff --git a/implementation-contributed/javascriptcore/stress/instanceof-hit-one-object-then-another.js b/implementation-contributed/javascriptcore/stress/instanceof-hit-one-object-then-another.js deleted file mode 100644 index a486ab802f..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof-hit-one-object-then-another.js +++ /dev/null @@ -1,19 +0,0 @@ -function foo(o, p) -{ - return o instanceof p; -} - -noInline(foo); - -class Foo { } -class Bar { } - -for (var i = 0; i < 10000; ++i) { - var result = foo(new Foo(), Foo); - if (!result) - throw "Error: bad result in loop: " + result; -} - -var result = foo(new Foo(), Bar); -if (result) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/instanceof-hit-two-objects-then-another.js b/implementation-contributed/javascriptcore/stress/instanceof-hit-two-objects-then-another.js deleted file mode 100644 index 72b2f9e4fe..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof-hit-two-objects-then-another.js +++ /dev/null @@ -1,23 +0,0 @@ -function foo(o, p) -{ - return o instanceof p; -} - -noInline(foo); - -class Foo { } -class Bar { } -class Baz { } - -for (var i = 0; i < 10000; ++i) { - var result = foo(new Foo(), Foo); - if (!result) - throw "Error: bad result in loop (1): " + result; - var result = foo(new Foo(), Bar); - if (result) - throw "Error: bad result in loop (2): " + result; -} - -var result = foo(new Foo(), Baz); -if (result) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/instanceof-late-constant-folding.js b/implementation-contributed/javascriptcore/stress/instanceof-late-constant-folding.js deleted file mode 100644 index d74d0b502f..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof-late-constant-folding.js +++ /dev/null @@ -1,19 +0,0 @@ -function Constructor(x) {} - -Object.defineProperty(Constructor, Symbol.hasInstance, {value: function() { return false; }}); - -x = new Constructor(); - -function body() { - var result = 0; - for (var i = 0; i < 100000; i++) { - if (x instanceof Constructor) - result++; - } - - return result; -} -noInline(body); - -if (body()) - throw "result incorrect"; diff --git a/implementation-contributed/javascriptcore/stress/instanceof-non-object-prototype.js b/implementation-contributed/javascriptcore/stress/instanceof-non-object-prototype.js deleted file mode 100644 index a43bd57c4f..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof-non-object-prototype.js +++ /dev/null @@ -1,21 +0,0 @@ -let base = "sting"; -let constructor = function() { }; -constructor.prototype = 42; - -function test(a, b) { - return a instanceof b; -} -noInline(test); - -for (let i = 0; i < 10000; i++) { - let exception; - try { - var result = test(base, constructor); - } catch (e) { - exception = e; - } - if (exception) - throw new Error("Threw an exception: " + exception); - if (result !== false) - throw new Error("instanceof returned: " + result); -} diff --git a/implementation-contributed/javascriptcore/stress/instanceof-not-cell.js b/implementation-contributed/javascriptcore/stress/instanceof-not-cell.js deleted file mode 100644 index fb291efdbc..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof-not-cell.js +++ /dev/null @@ -1,44 +0,0 @@ -function foo(o, prototype) { - return o instanceof prototype; -} - -noInline(foo); - -function test(o, prototype, expected) { - var actual = foo(o, prototype); - if (actual != expected) - throw new Error("bad result: " + actual); -} - -function Foo() { } - -function Bar() { } -Bar.prototype = new Foo(); - -for (var i = 0; i < 10000; ++i) { - test(42, Object, false); - test(42, Array, false); - test(42, String, false); - test(42, Foo, false); - test(42, Bar, false); - test({}, Object, true); - test({}, Array, false); - test({}, String, false); - test({}, Foo, false); - test({}, Bar, false); - test([], Object, true); - test([], Array, true); - test([], String, false); - test([], Foo, false); - test([], Bar, false); - test(new Foo(), Object, true); - test(new Foo(), Array, false); - test(new Foo(), String, false); - test(new Foo(), Foo, true); - test(new Foo(), Bar, false); - test(new Bar(), Object, true); - test(new Bar(), Array, false); - test(new Bar(), String, false); - test(new Bar(), Foo, true); - test(new Bar(), Bar, true); -} diff --git a/implementation-contributed/javascriptcore/stress/instanceof-prototype-change-to-hit.js b/implementation-contributed/javascriptcore/stress/instanceof-prototype-change-to-hit.js deleted file mode 100644 index 35865a8910..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof-prototype-change-to-hit.js +++ /dev/null @@ -1,27 +0,0 @@ -function foo(o, p) -{ - return o instanceof p; -} - -noInline(foo); - -class Foo { } - -function Bar() { } -Bar.prototype = new Foo(); - -new Foo().thingy = 42; - -class Baz { } - -for (var i = 0; i < 10000; ++i) { - var result = foo(new Bar(), Baz); - if (result) - throw "Error: bad result in loop: " + result; -} - -Bar.prototype.__proto__ = new Baz(); - -var result = foo(new Bar(), Baz); -if (!result) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/instanceof-prototype-change-to-null.js b/implementation-contributed/javascriptcore/stress/instanceof-prototype-change-to-null.js deleted file mode 100644 index 6944e146a7..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof-prototype-change-to-null.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(o, p) -{ - return o instanceof p; -} - -noInline(foo); - -class Foo { } - -function Bar() { } -Bar.prototype = new Foo(); - -new Foo().thingy = 42; - -for (var i = 0; i < 10000; ++i) { - var result = foo(new Bar(), Foo); - if (!result) - throw "Error: bad result in loop: " + result; -} - -Bar.prototype.__proto__ = null; - -var result = foo(new Bar(), Foo); -if (result) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/instanceof-prototype-change-watchpointable.js b/implementation-contributed/javascriptcore/stress/instanceof-prototype-change-watchpointable.js deleted file mode 100644 index 84efbbaaea..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof-prototype-change-watchpointable.js +++ /dev/null @@ -1,22 +0,0 @@ -function foo(o, p) -{ - return o instanceof p; -} - -noInline(foo); - -class Foo { } - -class Bar extends Foo { } - -for (var i = 0; i < 10000; ++i) { - var result = foo(new Bar(), Foo); - if (!result) - throw "Error: bad result in loop: " + result; -} - -Bar.prototype.__proto__ = {}; - -var result = foo(new Bar(), Foo); -if (result) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/instanceof-prototype-change.js b/implementation-contributed/javascriptcore/stress/instanceof-prototype-change.js deleted file mode 100644 index 7f53815078..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof-prototype-change.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(o, p) -{ - return o instanceof p; -} - -noInline(foo); - -class Foo { } - -function Bar() { } -Bar.prototype = new Foo(); - -new Foo().thingy = 42; - -for (var i = 0; i < 10000; ++i) { - var result = foo(new Bar(), Foo); - if (!result) - throw "Error: bad result in loop: " + result; -} - -Bar.prototype.__proto__ = {}; - -var result = foo(new Bar(), Foo); -if (result) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/instanceof-proxy-check-structure.js b/implementation-contributed/javascriptcore/stress/instanceof-proxy-check-structure.js deleted file mode 100644 index c4b88f9fa5..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof-proxy-check-structure.js +++ /dev/null @@ -1,59 +0,0 @@ -class Foo { } - -function Bar() { } - -var numberOfGetPrototypeOfCalls = 0; - -var doBadThings = function() { }; - -Bar.prototype = new Proxy( - {}, - { - getPrototypeOf() - { - numberOfGetPrototypeOfCalls++; - doBadThings(); - return Foo.prototype; - } - }); - -// Break some watchpoints. -var o = {f:42}; -o.g = 43; - -function foo(o, p, q) -{ - var result = o.f; - var _ = p instanceof Foo; - q.f = 11; - return result + o.f; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo({f:42}, new Bar(), {f:0}); - if (result != 84) - throw "Error: bad result in loop: " + result; -} - -if (numberOfGetPrototypeOfCalls != 10000) - throw "Error: did not call getPrototypeOf() the right number of times"; - -var globalO = {f:42}; -var didCallGetter = false; -doBadThings = function() { - delete globalO.f; - globalO.__defineGetter__("f", function() { - didCallGetter = true; - return 43; - }); -}; - -var result = foo(globalO, new Bar(), {f:0}); -if (result != 85) - throw "Error: bad result at end: " + result; -if (!didCallGetter) - throw "Error: did not call getter"; -if (numberOfGetPrototypeOfCalls != 10001) - throw "Error: did not call getPrototypeOf() the right number of times at end"; diff --git a/implementation-contributed/javascriptcore/stress/instanceof-proxy-loop.js b/implementation-contributed/javascriptcore/stress/instanceof-proxy-loop.js deleted file mode 100644 index 1bff5edc32..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof-proxy-loop.js +++ /dev/null @@ -1,59 +0,0 @@ -class Foo { } - -function Bar() { } - -var numberOfGetPrototypeOfCalls = 0; - -var doBadThings = function() { }; - -Bar.prototype = new Proxy( - {}, - { - getPrototypeOf() - { - numberOfGetPrototypeOfCalls++; - doBadThings(); - return Foo.prototype; - } - }); - -// Break some watchpoints. -var o = {f:42}; -o.g = 43; - -function foo(o, p) -{ - var result = o.f; - for (var i = 0; i < 5; ++i) - var _ = p instanceof Foo; - return result + o.f; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo({f:42}, new Bar()); - if (result != 84) - throw "Error: bad result in loop: " + result; -} - -if (numberOfGetPrototypeOfCalls != 10000 * 5) - throw "Error: did not call getPrototypeOf() the right number of times"; - -var globalO = {f:42}; -var didCallGetter = false; -doBadThings = function() { - delete globalO.f; - globalO.__defineGetter__("f", function() { - didCallGetter = true; - return 43; - }); -}; - -var result = foo(globalO, new Bar()); -if (result != 85) - throw "Error: bad result at end: " + result; -if (!didCallGetter) - throw "Error: did not call getter"; -if (numberOfGetPrototypeOfCalls != 10001 * 5) - throw "Error: did not call getPrototypeOf() the right number of times at end"; diff --git a/implementation-contributed/javascriptcore/stress/instanceof-proxy.js b/implementation-contributed/javascriptcore/stress/instanceof-proxy.js deleted file mode 100644 index c1ad114c01..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof-proxy.js +++ /dev/null @@ -1,47 +0,0 @@ -class Foo { } - -function Bar() { } - -var numberOfGetPrototypeOfCalls = 0; - -var doBadThings = function() { }; - -Bar.prototype = new Proxy( - {}, - { - getPrototypeOf() - { - numberOfGetPrototypeOfCalls++; - doBadThings(); - return Foo.prototype; - } - }); - -var o = {f:42}; - -function foo(o, p) -{ - var result = o.f; - var _ = p instanceof Foo; - return result + o.f; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo({f:42}, new Bar()); - if (result != 84) - throw "Error: bad result in loop: " + result; -} - -var globalO = {f:42}; -var didCallGetter = false; -doBadThings = function() { - globalO.f = 43; -}; - -var result = foo(globalO, new Bar()); -if (result != 85) - throw "Error: bad result at end: " + result; -if (numberOfGetPrototypeOfCalls != 10001) - throw "Error: did not call getPrototypeOf() the right number of times at end"; diff --git a/implementation-contributed/javascriptcore/stress/instanceof.js b/implementation-contributed/javascriptcore/stress/instanceof.js deleted file mode 100644 index f8d03e2ba6..0000000000 --- a/implementation-contributed/javascriptcore/stress/instanceof.js +++ /dev/null @@ -1,39 +0,0 @@ -function foo(o, prototype) { - return o instanceof prototype; -} - -noInline(foo); - -function test(o, prototype, expected) { - var actual = foo(o, prototype); - if (actual != expected) - throw new Error("bad result: " + actual); -} - -function Foo() { } - -function Bar() { } -Bar.prototype = new Foo(); - -for (var i = 0; i < 10000; ++i) { - test({}, Object, true); - test({}, Array, false); - test({}, String, false); - test({}, Foo, false); - test({}, Bar, false); - test([], Object, true); - test([], Array, true); - test([], String, false); - test([], Foo, false); - test([], Bar, false); - test(new Foo(), Object, true); - test(new Foo(), Array, false); - test(new Foo(), String, false); - test(new Foo(), Foo, true); - test(new Foo(), Bar, false); - test(new Bar(), Object, true); - test(new Bar(), Array, false); - test(new Bar(), String, false); - test(new Bar(), Foo, true); - test(new Bar(), Bar, true); -} diff --git a/implementation-contributed/javascriptcore/stress/int16-put-by-val-in-and-out-of-bounds.js b/implementation-contributed/javascriptcore/stress/int16-put-by-val-in-and-out-of-bounds.js deleted file mode 100644 index d3c283eb9d..0000000000 --- a/implementation-contributed/javascriptcore/stress/int16-put-by-val-in-and-out-of-bounds.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo(a) { - a[42] = 95010; -} - -noInline(foo); - -function test(length, expected) { - var a = new Int16Array(length); - foo(a); - var result = a[42]; - if (result != expected) - throw new Error("bad value at a[42]: " + result); -} - -for (var i = 0; i < 100000; ++i) { - test(10, void 0); - test(100, 29474); -} diff --git a/implementation-contributed/javascriptcore/stress/int16-put-by-val-in-bounds-then-exit-out-of-bounds.js b/implementation-contributed/javascriptcore/stress/int16-put-by-val-in-bounds-then-exit-out-of-bounds.js deleted file mode 100644 index 0ed7462a43..0000000000 --- a/implementation-contributed/javascriptcore/stress/int16-put-by-val-in-bounds-then-exit-out-of-bounds.js +++ /dev/null @@ -1,19 +0,0 @@ -function foo(a) { - a[42] = 95010; -} - -noInline(foo); - -function test(length, expected) { - var a = new Int16Array(length); - foo(a); - var result = a[42]; - if (result != expected) - throw "Error: bad value at a[42]: " + result; -} - -for (var i = 0; i < 100000; ++i) - test(100, 29474); - -test(10, void 0); - diff --git a/implementation-contributed/javascriptcore/stress/int16-put-by-val-out-of-bounds-bounds-then-do-in-bounds.js b/implementation-contributed/javascriptcore/stress/int16-put-by-val-out-of-bounds-bounds-then-do-in-bounds.js deleted file mode 100644 index 3bb964ca07..0000000000 --- a/implementation-contributed/javascriptcore/stress/int16-put-by-val-out-of-bounds-bounds-then-do-in-bounds.js +++ /dev/null @@ -1,19 +0,0 @@ -function foo(a) { - a[42] = 95010; -} - -noInline(foo); - -function test(length, expected) { - var a = new Int16Array(length); - foo(a); - var result = a[42]; - if (result != expected) - throw "Error: bad value at a[42]: " + result; -} - -for (var i = 0; i < 100000; ++i) - test(10, void 0); - -test(100, 29474); - diff --git a/implementation-contributed/javascriptcore/stress/int32-array-unshift.js b/implementation-contributed/javascriptcore/stress/int32-array-unshift.js deleted file mode 100644 index 4d4c69dfe3..0000000000 --- a/implementation-contributed/javascriptcore/stress/int32-array-unshift.js +++ /dev/null @@ -1,6 +0,0 @@ -//@ runDefault -var x = [2, 1]; -Array.prototype.unshift.call(x, 3); -if (x.toString() != "3,2,1") - throw "Error: bad result: " + describe(x); - diff --git a/implementation-contributed/javascriptcore/stress/int32-min-to-string.js b/implementation-contributed/javascriptcore/stress/int32-min-to-string.js deleted file mode 100644 index e2f20726dc..0000000000 --- a/implementation-contributed/javascriptcore/stress/int32-min-to-string.js +++ /dev/null @@ -1,43 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test2() -{ - return (-2147483648).toString(2); -} -noInline(test2); - -function test4() -{ - return (-2147483648).toString(4); -} -noInline(test4); - -function test8() -{ - return (-2147483648).toString(8); -} -noInline(test8); - -function test16() -{ - return (-2147483648).toString(16); -} -noInline(test16); - -function test32() -{ - return (-2147483648).toString(32); -} -noInline(test32); - -for (var i = 0; i < 1e5; ++i) { - shouldBe(test2(), '-10000000000000000000000000000000'); - shouldBe(test4(), '-2000000000000000'); - shouldBe(test8(), '-20000000000'); - shouldBe(test16(), '-80000000'); - shouldBe(test32(), '-2000000'); -} diff --git a/implementation-contributed/javascriptcore/stress/int32-object-out-of-bounds.js b/implementation-contributed/javascriptcore/stress/int32-object-out-of-bounds.js deleted file mode 100644 index 6d38679f61..0000000000 --- a/implementation-contributed/javascriptcore/stress/int32-object-out-of-bounds.js +++ /dev/null @@ -1,37 +0,0 @@ -function make(value) { - var result = {}; - result[0] = value; - return result; -} - -function foo(a, i) { - return a[i]; -} - -noInline(foo); - -function test(value) { - var result = foo(make(value), 0); - if (result != value) - throw "Error: bad result: " + result; -} - -for (var i = 0; i < 100000; ++i) - test(42); - -var result = foo(make(42), 1); -if (result !== void 0) - throw "Error: bad result: " + result; - -result = foo(make(42), 100); -if (result !== void 0) - throw "Error: bad result: " + result; - -result = foo(make(42), 10000); -if (result !== void 0) - throw "Error: bad result: " + result; - -Object.prototype[10000] = 23; -result = foo(make(42), 10000); -if (result !== 23) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/int32-out-of-bounds.js b/implementation-contributed/javascriptcore/stress/int32-out-of-bounds.js deleted file mode 100644 index 878709dcd7..0000000000 --- a/implementation-contributed/javascriptcore/stress/int32-out-of-bounds.js +++ /dev/null @@ -1,31 +0,0 @@ -function foo(a, i) { - return a[i]; -} - -noInline(foo); - -function test(value) { - var result = foo([value], 0); - if (result != value) - throw "Error: bad result: " + result; -} - -for (var i = 0; i < 100000; ++i) - test(42); - -var result = foo([42], 1); -if (result !== void 0) - throw "Error: bad result: " + result; - -result = foo([42], 100); -if (result !== void 0) - throw "Error: bad result: " + result; - -result = foo([42], 10000); -if (result !== void 0) - throw "Error: bad result: " + result; - -Array.prototype[10000] = 23; -result = foo([42], 10000); -if (result !== 23) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/int32-to-string-in-loop-removed.js b/implementation-contributed/javascriptcore/stress/int32-to-string-in-loop-removed.js deleted file mode 100644 index d28af0130b..0000000000 --- a/implementation-contributed/javascriptcore/stress/int32-to-string-in-loop-removed.js +++ /dev/null @@ -1,8 +0,0 @@ -function test() -{ - for (var i = 0; i < 1e6; ++i) - i.toString(); -} -noInline(test); - -test(); diff --git a/implementation-contributed/javascriptcore/stress/int32array-transition-on-nan.js b/implementation-contributed/javascriptcore/stress/int32array-transition-on-nan.js deleted file mode 100644 index 5db2a66f95..0000000000 --- a/implementation-contributed/javascriptcore/stress/int32array-transition-on-nan.js +++ /dev/null @@ -1,88 +0,0 @@ -function insertNaNWhileFilling() -{ - var array = new Array(6); - for (var i = 0; i < 4; ++i) - array[i] = i; - array[5] = NaN; - return array; -} -noInline(insertNaNWhileFilling); - -function testInsertNaNWhileFilling() -{ - var array = insertNaNWhileFilling(); - for (var i = 0; i < 4; ++i) { - var value = array[i]; - if (value !== i) { - throw "Failed testInsertNaNWhileFilling, value = " + value + " instead of " + i; - } - } - var nan = array[5]; - if (!Number.isNaN(nan)) - throw "Failed testInsertNaNWhileFilling, array[5] is " + nan + " instead of NaN"; -} -noInline(testInsertNaNWhileFilling); - -for (var i = 0; i < 1e4; ++i) { - testInsertNaNWhileFilling(); -} - - -function insertNaNAfterFilling() -{ - var array = new Array(6); - for (var i = 0; i < 5; ++i) - array[i] = i; - array[5] = NaN; - return array; -} -noInline(insertNaNAfterFilling); - -function testInsertNaNAfterFilling() -{ - var array = insertNaNAfterFilling(); - for (var i = 0; i < 4; ++i) { - var value = array[i]; - if (value !== i) { - throw "Failed testInsertNaNAfterFilling, value = " + value + " instead of " + i; - } - } - var nan = array[5]; - if (!Number.isNaN(nan)) - throw "Failed testInsertNaNAfterFilling, array[5] is " + nan + " instead of NaN"; -} -noInline(testInsertNaNAfterFilling); - -for (var i = 0; i < 1e4; ++i) { - testInsertNaNAfterFilling(); -} - - -function pushNaNWhileFilling() -{ - var array = []; - for (var i = 0; i < 5; ++i) - array.push(i); - array.push(NaN); - return array; -} -noInline(pushNaNWhileFilling); - -function testPushNaNWhileFilling() -{ - var array = pushNaNWhileFilling(); - for (var i = 0; i < 4; ++i) { - var value = array[i]; - if (value !== i) { - throw "Failed testPushNaNWhileFilling, value = " + value + " instead of " + i; - } - } - var nan = array[5]; - if (!Number.isNaN(nan)) - throw "Failed testPushNaNWhileFilling, array[5] is " + nan + " instead of NaN"; -} -noInline(testPushNaNWhileFilling); - -for (var i = 0; i < 1e4; ++i) { - testPushNaNWhileFilling(); -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/int52-ai-mul-then-filter-int32-directly.js b/implementation-contributed/javascriptcore/stress/int52-ai-mul-then-filter-int32-directly.js deleted file mode 100644 index 5544e5c227..0000000000 --- a/implementation-contributed/javascriptcore/stress/int52-ai-mul-then-filter-int32-directly.js +++ /dev/null @@ -1,14 +0,0 @@ -function foo(a, b, c) { - var o = {f:42}; - o.f = (a * b + 5) * c + 5; - return o.f | 0; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(65536, 65536, 0); - if (result != 5 && result != 42) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/int52-argument.js b/implementation-contributed/javascriptcore/stress/int52-argument.js deleted file mode 100644 index cf7952f4f4..0000000000 --- a/implementation-contributed/javascriptcore/stress/int52-argument.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo(x) { - var y = x; - x = y * 2; - if (x) { - x += y; - x += y; - x += y; - } - return x; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(1000000000); - if (result != 1000000000 * 2 + 1000000000 * 3) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/int52-force-osr-exit-path.js b/implementation-contributed/javascriptcore/stress/int52-force-osr-exit-path.js deleted file mode 100644 index a7bf3b9aa6..0000000000 --- a/implementation-contributed/javascriptcore/stress/int52-force-osr-exit-path.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo(a, b, p, o) { - var c = a + b; - if (p) - c -= o.f; - return c + 1; -} - -noInline(foo); - -var o = {f: 42}; -for (var i = 0; i < 100000; ++i) { - var result = foo(2000000000, 2000000000, false, o); - if (result != 4000000001) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/int52-inlined-call-argument.js b/implementation-contributed/javascriptcore/stress/int52-inlined-call-argument.js deleted file mode 100644 index 02b53714ee..0000000000 --- a/implementation-contributed/javascriptcore/stress/int52-inlined-call-argument.js +++ /dev/null @@ -1,19 +0,0 @@ -function foo(a, b, c, p) { - a = b + c; - if (p) { - a++; - return a; - } -} - -function bar(a, b) { - return foo("hello", a, b, a <= b); -} - -noInline(bar); - -for (var i = 0; i < 100000; ++i) { - var result = bar(2000000000, 2000000000); - if (result != 4000000001) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/int52-to-string-in-loop-removed.js b/implementation-contributed/javascriptcore/stress/int52-to-string-in-loop-removed.js deleted file mode 100644 index 36c931e4d1..0000000000 --- a/implementation-contributed/javascriptcore/stress/int52-to-string-in-loop-removed.js +++ /dev/null @@ -1,8 +0,0 @@ -function test() -{ - for (var i = 0; i < 1e6; ++i) - fiatInt52(i).toString(); -} -noInline(test); - -test(); diff --git a/implementation-contributed/javascriptcore/stress/int52-variable.js b/implementation-contributed/javascriptcore/stress/int52-variable.js deleted file mode 100644 index 6188f8b7e0..0000000000 --- a/implementation-contributed/javascriptcore/stress/int52-variable.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo(x) { - var y = x; - var z = y * 2; - if (z) { - z += y; - z += y; - z += y; - } - return z; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(1000000000); - if (result != 1000000000 * 2 + 1000000000 * 3) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/int8-repeat-out-of-bounds.js b/implementation-contributed/javascriptcore/stress/int8-repeat-out-of-bounds.js deleted file mode 100644 index 0963e43d38..0000000000 --- a/implementation-contributed/javascriptcore/stress/int8-repeat-out-of-bounds.js +++ /dev/null @@ -1,17 +0,0 @@ -//@ defaultNoEagerRun - -function foo(a) { - a[0] = 1; - a[1] = 2; - a[2] = 3; -} - -noInline(foo); - -var array = new Int8Array(1); - -for (var i = 0; i < 100000; ++i) - foo(array); - -if (reoptimizationRetryCount(foo)) - throw "Error: unexpected retry count: " + reoptimizationRetryCount(foo); diff --git a/implementation-contributed/javascriptcore/stress/integer-range-optimization-constant-representation-1.js b/implementation-contributed/javascriptcore/stress/integer-range-optimization-constant-representation-1.js deleted file mode 100644 index c0c74b679c..0000000000 --- a/implementation-contributed/javascriptcore/stress/integer-range-optimization-constant-representation-1.js +++ /dev/null @@ -1,46 +0,0 @@ -//@ run("integer-range-optimization-constant-representation", *NO_CJIT_OPTIONS, "--useConcurrentJIT=false") -//@ run("integer-range-optimization-constant-representation", *FTL_OPTIONS, "--useConcurrentJIT=false") - -function opaque() -{ - // This exists to hide side effects to the optimizer. -} -noInline(opaque); - -function test(i, opaqueCondition) { - do { - if (opaqueCondition == 1) { - if (i < 42) { - opaque(i); - if (i != 41) { - break; - } - } - } else if (opaqueCondition == 2) { - if (i < 42) { - opaque(i); - if (i < 41) { - opaque(i); - if (i == 0) { - break; - } - } - } - } - } while (true); - - opaque(i); - opaque(42); - opaque(41); - return i; -} -noInline(test); - -function loop() { - for (let i = 0; i < 1e6; ++i) - test(1, 1); -} -noInline(loop); -noDFG(loop); - -loop(); \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/integer-range-optimization-constant-representation-2.js b/implementation-contributed/javascriptcore/stress/integer-range-optimization-constant-representation-2.js deleted file mode 100644 index 0bfc8599f9..0000000000 --- a/implementation-contributed/javascriptcore/stress/integer-range-optimization-constant-representation-2.js +++ /dev/null @@ -1,43 +0,0 @@ -function opaque() -{ - // This exists to hide side effects to the optimizer. -} -noInline(opaque); - -function test(i, opaqueCondition) { - do { - if (opaqueCondition == 1) { - if (i < 42) { - opaque(i); - if (i != 41) { - break; - } - } - } else if (opaqueCondition == 2) { - if (i < 42) { - opaque(i); - if (i < 41) { - opaque(i); - if (i == 0) { - break; - } - } - } - } - } while (true); - - opaque(i); - opaque(42); - opaque(41); - return i; -} -noInline(test); - -function loop() { - for (let i = 0; i < 1e6; ++i) - test(1, 1); -} -noInline(loop); -noDFG(loop); - -loop(); diff --git a/implementation-contributed/javascriptcore/stress/internal-function-call.js b/implementation-contributed/javascriptcore/stress/internal-function-call.js deleted file mode 100644 index ecbfa7b7ea..0000000000 --- a/implementation-contributed/javascriptcore/stress/internal-function-call.js +++ /dev/null @@ -1,9 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var func = Date; - -for (var i = 0; i < 1e4; ++i) - shouldBe(typeof func(), "string"); diff --git a/implementation-contributed/javascriptcore/stress/internal-function-construct.js b/implementation-contributed/javascriptcore/stress/internal-function-construct.js deleted file mode 100644 index 9852b917c9..0000000000 --- a/implementation-contributed/javascriptcore/stress/internal-function-construct.js +++ /dev/null @@ -1,12 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var func = Date; - -for (var i = 0; i < 1e4; ++i) { - var date = new func(); - shouldBe(typeof date, "object"); - shouldBe(date instanceof Date, true); -} diff --git a/implementation-contributed/javascriptcore/stress/intl-constructors-with-proxy.js b/implementation-contributed/javascriptcore/stress/intl-constructors-with-proxy.js deleted file mode 100644 index 941a683d41..0000000000 --- a/implementation-contributed/javascriptcore/stress/intl-constructors-with-proxy.js +++ /dev/null @@ -1,38 +0,0 @@ -//@ skip if $hostOS == "windows" - -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -{ - function Empty() { - } - let proxy = new Proxy(Empty, {}); - - shouldBe(Reflect.construct(Intl.Collator, [], proxy) instanceof Empty, true); - shouldBe(Reflect.construct(Intl.Collator, [], proxy).__proto__, Empty.prototype); - - shouldBe(Reflect.construct(Intl.NumberFormat, [], proxy) instanceof Empty, true); - shouldBe(Reflect.construct(Intl.NumberFormat, [], proxy).__proto__, Empty.prototype); - - shouldBe(Reflect.construct(Intl.DateTimeFormat, [], proxy) instanceof Empty, true); - shouldBe(Reflect.construct(Intl.DateTimeFormat, [], proxy).__proto__, Empty.prototype); -} - -{ - function Empty() { - } - Empty.prototype = null; - - let proxy = new Proxy(Empty, {}); - - shouldBe(Reflect.construct(Intl.Collator, [], proxy) instanceof Intl.Collator, true); - shouldBe(Reflect.construct(Intl.Collator, [], proxy).__proto__, Intl.Collator.prototype); - - shouldBe(Reflect.construct(Intl.NumberFormat, [], proxy) instanceof Intl.NumberFormat, true); - shouldBe(Reflect.construct(Intl.NumberFormat, [], proxy).__proto__, Intl.NumberFormat.prototype); - - shouldBe(Reflect.construct(Intl.DateTimeFormat, [], proxy) instanceof Intl.DateTimeFormat, true); - shouldBe(Reflect.construct(Intl.DateTimeFormat, [], proxy).__proto__, Intl.DateTimeFormat.prototype); -} diff --git a/implementation-contributed/javascriptcore/stress/intrinsic-getter-with-poly-proto-getter-change.js b/implementation-contributed/javascriptcore/stress/intrinsic-getter-with-poly-proto-getter-change.js deleted file mode 100644 index 56b425a4fd..0000000000 --- a/implementation-contributed/javascriptcore/stress/intrinsic-getter-with-poly-proto-getter-change.js +++ /dev/null @@ -1,33 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function makePolyProtoObject() { - function foo() { - class C { - constructor() { - this._field = 42; - } - }; - return new C; - } - for (let i = 0; i < 15; ++i) - foo(); - return foo(); -} - -function target(object) -{ - return object.__proto__; -} -noInline(target); - -var polyProtoObject = makePolyProtoObject(); -var prototype = Reflect.getPrototypeOf(polyProtoObject); -for (var i = 0; i < 1e5; ++i) - shouldBe(target(polyProtoObject), prototype); -Object.defineProperty(Object.prototype, "__proto__", { - get: function () { return null; } -}); -shouldBe(target(polyProtoObject), null); diff --git a/implementation-contributed/javascriptcore/stress/intrinsic-getter-with-poly-proto-proto-change.js b/implementation-contributed/javascriptcore/stress/intrinsic-getter-with-poly-proto-proto-change.js deleted file mode 100644 index c77d8e3f10..0000000000 --- a/implementation-contributed/javascriptcore/stress/intrinsic-getter-with-poly-proto-proto-change.js +++ /dev/null @@ -1,32 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function makePolyProtoObject() { - function foo() { - class C { - constructor() { - this._field = 42; - } - }; - return new C; - } - for (let i = 0; i < 15; ++i) - foo(); - return foo(); -} - -function target(object) -{ - return object.__proto__; -} -noInline(target); - -var polyProtoObject = makePolyProtoObject(); -var prototype = Reflect.getPrototypeOf(polyProtoObject); -for (var i = 0; i < 1e5; ++i) - shouldBe(target(polyProtoObject), prototype); - -polyProtoObject.__proto__ = null -shouldBe(target(polyProtoObject), undefined) diff --git a/implementation-contributed/javascriptcore/stress/intrinsic-getter-with-poly-proto.js b/implementation-contributed/javascriptcore/stress/intrinsic-getter-with-poly-proto.js deleted file mode 100644 index d8652355ea..0000000000 --- a/implementation-contributed/javascriptcore/stress/intrinsic-getter-with-poly-proto.js +++ /dev/null @@ -1,31 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function makePolyProtoObject() { - function foo() { - class C { - constructor() { - this._field = 42; - } - }; - return new C; - } - for (let i = 0; i < 15; ++i) - foo(); - return foo(); -} - -function target(object) -{ - return object.__proto__; -} -noInline(target); - -var polyProtoObject = makePolyProtoObject(); -var prototype = Reflect.getPrototypeOf(polyProtoObject); -for (var i = 0; i < 1e5; ++i) - shouldBe(target(polyProtoObject), prototype); -polyProtoObject.__proto__ = null; -shouldBe(target(polyProtoObject), undefined); diff --git a/implementation-contributed/javascriptcore/stress/invalidation-point.js b/implementation-contributed/javascriptcore/stress/invalidation-point.js deleted file mode 100644 index 6f8b55c7c6..0000000000 --- a/implementation-contributed/javascriptcore/stress/invalidation-point.js +++ /dev/null @@ -1,24 +0,0 @@ -function foo(o, p) { - possiblyDoBadThings(p); - return o.f(); -} -noInline(foo); - -function Thingy() { } -Thingy.prototype.f = function() { return 42; } - -function possiblyDoBadThings(p) { - if (p) - Thingy.prototype.f = function() { return 24; } -} -noInline(possiblyDoBadThings); - -for (var i = 0; i < 100000; ++i) { - var result = foo(new Thingy(), false); - if (result != 42) - throw "Error: bad result: " + result; -} - -var result = foo(new Thingy(), true); -if (result != 24) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/inverted-additive-subsumption.js b/implementation-contributed/javascriptcore/stress/inverted-additive-subsumption.js deleted file mode 100644 index d41fd1fed9..0000000000 --- a/implementation-contributed/javascriptcore/stress/inverted-additive-subsumption.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo(x) { - return ((x + 1) | 0) + (x + 1); -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(i); - if (result != (i + 1) * 2) - throw "Error: bad result for i = " + i + ": " + result; -} - -var result = foo(2147483647); -if (result != ((2147483647 + 1) | 0) + (2147483647 + 1)) - throw "Error: bad result for 2147483647: " + result; diff --git a/implementation-contributed/javascriptcore/stress/is-undefined-exit-on-masquerader.js b/implementation-contributed/javascriptcore/stress/is-undefined-exit-on-masquerader.js deleted file mode 100644 index 018271470e..0000000000 --- a/implementation-contributed/javascriptcore/stress/is-undefined-exit-on-masquerader.js +++ /dev/null @@ -1,33 +0,0 @@ -var doMasquerading = false; - -function bar(o) { - if (doMasquerading) - return makeMasquerader(); - return o; -} - -noInline(bar); - -function foo(o) { - o = bar(o); - return typeof o === "undefined"; -} - -noInline(foo); - -function test(o, expected) { - var result = foo(o); - if (result != expected) - throw new Error("bad result: " + result); -} - -for (var i = 0; i < 10000; ++i) { - test(void 0, true); - test(null, false); - test(42, false); - test({}, false); - test("undefined", false); -} - -doMasquerading = true; -test({}, true); diff --git a/implementation-contributed/javascriptcore/stress/is-undefined-jettison-on-masquerader.js b/implementation-contributed/javascriptcore/stress/is-undefined-jettison-on-masquerader.js deleted file mode 100644 index 70e09cc14f..0000000000 --- a/implementation-contributed/javascriptcore/stress/is-undefined-jettison-on-masquerader.js +++ /dev/null @@ -1,21 +0,0 @@ -function foo(o) { - return typeof o === "undefined"; -} - -noInline(foo); - -function test(o, expected) { - var result = foo(o); - if (result != expected) - throw new Error("bad result: " + result); -} - -for (var i = 0; i < 10000; ++i) { - test(void 0, true); - test(null, false); - test(42, false); - test({}, false); - test("undefined", false); -} - -test(makeMasquerader(), true); diff --git a/implementation-contributed/javascriptcore/stress/is-undefined-masquerader.js b/implementation-contributed/javascriptcore/stress/is-undefined-masquerader.js deleted file mode 100644 index fb6ba711d3..0000000000 --- a/implementation-contributed/javascriptcore/stress/is-undefined-masquerader.js +++ /dev/null @@ -1,20 +0,0 @@ -function foo(o) { - return typeof o === "undefined"; -} - -noInline(foo); - -function test(o, expected) { - var result = foo(o); - if (result != expected) - throw new Error("bad result: " + result); -} - -for (var i = 0; i < 10000; ++i) { - test(void 0, true); - test(null, false); - test(42, false); - test({}, false); - test("undefined", false); - test(makeMasquerader(), true); -} diff --git a/implementation-contributed/javascriptcore/stress/isInteger-doesnt-overwrite-argument.js b/implementation-contributed/javascriptcore/stress/isInteger-doesnt-overwrite-argument.js deleted file mode 100644 index 4158ac8300..0000000000 --- a/implementation-contributed/javascriptcore/stress/isInteger-doesnt-overwrite-argument.js +++ /dev/null @@ -1,13 +0,0 @@ -// This test shouldn't throw. - -function testIsInteger(arg) -{ - var x = Number.isInteger(arg); - return arg; -} - -for (var i = 0; i < 100000; i++) { - var r = testIsInteger(13.37); - if (r === false) - throw "Wrong value returned from function calling Number.isInteger"; -} diff --git a/implementation-contributed/javascriptcore/stress/isLockFree.js b/implementation-contributed/javascriptcore/stress/isLockFree.js deleted file mode 100644 index 1f08a53529..0000000000 --- a/implementation-contributed/javascriptcore/stress/isLockFree.js +++ /dev/null @@ -1,75 +0,0 @@ -//@ skip - -function foo(bytes) { - return Atomics.isLockFree(bytes); -} -noInline(foo); - -function foo0(bytes) { - return Atomics.isLockFree(0); -} -noInline(foo0); - -function foo1(bytes) { - return Atomics.isLockFree(1); -} -noInline(foo1); - -function foo2(bytes) { - return Atomics.isLockFree(2); -} -noInline(foo2); - -function foo3(bytes) { - return Atomics.isLockFree(3); -} -noInline(foo3); - -function foo4(bytes) { - return Atomics.isLockFree(4); -} -noInline(foo4); - -function foo5(bytes) { - return Atomics.isLockFree(5); -} -noInline(foo5); - -for (var i = 0; i < 10000; ++i) { - var result = foo(0); - if (result !== false) - throw new Error("Bad result: " + result); - var result = foo(1); - if (result !== true) - throw new Error("Bad result: " + result); - var result = foo(2); - if (result !== true) - throw new Error("Bad result: " + result); - var result = foo(3); - if (result !== false) - throw new Error("Bad result: " + result); - var result = foo(4); - if (result !== true) - throw new Error("Bad result: " + result); - var result = foo(5); - if (result !== false) - throw new Error("Bad result: " + result); - var result = foo0(); - if (result !== false) - throw new Error("Bad result: " + result); - var result = foo1(); - if (result !== true) - throw new Error("Bad result: " + result); - var result = foo2(); - if (result !== true) - throw new Error("Bad result: " + result); - var result = foo3(); - if (result !== false) - throw new Error("Bad result: " + result); - var result = foo4(); - if (result !== true) - throw new Error("Bad result: " + result); - var result = foo5(); - if (result !== false) - throw new Error("Bad result: " + result); -} diff --git a/implementation-contributed/javascriptcore/stress/iterator-field-order.js b/implementation-contributed/javascriptcore/stress/iterator-field-order.js deleted file mode 100644 index cf5d410c9b..0000000000 --- a/implementation-contributed/javascriptcore/stress/iterator-field-order.js +++ /dev/null @@ -1,38 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var array = [ 42 ]; - -shouldBe(JSON.stringify(array.values().next()), `{"value":42,"done":false}`); -shouldBe(JSON.stringify(array.keys().next()), `{"value":0,"done":false}`); -shouldBe(JSON.stringify(array.entries().next()), `{"value":[0,42],"done":false}`); - -async function* asyncIterator() { - yield 42; -} - -var iterator = asyncIterator(); -iterator.next().then(function (value) { - shouldBe(JSON.stringify(value), `{"value":42,"done":false}`); -}).catch($vm.abort); - -function* generator() { - yield 42; -} - -shouldBe(JSON.stringify(generator().next()), `{"value":42,"done":false}`); - -var map = new Map([[0,42]]); -shouldBe(JSON.stringify(map.keys().next()), `{"value":0,"done":false}`); -shouldBe(JSON.stringify(map.values().next()), `{"value":42,"done":false}`); -shouldBe(JSON.stringify(map.entries().next()), `{"value":[0,42],"done":false}`); - -var set = new Set([42]); -shouldBe(JSON.stringify(set.keys().next()), `{"value":42,"done":false}`); -shouldBe(JSON.stringify(set.values().next()), `{"value":42,"done":false}`); -shouldBe(JSON.stringify(set.entries().next()), `{"value":[42,42],"done":false}`); - -var string = "Cocoa"; -shouldBe(JSON.stringify(string[Symbol.iterator]().next()), `{"value":"C","done":false}`); diff --git a/implementation-contributed/javascriptcore/stress/iterator-functions.js b/implementation-contributed/javascriptcore/stress/iterator-functions.js deleted file mode 100644 index 12edb6e903..0000000000 --- a/implementation-contributed/javascriptcore/stress/iterator-functions.js +++ /dev/null @@ -1,33 +0,0 @@ -function test(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -test(Array.prototype[Symbol.iterator], Array.prototype.values); -test(Map.prototype[Symbol.iterator], Map.prototype.entries); -test(Set.prototype[Symbol.iterator], Set.prototype.values); - -function argumentsTests(values) { - test(function () { - return arguments[Symbol.iterator]; - }(), values); - - test(function (a, b, c) { - return arguments[Symbol.iterator]; - }(), values); - - test(function () { - 'use strict'; - return arguments[Symbol.iterator]; - }(), values); - - test(function (a, b, c) { - 'use strict'; - return arguments[Symbol.iterator]; - }(), values); -} - -argumentsTests(Array.prototype.values); -var arrayValues = Array.prototype.values; -Array.prototype.values = null; -argumentsTests(arrayValues); diff --git a/implementation-contributed/javascriptcore/stress/iterator-names.js b/implementation-contributed/javascriptcore/stress/iterator-names.js deleted file mode 100644 index 5fe8ab4576..0000000000 --- a/implementation-contributed/javascriptcore/stress/iterator-names.js +++ /dev/null @@ -1,35 +0,0 @@ -function test(object, name) { - return { - object, - name: '[object ' + name + ']' - }; -} - -function iter(object) { - return object[Symbol.iterator](); -} - -var tests = [ - test(iter([]), "Array Iterator"), - test(iter(new Array), "Array Iterator"), - test([].keys(), "Array Iterator"), - test([].entries(), "Array Iterator"), - test(iter(new Map), "Map Iterator"), - test((new Map()).keys(), "Map Iterator"), - test((new Map()).entries(), "Map Iterator"), - test(iter(new Set), "Set Iterator"), - test((new Set()).keys(), "Set Iterator"), - test((new Set()).entries(), "Set Iterator"), - test(iter(new String("")), "String Iterator"), - test(iter(""), "String Iterator"), -]; - -function check(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -for (var { object, name } of tests) { - check(object.toString(), name); - check(Object.prototype.toString.call(object), name); -} diff --git a/implementation-contributed/javascriptcore/stress/iterator-prototype.js b/implementation-contributed/javascriptcore/stress/iterator-prototype.js deleted file mode 100644 index c5f939bc51..0000000000 --- a/implementation-contributed/javascriptcore/stress/iterator-prototype.js +++ /dev/null @@ -1,53 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var iteratorPrototype = "Cocoa"[Symbol.iterator]().__proto__.__proto__; - -shouldBe(iteratorPrototype !== Object.prototype, true); -shouldBe(iteratorPrototype.__proto__, Object.prototype); -shouldBe(JSON.stringify(Object.getOwnPropertyNames(iteratorPrototype)), '[]'); -shouldBe(Object.getOwnPropertySymbols(iteratorPrototype).length, 1); -shouldBe(Object.getOwnPropertySymbols(iteratorPrototype)[0], Symbol.iterator); -shouldBe(iteratorPrototype[Symbol.iterator](), iteratorPrototype); -var stringIterator = "Hello"[Symbol.iterator](); -shouldBe(iteratorPrototype[Symbol.iterator].call(stringIterator), stringIterator); - -function inheritIteratorPrototype(iterator) -{ - var prototype = iterator.__proto__; - shouldBe(prototype !== iteratorPrototype, true); - shouldBe(Object.getOwnPropertyDescriptor(prototype, 'constructor'), undefined); - shouldBe(prototype.__proto__, iteratorPrototype); - shouldBe(iteratorPrototype[Symbol.iterator].name, '[Symbol.iterator]'); - shouldBe(iteratorPrototype.hasOwnProperty(Symbol.iterator), true); -} - -inheritIteratorPrototype("Cappuccino"[Symbol.iterator]()); -inheritIteratorPrototype(new Map()[Symbol.iterator]()); -inheritIteratorPrototype(new Set()[Symbol.iterator]()); -inheritIteratorPrototype(new Array()[Symbol.iterator]()); -inheritIteratorPrototype((function (a, b, c) { return arguments; }(0, 1, 2))[Symbol.iterator]()); -inheritIteratorPrototype((function (a, b, c) { 'use strict'; return arguments; }(0, 1, 2))[Symbol.iterator]()); - -function testChain(iterable) -{ - // Iterator instance - var iterator = iterable[Symbol.iterator](); - // %MapIteratorPrototype% - var proto1 = Object.getPrototypeOf(iterator); - // %IteratorPrototype% - var proto2 = Object.getPrototypeOf(proto1); - - shouldBe(proto2.hasOwnProperty(Symbol.iterator), true); - shouldBe(proto1.hasOwnProperty(Symbol.iterator), false); - shouldBe(iterator.hasOwnProperty(Symbol.iterator), false); - shouldBe(iterator[Symbol.iterator](), iterator); -} - -testChain("Cocoa"); -testChain(new Map()); -testChain(new Set()); -testChain(new Array()); diff --git a/implementation-contributed/javascriptcore/stress/iterator-return-beyond-multiple-iteration-scopes.js b/implementation-contributed/javascriptcore/stress/iterator-return-beyond-multiple-iteration-scopes.js deleted file mode 100644 index df4a4fe8aa..0000000000 --- a/implementation-contributed/javascriptcore/stress/iterator-return-beyond-multiple-iteration-scopes.js +++ /dev/null @@ -1,172 +0,0 @@ - -function createIterator(callback) { - var array = [0,1,2,3,4,5]; - var iterator = array[Symbol.iterator](); - iterator.return = function () { - ++iterator.returned; - if (callback) - return callback(this); - return { done: true, value: undefined }; - }; - iterator.returned = 0; - return iterator; -} - -(function test() { - var outerIterator = createIterator(); - var innerIterator = createIterator(); - outer: for (var e1 of outerIterator) { - inner: for (var e2 of innerIterator) { - break outer; - } - } - if (innerIterator.returned !== 1) - throw new Error("bad value: " + innerIterator.returned); - if (outerIterator.returned !== 1) - throw new Error("bad value: " + outerIterator.returned); -}()); - -(function test() { - var outerIterator = createIterator(); - var innerIterator = createIterator(); - outer: for (var e1 of outerIterator) { - inner: for (var e2 of innerIterator) { - break inner; - } - } - if (innerIterator.returned !== 6) - throw new Error("bad value: " + innerIterator.returned); - if (outerIterator.returned !== 0) - throw new Error("bad value: " + outerIterator.returned); -}()); - -(function test() { - var outerIterator = createIterator(); - var innerIterator = createIterator(); - outer: for (var e1 of outerIterator) { - inner: for (var e2 of innerIterator) { - break; - } - } - if (innerIterator.returned !== 6) - throw new Error("bad value: " + innerIterator.returned); - if (outerIterator.returned !== 0) - throw new Error("bad value: " + outerIterator.returned); -}()); - -(function test() { - var outerIterator = createIterator(); - var innerIterator = createIterator(); - outer: for (var e1 of outerIterator) { - inner: for (var e2 of innerIterator) { - break; - } - } - if (innerIterator.returned !== 6) - throw new Error("bad value: " + innerIterator.returned); - if (outerIterator.returned !== 0) - throw new Error("bad value: " + outerIterator.returned); -}()); - -(function test() { - var outerIterator = createIterator(); - var innerIterator = createIterator(); - outer: for (var e1 of outerIterator) { - inner: for (var e2 of innerIterator) { - continue; - } - } - if (innerIterator.returned !== 0) - throw new Error("bad value: " + innerIterator.returned); - if (outerIterator.returned !== 0) - throw new Error("bad value: " + outerIterator.returned); -}()); - -(function test() { - var outerIterator = createIterator(); - var innerIterator = createIterator(); - outer: for (var e1 of outerIterator) { - inner: for (var e2 of innerIterator) { - continue inner; - } - } - if (innerIterator.returned !== 0) - throw new Error("bad value: " + innerIterator.returned); - if (outerIterator.returned !== 0) - throw new Error("bad value: " + outerIterator.returned); -}()); - -(function test() { - var outerIterator = createIterator(); - var innerIterator = createIterator(); - outer: for (var e1 of outerIterator) { - inner: for (var e2 of innerIterator) { - continue outer; - } - } - if (innerIterator.returned !== 6) - throw new Error("bad value: " + innerIterator.returned); - if (outerIterator.returned !== 0) - throw new Error("bad value: " + outerIterator.returned); -}()); - -(function test() { - var outerIterator = createIterator(); - var innerIterator = createIterator(); - (function () { - outer: for (var e1 of outerIterator) { - inner: for (var e2 of innerIterator) { - return; - } - } - }()); - if (innerIterator.returned !== 1) - throw new Error("bad value: " + innerIterator.returned); - if (outerIterator.returned !== 1) - throw new Error("bad value: " + outerIterator.returned); -}()); - -(function test() { - var outerIterator = createIterator(); - var innerIterator = createIterator(); - (function () { - outer: for (var e1 of outerIterator) { - inner: for (var e2 of innerIterator) { - } - return; - } - }()); - if (innerIterator.returned !== 0) - throw new Error("bad value: " + innerIterator.returned); - if (outerIterator.returned !== 1) - throw new Error("bad value: " + outerIterator.returned); -}()); - - -(function test() { - function raiseError() { - throw new Error("Cocoa"); - } - var outerIterator = createIterator(); - var innerIterator = createIterator(); - (function () { - var error = null; - try { - outer: for (var e1 of outerIterator) { - inner: for (var e2 of innerIterator) { - raiseError(); - } - } - } catch (e) { - error = e; - } - if (innerIterator.returned !== 1) - throw new Error("bad value: " + innerIterator.returned); - if (outerIterator.returned !== 1) - throw new Error("bad value: " + outerIterator.returned); - if (!error) - throw new Error("not thrown"); - if (String(error) !== "Error: Cocoa") - throw new Error("bad error: " + String(error)); - }()); -}()); diff --git a/implementation-contributed/javascriptcore/stress/iterators-shape.js b/implementation-contributed/javascriptcore/stress/iterators-shape.js deleted file mode 100644 index f2718b266d..0000000000 --- a/implementation-contributed/javascriptcore/stress/iterators-shape.js +++ /dev/null @@ -1,63 +0,0 @@ -// This test checks the shape of builtin iterators. - -function iteratorShape(iter) { - if (iter.hasOwnProperty('next')) - throw "Error: iterator should not have next method."; - if (!iter.__proto__.hasOwnProperty('next')) - throw "Error: iterator prototype should have next method."; - if (typeof iter.__proto__.next !== "function") - throw "Error: iterator prototype should have next method."; -} - -function sameNextMethods(iterators) { - var iterator = iterators[0]; - for (var i = 1; i < iterators.length; ++i) { - if (iterator.next !== iterators[i].next) - throw "Error: next method is not the same."; - } -} - -var array = ['Cocoa', 'Cappuccino', 'The des Alizes', 'Matcha', 'Kilimanjaro']; -var iterator = array[Symbol.iterator](); -iteratorShape(iterator); - -var keyIterator = array.keys(); -iteratorShape(keyIterator); - -var keyValueIterator = array.entries(); -iteratorShape(keyValueIterator); - -sameNextMethods([array[Symbol.iterator](), array.keys(), array.entries()]); - -var set = new Set(['Cocoa', 'Cappuccino', 'The des Alizes', 'Matcha', 'Kilimanjaro']); -var iterator = set[Symbol.iterator](); -iteratorShape(iterator); - -var keyIterator = set.keys(); -iteratorShape(keyIterator); - -var keyValueIterator = set.entries(); -iteratorShape(keyValueIterator); - -sameNextMethods([set[Symbol.iterator](), set.keys(), set.entries()]); - -var map = new Map(); -[ - [ 'Cocoa', 2, ], - [ 'Cappuccino', 0 ], - [ 'The des Alizes', 3 ], - [ 'Matcha', 2 ], - [ 'Kilimanjaro', 1] -].forEach(function ([ key, value ]) { - map.set(key, value); -}); -var iterator = map[Symbol.iterator](); -iteratorShape(iterator); - -var keyIterator = map.keys(); -iteratorShape(keyIterator); - -var keyValueIterator = map.entries(); -iteratorShape(keyValueIterator); - -sameNextMethods([map[Symbol.iterator](), map.keys(), map.entries()]); diff --git a/implementation-contributed/javascriptcore/stress/jit-cache-poly-replace-then-cache-get-and-fold-then-invalidate.js b/implementation-contributed/javascriptcore/stress/jit-cache-poly-replace-then-cache-get-and-fold-then-invalidate.js deleted file mode 100644 index 3d488a5669..0000000000 --- a/implementation-contributed/javascriptcore/stress/jit-cache-poly-replace-then-cache-get-and-fold-then-invalidate.js +++ /dev/null @@ -1,33 +0,0 @@ -var o = {f:42}; - -function foo(p, o, v) { - if (p) - o.f = v; -} - -function bar() { - return o.f; -} - -noInline(foo); -noInline(bar); - -for (var i = 0; i < 10; ++i) - foo(false); - -for (var i = 0; i < 10; ++i) - foo(true, {}, 42); - -for (var i = 0; i < 10; ++i) - foo(true, o, 42); - -for (var i = 0; i < 100000; ++i) { - var result = bar(); - if (result != 42) - throw "Error: bad result: " + result; -} - -foo(true, o, 53); -var result = bar(); -if (result != 53) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/jit-cache-replace-then-cache-get-and-fold-then-invalidate.js b/implementation-contributed/javascriptcore/stress/jit-cache-replace-then-cache-get-and-fold-then-invalidate.js deleted file mode 100644 index ccbdfd920c..0000000000 --- a/implementation-contributed/javascriptcore/stress/jit-cache-replace-then-cache-get-and-fold-then-invalidate.js +++ /dev/null @@ -1,30 +0,0 @@ -var o = {f:42}; - -function foo(p, v) { - if (p) - o.f = v; -} - -function bar() { - return o.f; -} - -noInline(foo); -noInline(bar); - -for (var i = 0; i < 10; ++i) - foo(false); - -for (var i = 0; i < 10; ++i) - foo(true, 42); - -for (var i = 0; i < 100000; ++i) { - var result = bar(); - if (result != 42) - throw "Error: bad result: " + result; -} - -foo(true, 53); -var result = bar(); -if (result != 53) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/jit-gracefully-handle-double-constants-in-math-operators.js b/implementation-contributed/javascriptcore/stress/jit-gracefully-handle-double-constants-in-math-operators.js deleted file mode 100644 index b34d31370e..0000000000 --- a/implementation-contributed/javascriptcore/stress/jit-gracefully-handle-double-constants-in-math-operators.js +++ /dev/null @@ -1,25 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("bad assertion!"); -} - - -function test() { - let cases = [ - ["/", 1], - ["*", 1], - ["+", 2], - ["-", 0], - [">>", 0], - [">>>", 0], - ["<<", 2], - ["^", 0], - ["&", 1], - ]; - - for (let [op, result] of cases) { - let program = `for (let i = 0; i < 500; i++) { assert((1,1)${op}1 === ${result}); }`; - eval(program); - } -} -test(); diff --git a/implementation-contributed/javascriptcore/stress/jit-put-to-scope-global-cache-watchpoint-invalidate.js b/implementation-contributed/javascriptcore/stress/jit-put-to-scope-global-cache-watchpoint-invalidate.js deleted file mode 100644 index 2dd09698aa..0000000000 --- a/implementation-contributed/javascriptcore/stress/jit-put-to-scope-global-cache-watchpoint-invalidate.js +++ /dev/null @@ -1,26 +0,0 @@ -function foo(p, v) { - if (p) - global = v; -} - -function bar() { - return global; -} - -noInline(foo); -noInline(bar); - -for (var i = 0; i < 10; ++i) - foo(false); - -var value = 42; -foo(true, value); -var n = 100000; -var m = 100; -for (var i = 0; i < n; ++i) { - if (i == n - m) - foo(true, value = 53); - var result = bar(); - if (result != value) - throw "Error: on iteration " + i + " got: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/joined-strings-should-not-exceed-max-string-length.js b/implementation-contributed/javascriptcore/stress/joined-strings-should-not-exceed-max-string-length.js deleted file mode 100644 index 4044b1bf11..0000000000 --- a/implementation-contributed/javascriptcore/stress/joined-strings-should-not-exceed-max-string-length.js +++ /dev/null @@ -1,30 +0,0 @@ -//@ skip if $memoryLimited -//@ runFTLNoCJIT if !$memoryLimited -// This test should not crash or fail any assertions. - -function shouldEqual(stepId, actual, expected) { - if (actual != expected) { - throw stepId + ": ERROR: expect " + expected + ", actual " + actual; - } -} - -var exception = undefined; - -arr = [null,null,null,null]; -str = "xx"; - -try { - for (var i = 0; i < 100; ++i) - str = arr.join(str); -} catch (e) { - exception = e; -} -shouldEqual(10000, exception, "Error: Out of memory"); - -exception = undefined; -try { - str += 'x'; -} catch(e) { - exception = e; -} -shouldEqual(10100, exception, undefined); diff --git a/implementation-contributed/javascriptcore/stress/js-fixed-array-out-of-memory.js b/implementation-contributed/javascriptcore/stress/js-fixed-array-out-of-memory.js deleted file mode 100644 index c5bab87987..0000000000 --- a/implementation-contributed/javascriptcore/stress/js-fixed-array-out-of-memory.js +++ /dev/null @@ -1,25 +0,0 @@ -//@ if $buildType == "debug" && !$memoryLimited then runDefault("--maxSingleAllocationSize=1048576") else skip end - -var exception; - -function foo() { }; - -function test(length) { - try { - foo([...new Array(length)].filter(() => { })); - } catch (e) { - exception = e; - } - - if (exception && exception != "Error: Out of memory") - throw "ERROR: length " + length + ": unexpected exception " + exception; -} - -var sizes = [ - 1, 10, 50, 100, 500, 1000, 5000, 10000, 50000, 100000, 500000, - 1000000, 5000000, 10000000, 50000000, 100000000, 500000000, 1000000000 -]; - -for (size of sizes) - test(size); - diff --git a/implementation-contributed/javascriptcore/stress/jsc-read.js b/implementation-contributed/javascriptcore/stress/jsc-read.js deleted file mode 100644 index 1b3204e0e8..0000000000 --- a/implementation-contributed/javascriptcore/stress/jsc-read.js +++ /dev/null @@ -1,36 +0,0 @@ -(function test() { - // Read this test file using jsc shell's builtins, and check that its content is as expected. - const in_file = 'jsc-read.js'; - - const check = content_read => { - let expect = '(' + test.toString() + ')();\n'; - if (content_read !== expect) - throw Error('Expected to read this file as-is, instead read:\n==========\n' + content_read + '\n=========='); - }; - - const test_arraybuffer = read_function => { - let file = read_function(in_file, 'binary'); - if (typeof file.buffer !== 'object' || file.byteLength === undefined || file.length === undefined || file.BYTES_PER_ELEMENT !== 1 || file.byteOffset !== 0) - throw Error('Expected a Uint8Array'); - let str = ''; - for (var i = 0; i != file.length; ++i) - str += String.fromCharCode(file[i]); // Assume ASCII. - check(str); - }; - - const test_string = read_function => { - let str = read_function(in_file); - if (typeof str !== 'string') - throw Error('Expected a string'); - check(str); - }; - - // jsc's original file reading function is `readFile`, whereas SpiderMonkey - // shell's file reading function is `read`. The latter is used by - // emscripten's shell.js (d8 calls it `readbuffer`, which shell.js - // polyfills). - test_arraybuffer(readFile); - test_arraybuffer(read); - test_string(readFile); - test_string(read); -})(); diff --git a/implementation-contributed/javascriptcore/stress/json-parse-on-frozen-object.js b/implementation-contributed/javascriptcore/stress/json-parse-on-frozen-object.js deleted file mode 100644 index f8ff08732e..0000000000 --- a/implementation-contributed/javascriptcore/stress/json-parse-on-frozen-object.js +++ /dev/null @@ -1,75 +0,0 @@ -//@ runFTLNoCJIT - -function shouldEqual(testId, actual, expected) { - if (actual != expected) { - throw testId + ": ERROR: expect " + expected + ", actual " + actual; - } -} - -function frozenArrayReviver(k, v) { - if (k === "a") { - this.b = Object.freeze(["unmodifiable"]); - return v; - } - if (k === "0") - return "modified"; - return v; -} - -function frozenArrayLikeObjectReviver(k, v) { - if (k === "a") { - var obj = {}; - obj[0] = 'unmodifiable'; - obj.length = 1; - this.b = Object.freeze(obj); - return v; - } - if (k === "0") - return "modified"; - return v; -} - -function frozenArrayReviverWithDelete(k, v) { - if (k === "a") { - this.b = Object.freeze(["unmodifiable"]); - return v; - } - if (k === "0") - return undefined; - return v; -} - -function frozenArrayLikeObjectReviverWithDelete(k, v) { - if (k === "a") { - var obj = {}; - obj[0] = 'unmodifiable'; - obj.length = 1; - this.b = Object.freeze(obj); - return v; - } - if (k === "0") - return undefined; - return v; -} - -function runTest(testId, reviver, expectedValue, expectedException) { - let numIterations = 10000; - for (var i = 0; i < numIterations; i++) { - var exception = undefined; - - var obj; - try { - obj = JSON.parse('{ "a": 0, "b": 0 }', reviver); - } catch (e) { - exception = "" + e; - exception = exception.substr(0, 10); // Search for "TypeError:". - } - shouldEqual(testId, exception, expectedException); - shouldEqual(testId, obj.b[0], expectedValue); - } -} - -runTest(10000, frozenArrayReviver, "unmodifiable", undefined); -runTest(10001, frozenArrayLikeObjectReviver, "unmodifiable", undefined); -runTest(10002, frozenArrayReviverWithDelete, "unmodifiable", undefined); -runTest(10003, frozenArrayLikeObjectReviverWithDelete, "unmodifiable", undefined); diff --git a/implementation-contributed/javascriptcore/stress/large-unshift-splice.js b/implementation-contributed/javascriptcore/stress/large-unshift-splice.js deleted file mode 100644 index d1a28481ae..0000000000 --- a/implementation-contributed/javascriptcore/stress/large-unshift-splice.js +++ /dev/null @@ -1,18 +0,0 @@ -//@ skip if $memoryLimited - -function make_contig_arr(sz) -{ - let a = []; - while (a.length < sz / 8) - a.push(3.14); - a.length *= 8; - return a; -} - -try { - let ARRAY_LENGTH = 0x10000000; - let a = make_contig_arr(ARRAY_LENGTH); - let b = make_contig_arr(0xff00); - b.unshift(a.length-0x10000, 0); - Array.prototype.splice.apply(a, b); -} catch (e) {} diff --git a/implementation-contributed/javascriptcore/stress/lars-sab-workers.js b/implementation-contributed/javascriptcore/stress/lars-sab-workers.js deleted file mode 100644 index bae400f720..0000000000 --- a/implementation-contributed/javascriptcore/stress/lars-sab-workers.js +++ /dev/null @@ -1,127 +0,0 @@ -//@ skip - -var sab = new SharedArrayBuffer(100 * 4); - -var memory = new Int32Array(sab); - -var numWorkers = 0; -function startWorker(code) -{ - print("Starting worker!"); - - numWorkers++; - $.agent.start(code); -} - -resources = ` -function wait(memory, index, waitCondition, wakeCondition) -{ - while (memory[index] == waitCondition) { - var result = Atomics.wait(memory, index, waitCondition); - switch (result) { - case "not-equal": - case "ok": - break; - default: - $.agent.report("Error: bad result from wait: " + result); - $.agent.report("error"); - break; - } - var value = memory[index]; - if (value != wakeCondition) { - $.agent.report("Error: wait returned not-equal but the memory has a bad value: " + value); - $.agent.report("error"); - } - } - var value = memory[index]; - if (value != wakeCondition) { - $.agent.report("Error: done waiting but the memory has a bad value: " + value); - $.agent.report("error"); - } -} - -function wake(memory, index) -{ - var result = Atomics.wake(memory, index, 1); - if (result != 0 && result != 1) { - $.agent.report("Error: bad result from wake: " + result); - $.agent.report("error"); - } -} -`; - -startWorker( - resources + ` - $.agent.receiveBroadcast(sab => { - var memory = new Int32Array(sab); - var didStartIdx = 0; - var shouldGoIdx = 1; - var didEndIdx = 2; - - $.agent.report("1: Started!"); - $.agent.report("1: Memory: " + memory); - - wait(memory, didStartIdx, 0, 1); - - $.agent.report("1: It started!"); - - memory[shouldGoIdx] = 1; - wake(memory, shouldGoIdx); - - wait(memory, didEndIdx, 0, 1); - - $.agent.report("1: All done!"); - $.agent.report("1: Memory: " + memory); - $.agent.report("done"); - }); - `); - -startWorker( - resources + ` - $.agent.receiveBroadcast(sab => { - var memory = new Int32Array(sab); - var didStartIdx = 0; - var shouldGoIdx = 1; - var didEndIdx = 2; - - $.agent.report("2: Started!"); - $.agent.report("2: Memory: " + memory); - - Atomics.store(memory, didStartIdx, 1); - wake(memory, didStartIdx); - - wait(memory, shouldGoIdx, 0, 1); - - Atomics.store(memory, didEndIdx, 1); - wake(memory, didEndIdx, 1); - - $.agent.report("2: Memory: " + memory); - $.agent.report("done"); - }); - `); - -$.agent.broadcast(sab); - -for (;;) { - var report = waitForReport(); - if (report == "done") { - if (!--numWorkers) { - print("All workers done!"); - break; - } - } else if (report == "error") { - print("Test failed!"); - throw new Error("Test failed."); - } else - print("report: " + report); -} - -for (var i = 0; i < 3; ++i) { - if (memory[i] != 1) - throw "Error: Bad value at memory[" + i + "]: " + memory[i]; -} -for (var i = 3; i < memory.length; ++i) { - if (memory[i] != 0) - throw "Error: Bad value at memory[" + i + "]: " + memory[i]; -} -print("Test passed!"); diff --git a/implementation-contributed/javascriptcore/stress/length-of-new-array-with-spread.js b/implementation-contributed/javascriptcore/stress/length-of-new-array-with-spread.js deleted file mode 100644 index 215ee5559a..0000000000 --- a/implementation-contributed/javascriptcore/stress/length-of-new-array-with-spread.js +++ /dev/null @@ -1,31 +0,0 @@ -function foo() -{ - var a = [1, 2]; - var l = [...a, 42, ...a].length; - if (l != 5) - throw "Wrong length in foo: " + l; -} -noInline(foo); - -function bar(...b) -{ - var l = [...b, 43, ...b].length; - if (l != 7) - throw "Wrong length in bar: " + l -} -noInline(bar); - -function baz(arg0, ...c) -{ - var x = [...c, ...c]; - var l = [...x, ...x, ...x].length; - if (l != 24) - throw "Wrong length in baz: " + l -} -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - foo(); - bar(1, 2, 3); - baz(0, 1, 2, 3, 4); -} diff --git a/implementation-contributed/javascriptcore/stress/lexical-let-and-with-statement.js b/implementation-contributed/javascriptcore/stress/lexical-let-and-with-statement.js deleted file mode 100644 index 9c39b9157a..0000000000 --- a/implementation-contributed/javascriptcore/stress/lexical-let-and-with-statement.js +++ /dev/null @@ -1,78 +0,0 @@ -function truth() { - return true; -} -noInline(truth); - -function assert(cond) { - if (!cond) - throw new Error("broke assertion"); -} - -noInline(assert); - -;(function() { - function foo() { - let x = 40; - with ({x : 100}) { - assert(x === 100); - } - with ({y : 100}) { - assert(x === 40); - } - } - noInline(foo); - - function bar() { - let x = 40; - function capX() { return x; } - with ({x : 100}) { - if (truth()) { - let x = 50; - let capX = function() { return x; } - assert(x === 50); - assert(capX() === x); - } - assert(x === 100); - assert(capX() === 40); - } - with ({y : 100}) { - if (truth()) { - let x = 50; - let capX = function() { return x; } - assert(x === 50); - assert(capX() === x); - } - assert(x === 40); - assert(capX() === 40); - } - } - noInline(bar); - - function baz() { - let x = 40; - function capX() { return x; } - with ({x : 100}) { - if (truth()) { - let x = 50; - assert(x === 50); - } - assert(x === 100); - assert(capX() === 40); - } - with ({y : 100}) { - if (truth()) { - let x = 50; - assert(x === 50); - } - assert(x === 40); - assert(capX() === 40); - } - } - noInline(baz); - - for (let i = 0; i < 100; i++) { - foo(); - bar(); - baz(); - } -})(); diff --git a/implementation-contributed/javascriptcore/stress/lexical-let-exception-handling.js b/implementation-contributed/javascriptcore/stress/lexical-let-exception-handling.js deleted file mode 100644 index ae8449d31e..0000000000 --- a/implementation-contributed/javascriptcore/stress/lexical-let-exception-handling.js +++ /dev/null @@ -1,202 +0,0 @@ -"use strict"; - -function truth() { - return true; -} -noInline(truth); - -function assert(cond) { - if (!cond) - throw new Error("broke assertion"); -} -noInline(assert); - -const NUM_LOOPS = 100; - -;(function () { - -function foo() { - let x = 20; - let y = "y"; - try { - assert(x === 20); - assert(y === "y"); - throw "error"; - } catch(e) { - assert(x === 20); - } finally { - assert(x === 20); - assert(y === "y"); - } - - for (let i = 0; i < 1; i++) { - let numFinally = 0; - try { - let a = 40; - let capA = function() { return a; } - assert(capA() === 40); - try { - let b = 41; - let capB = function() { return b; } - assert(capB() === 41); - assert(capA() === 40); - try { - return 20; - } catch(e){ - } finally { - let c = 42; - let capC = function() { return c; } - assert(capC() === 42); - assert(capB() === 41); - assert(capA() === 40); - if (i === 0) { - numFinally++; - } - return 22; - } - } catch(e) { - } finally { - if (i === 0) { - numFinally++; - } - return 23; - } - } catch(e) { - } finally { - if (i === 0) { - numFinally++; - } - assert(numFinally === 3); - return 24; - } - } -} - -for (var i = 0; i < NUM_LOOPS; i++) { - assert(foo() === 24); -} - -})(); - - -;(function () { -function foo() { - for (let i = 0; i < 1; i++) { - let numFinally = 0; - let numErrors = 0; - try { - let a = 40; - let capA = function() { return a; } - assert(capA() === 40); - try { - let b = 41; - let capB = function() { return b; } - assert(capB() === 41); - assert(capA() === 40); - try { - throw "e"; - } catch(e) { - assert(i === 0); - assert(capB() === 41); - assert(capA() === 40); - numErrors++; - throw e; - } finally { - let c = 42; - let capC = function() { return c; } - let local = "local"; - assert(local === "local"); - assert(capC() === 42); - assert(capB() === 41); - assert(capA() === 40); - if (i === 0) { - numFinally++; - } - } - } catch(e) { - assert(i === 0); - assert(capA() === 40); - numErrors++; - let local = "local"; - assert(local === "local"); - } finally { - assert(capA() === 40); - if (i === 0) { - numFinally++; - } - let local = "local"; - assert(local === "local"); - return 23; - } - } catch(e) { - //assert(i === 0); - } finally { - if (i === 0) { - numFinally++; - } - - assert(numFinally === 3); - assert(numErrors === 2); - return 24; - } - } -} - -for (var i = 0; i < NUM_LOOPS; i++) { - assert(foo() === 24); -} - -})(); - - -var d = 100; -;(function (){ -function foo() { - assert(d === 100); - for (let i = 0; i < 1; i++) { - let numFinally = 0; - let numErrors = 0; - let c = 44; - assert(d === 100); - try { - let d = 45; - if (truth()) { - let a = 20; - let capA = function() { return a; } - assert(capA() === 20); - if (truth()) { - let b = 21; - let e = 48; - let capB = function() { return b; } - assert(capB() === 21); - assert(d === 45); - try { - throw "e"; - } catch(e) { - assert(capA() === 20); - assert(a === 20); - numErrors++; - } finally { - assert(capA() === 20); - assert(e === 48); - numFinally++; - return 30; - } - } - } - } finally { - assert(c === 44); - assert(d === 100); - numFinally++; - assert(numFinally === 2); - assert(numErrors === 1); - return 40; - } - } -} - -for (var i = 0; i < NUM_LOOPS; i++) { - assert(foo() === 40); -} - -})(); diff --git a/implementation-contributed/javascriptcore/stress/lexical-let-global-not-captured-variables.js b/implementation-contributed/javascriptcore/stress/lexical-let-global-not-captured-variables.js deleted file mode 100644 index 66a6890bb8..0000000000 --- a/implementation-contributed/javascriptcore/stress/lexical-let-global-not-captured-variables.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; - -function truth() { - return true; -} -noInline(truth); - -function assert(cond) { - if (!cond) - throw new Error("broke assertion"); -} -noInline(assert); - - -function foo(y) { - return y; -} - -let x = 40; -assert(x === 40); - -for (var i = 0; i < 1000; i++) { - if (truth()) { - let y = 20; - let capY = function() { return y; } - assert(x === 40); - assert(capY() === 20); - assert(foo(i) === i); - } -} -assert(foo("hello") === "hello"); diff --git a/implementation-contributed/javascriptcore/stress/lexical-let-loop-semantics.js b/implementation-contributed/javascriptcore/stress/lexical-let-loop-semantics.js deleted file mode 100644 index e5c6d23426..0000000000 --- a/implementation-contributed/javascriptcore/stress/lexical-let-loop-semantics.js +++ /dev/null @@ -1,381 +0,0 @@ -"use strict"; - -function truth() { - return true; -} -noInline(truth); - -function assert(cond) { - if (!cond) - throw new Error("broke assertion"); -} -noInline(assert); - -const NUM_LOOPS = 1000; -const SHORT_LOOPS = 100; - -function shouldThrowTDZ(func) { - var hasThrown = false; - try { - func(); - } catch(e) { - if (e.name.indexOf("ReferenceError") !== -1) - hasThrown = true; - } - assert(hasThrown); -} -noInline(shouldThrowTDZ); - - -;(function () { - var arr = []; - - for (let i = 0; i < 10; i++) { - arr.push(function () { return i; }) - } - - for (let j = 0; j < arr.length; j++) { - assert(arr[j]() === j); - } - - let f = "fff"; - let counter = 0; - for (let f of arr) { - assert(f() === counter++); - } - assert(f === "fff"); - - let numLoops = 0; - for (let f of arr) { - numLoops++; - let f = function () { return "f"; } - assert(f() === "f"); - } - assert(numLoops === arr.length); - assert(f === "fff"); - -})(); - - -;(function() { - function foo() { - var obj = {hello:1, world:2}; - obj["bar"] = 3; - let p = 20; - assert(p === 20); - for (let p in obj) { - assert(p === "hello" || p === "world" || p === "bar"); - } - assert(p === 20); - } - - function bar() { - var obj = {hello:1, world:2}; - obj["bar"] = 3; - let props = []; - let p = 20; - for (let p in obj) { - props.push(function foo() { return p; }); - let outerP = p; - if (truth()) { - let p = 100; - assert(p === 100); - assert(p !== outerP); - assert(outerP === "hello" || outerP === "world" || outerP === "bar"); - } - assert(p === outerP); - } - assert(p === 20); - - let seenProps = {}; - for (let f of props) { - let p = f(); - assert(p === "hello" || p === "world" || p === "bar"); - seenProps[p] = true; - } - assert(seenProps["hello"] === true); - assert(seenProps["world"] === true); - assert(seenProps["bar"] === true); - assert(p === 20); - } - - for (var i = 0; i < NUM_LOOPS; i++) { - foo(); - bar(); - } -})(); - - -;(function() { - function foo() { - let counter = 0; - for (let idx = 0; idx < 20; idx++) { - assert(idx === counter++); - continue; - } - shouldThrowTDZ(function() { return idx; }); - } - for (var i = 0; i < NUM_LOOPS; i++) { - foo(); - } -})(); - - -;(function() { - function foo() { - for (let idx = 0; !truth(); idx++) { } - shouldThrowTDZ(function() { return idx; }); // Just plain old reference error here. - } - function bar() { - for (let j = 0; j < 20; j++) { - if (j === 1) - break; - else - continue; - } - shouldThrowTDZ(function() { return j; }); - } - for (var i = 0; i < NUM_LOOPS; i++) { - foo(); - bar(); - } -})(); - - -;(function() { - function foo() { - var obj = {hello:1, world:2}; - let p = 20; - var arr = [] - for (let p in obj) { - arr.push(function capP() { return p; }); - assert(p === "hello" || p === "world"); - } - assert(arr[0]() === "hello" || arr[0]() === "world"); - assert(arr[1]() === "hello" || arr[1]() === "world"); - assert(arr[1]() !== arr[0]()); - assert(p === 20); - } - - function bar() { - var obj = {a:1, b:2, c:3, d:4, e:4}; - obj["f"] = 5; - let funcs = []; - for (let p in obj) { - funcs.push(function capP() { return p; }); - } - let counter = 0; - for (let p in obj) { - assert(funcs[counter]() === p); - counter++; - } - } - - for (var i = 0; i < NUM_LOOPS; i++) { - foo(); - bar(); - } -})(); - - -;(function() { - function foo() { - let arr = [0, 1, 2, 3, 4, 5]; - let funcs = []; - for (let x of arr) { - funcs.push(function() { return x; }); - } - for (let i = 0; i < arr.length; ++i) { - assert(funcs[i]() === i); - } - } - - for (var i = 0; i < NUM_LOOPS; i++) { - foo(); - } -})(); - - -;(function() { - function foo() { - let thing = {}; - for (let thing = thing; !thing; ) {} - } - for (var i = 0; i < NUM_LOOPS; i++) { - shouldThrowTDZ(foo); - } -})(); - - -;(function() { - function foo() { - let thing = {}; - for (let thing = eval("thing"); !truth(); ) {} - } - - for (var i = 0; i < SHORT_LOOPS; i++) { - shouldThrowTDZ(foo); - } -})(); - - -;(function() { - function foo() { - let thing = {}; - for (let thing in thing) {} - } - function bar() { - let thing = {hello: "world"} - for (let thing in thing) {} - } - function baz() { - let thing = {}; - for (let thing in eval("thing")) {} - } - function bag() { - let thing = {hello: "world"} - for (let thing in eval("thing")) {} - } - for (var i = 0; i < SHORT_LOOPS; i++) { - shouldThrowTDZ(foo); - shouldThrowTDZ(bar); - shouldThrowTDZ(baz); - shouldThrowTDZ(bag); - } -})(); - - -;(function() { - function foo() { - let thing = ["hello"]; - for (let thing in thing) {} - } - function bar() { - let thing = []; - for (let thing in thing) {} - } - function baz() { - let thing = {hello: "world"}; - for (let thing in thing) {} - } - function bag() { - let empty = {}; - for (let thing in empty) {} - return thing; - } - function hat() { - let notEmpty = {foo: "bar"}; - for (let thing in notEmpty) { - break; - } - return thing; - } - function cap() { - let notEmpty = {foo: "bar"}; - for (let thing in notEmpty) { - continue; - } - return thing; - } - for (var i = 0; i < NUM_LOOPS; i++) { - shouldThrowTDZ(foo); - shouldThrowTDZ(bar); - shouldThrowTDZ(baz); - shouldThrowTDZ(bag); - shouldThrowTDZ(hat); - shouldThrowTDZ(cap); - } -})(); - - -;(function() { - function foo() { - let thing = ["hello"]; - for (let thing of thing) {} - } - function bar() { - let thing = []; - for (let thing of thing) {} - } - function baz() { - let thing = ["world"] - for (let thing of thing) {} - } - function bag() { - let empty = []; - for (let thing of empty) {} - return thing; - } - function hat() { - let notEmpty = ["hello", "world"]; - for (let thing of notEmpty) { - break; - } - return thing; - } - function tap() { - let notEmpty = [10, 20]; - for (let thing of notEmpty) { } - return thing; - } - function cap() { - let notEmpty = [10, 20]; - for (let thing of notEmpty) { - continue; - } - return thing; - } - function pap() { - let notEmpty = [10, 20]; - for (let thing of notEmpty) { - } - return thing; - } - for (var i = 0; i < SHORT_LOOPS; i++) { - shouldThrowTDZ(foo); - shouldThrowTDZ(bar); - shouldThrowTDZ(baz); - shouldThrowTDZ(bag); - shouldThrowTDZ(hat); - shouldThrowTDZ(tap); - shouldThrowTDZ(cap); - shouldThrowTDZ(pap); - } -})(); - - -;(function() { - function foo() { - let x = 0; - let arr = []; - for (let x of (x=2, obj)) { x; } - } - - function bar() { - let x = 0; - let obj = {}; - for (let x in (x=2, obj)) { x; } - } - - for (var i = 0; i < SHORT_LOOPS; i++) { - shouldThrowTDZ(foo); - shouldThrowTDZ(bar); - } -})(); - - -;(function() { - let factorial = null; - function test() { - for (let factorial = function(x){ return x > 1 ? x * factorial(x - 1) : 1; }; true; ) { return factorial(5); } - } - assert(test() === 120); -})(); - -;(function() { - function test() { - for (let factorial = function(x){ return x > 1 ? x * factorial(x - 1) : 1; }; true; ) { return factorial(5); } - } - assert(test() === 120); -})(); - diff --git a/implementation-contributed/javascriptcore/stress/lexical-let-not-strict-mode.js b/implementation-contributed/javascriptcore/stress/lexical-let-not-strict-mode.js deleted file mode 100644 index 56f1f97aee..0000000000 --- a/implementation-contributed/javascriptcore/stress/lexical-let-not-strict-mode.js +++ /dev/null @@ -1,128 +0,0 @@ -function truth() { - return true; -} -noInline(truth); - -function assert(cond) { - if (!cond) - throw new Error("broke assertion"); -} -noInline(assert); - -function shouldThrowTDZ(func) { - var hasThrown = false; - try { - func(); - } catch(e) { - if (e.name.indexOf("ReferenceError") !== -1) - hasThrown = true; - } - assert(hasThrown); -} -noInline(shouldThrowTDZ); - -;(function() { - -function foo() { - delete x; - let x; -} -function bar() { - delete x; - let x; - function capX() { return x; } -} - -for (var i = 0; i < 1000; i++) { - shouldThrowTDZ(foo); - shouldThrowTDZ(bar); -} - -})(); - - -;(function() { - -function foo() { - var hadError = false; - try { - x; - } catch(e) { - hadError = true; - } - assert(hadError); - - if (truth()) { - // This eval is enterpreted as follows: - // eval("var x; x = 20"); - // We first assign undefined to the "var x". - // Then, we interperet an assignment expression - // into the resolved variable x. x resolves to the lexical "let x;" - // Look at ECMA section 13.3.2.4 of the ES6 spec: - // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-variable-statement-runtime-semantics-evaluation - // And also look at section 8.3.1 ResolveBinding: - // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-resolvebinding - let x = 40; - eval("var x = 20;"); - assert(x === 20); - } - assert(x === undefined); -} - -function bar() { - var hadError = false; - try { - x; - } catch(e) { - hadError = true; - } - assert(hadError); - - if (truth()) { - let x = 40; - function capX() { return x; } - eval("var x = 20;"); - assert(x === 20); - } - assert(x === undefined); -} - -function baz() { - if (truth()) { - let x = 40; - eval("let x = 20; assert(x === 20);"); - assert(x === 40); - } - if (truth()) { - let x = 40; - function capX() { return x; } - eval("let x = 20; assert(x === 20);"); - assert(x === 40); - } -} - -function baz() { - // Test eval() caching. - let x = 20; - let evalString = "x;"; - - assert(eval(evalString) === 20); - if (truth()) { - let y = 60; - assert(eval(evalString) === 20); - assert(y === 60); - if (truth()) { - let y = 50, z = 70, x = 40; - assert(eval(evalString) === 40); - assert(y === 50 && z === 70); - } - } -} - -for (var i = 0; i < 100; i++) { - foo(); - bar(); - baz(); -} - -})(); diff --git a/implementation-contributed/javascriptcore/stress/lexical-let-semantics.js b/implementation-contributed/javascriptcore/stress/lexical-let-semantics.js deleted file mode 100644 index db13914a29..0000000000 --- a/implementation-contributed/javascriptcore/stress/lexical-let-semantics.js +++ /dev/null @@ -1,412 +0,0 @@ -"use strict"; -function truth() { - return true; -} -noInline(truth); - -function assert(cond) { - if (!cond) - throw new Error("broke assertion"); -} -noInline(assert); - - -// ========== tests below =========== - -const NUM_LOOPS = 1000; - -let globalLet = "helloWorld"; -assert(globalLet === "helloWorld"); -function captureGlobalLet() { return globalLet; } -assert(globalLet === captureGlobalLet()); -let globalFunction = function() { return 20; } -assert(globalFunction() === 20); -assert((function() { return globalFunction(); })() === 20); -let globalNumber = 20; -assert(globalNumber === 20); -globalNumber++; -assert(globalNumber === 21); -globalNumber += 40; -assert(globalNumber === 61); -globalNumber = "hello"; -assert(globalNumber === "hello"); - -let globalNumberCaptured = 20; -let retGlobalNumberCaptured = function() { return globalNumberCaptured; } -let setGlobalNumberCaptured = function(x) { globalNumberCaptured = x; } -assert(retGlobalNumberCaptured() === globalNumberCaptured); -globalNumberCaptured++; -assert(retGlobalNumberCaptured() === globalNumberCaptured); -assert(globalNumberCaptured === 21); -setGlobalNumberCaptured(100); -assert(retGlobalNumberCaptured() === globalNumberCaptured); -assert(globalNumberCaptured === 100); -setGlobalNumberCaptured(retGlobalNumberCaptured); -assert(retGlobalNumberCaptured() === retGlobalNumberCaptured); -assert(globalNumberCaptured === retGlobalNumberCaptured); - -var arrOfFuncs = []; -for (var i = 0; i < NUM_LOOPS; i++) { - let globalLet = "inner"; - assert(globalLet === "inner"); - let inner = i; - arrOfFuncs.push(function() { return inner; }); -} -assert(globalLet === "helloWorld"); -for (var i = 0; i < arrOfFuncs.length; i++) - assert(arrOfFuncs[i]() === i); - - -var globalVar = 100; -assert(globalVar === 100); -;(function () { - assert(globalVar === 100); - if (truth()) { - let globalVar = 20; - assert(globalVar === 20); - } - assert(globalVar === 100); -})(); - -assert(globalVar === 100); -;(function () { - let globalVar = 10; - assert(globalVar === 10); - if (truth()) { - let globalVar = 20; - assert(globalVar === 20); - } - assert(globalVar === 10); -})(); -assert(globalVar === 100); - - -;(function() { -function foo() { - let x = 20; - - if (truth()) { - let thingy = function() { - x = 200; - return x; - }; - noInline(thingy); - thingy(); - } - - return x; -} - -for (var i = 0; i < NUM_LOOPS; i++) { - assert(foo() === 200); -} -})(); - - -;(function() { -var arr = []; -function foo(i) { - var num = i; - - if (truth()) { - let num = i; - arr.push(function() { return num; }); - } - var oldFunc = arr[arr.length - 1]; - arr[arr.length - 1] = function() { return oldFunc() + num; } -} - -for (var i = 0; i < NUM_LOOPS; i++) { - foo(i); -} - -for (var i = 0; i < arr.length; i++) { - assert(arr[i]() === i + i); -} -})(); - - -;(function() { -function foo() { - let x = 20; - let y = 40; - assert(x === 20); - assert(y === 40); - if (truth()) { - let x = 50; - let y = 60; - assert(x === 50); - assert(y === 60); - } - assert(x === 20); - assert(y === 40); -} - -for (var i = 0; i < NUM_LOOPS; i++) { - foo(); -} -})(); - - -;(function() { -function foo() { - function captureX() { return x; } - let x = 20; - let y = 40; - assert(x === 20); - assert(y === 40); - if (truth()) { - let x = 50; - let y = 60; - assert(x === 50); - assert(y === 60); - } - assert(x === 20); - assert(y === 40); -} - -for (var i = 0; i < NUM_LOOPS; i++) { - foo(); -} -})(); - - -;(function() { -function foo() { - let x = 20; - let y = 40; - function captureAll() { return x + y; } - noInline(captureAll); - assert(x === 20); - assert(y === 40); - assert(captureAll() === 60); - if (truth()) { - let x = 50; - assert(x + y === 90); - assert(captureAll() === 60); - } - assert(x === 20); - assert(y === 40); -} - -for (var i = 0; i < NUM_LOOPS; i++) { - foo(); -} -})(); - - -;(function() { -function foo() { - var captureAll = function() { return x + y; } - let x = 20; - let {_y : y, z} = {_y : 40, z : 100}; - assert(x === 20); - assert(y === 40); - assert(z === 100); - assert(captureAll() === 60); - if (truth()) { - let x = 50; - assert(x + y === 90); - assert(y === 40); - assert(captureAll() === 60); - } - assert(x === 20); - assert(y === 40); -} - -for (var i = 0; i < NUM_LOOPS; i++) { - foo(); -} -})(); - - -;(function() { -function foo() { - var captureAll = function() { return x + y; } - let x = 20; - let y = 40; - assert(x === 20); - assert(y === 40); - assert(captureAll() === 60); - if (truth()) { - let x = 50; - let secondCaptureAll = function() { return x + y; }; - assert(x + y === 90); - assert(secondCaptureAll() === 90); - } - assert(x === 20); - assert(y === 40); -} - -for (var i = 0; i < NUM_LOOPS; i++) { - foo(); -} -})(); - - -;(function() { -function foo() { - let x, y, z; - assert(x === undefined); - assert(y === undefined); - assert(z === undefined); -} -function bar() { - let x, y, z; - if (truth()) { - let x = 20, y = 40; - assert(x === 20); - assert(y === 40); - } - function capture() { return x + z; } - assert(x === undefined); - assert(y === undefined); - assert(z === undefined); -} - -for (var i = 0; i < NUM_LOOPS; i++) { - foo(); - bar(); -} -})(); - - -;(function() { -function foo() { - let x, y, z = "z", t = undefined; - assert(cap() === undefined); - assert(x === undefined); - assert(y === undefined); - assert(t === undefined); - assert(z === "z"); - - function cap() { return x; } -} - -for (var i = 0; i < NUM_LOOPS; i++) { - foo(); -} -})(); - -;(function() { -function foo() { - let {x: baz} = {x: 20}; - let {x: bar} = {x: 200}; - function cap() { return baz; } - assert(baz === 20); - assert(bar === 200); - assert(cap() === 20); - baz = 40; - assert(baz === 40); - assert(cap() === 40); -} - -for (var i = 0; i < NUM_LOOPS; i++) { - foo(); -} - -})(); - - - -;(function() { -function foo() { - let x = 20; - let y = 50; - assert(y === 50); - assert(eval("y = 25; let x = 40; x;") === 40); - assert(x === 20); - assert(y === 25); -} - -for (var i = 0; i < NUM_LOOPS; i++) { - foo(); -} -})(); - - -;(function() { -function foo() { - let x = 20; - let y = 50; - assert(y === 50); - if (truth()) { - let y = 30; - assert(y === 30); - assert(eval("y = 25; let x = 40; x;") === 40); - assert(y === 25); - assert(x === 20); - if (truth()) { - let y = 100; - assert(y === 100); - x = 1; - } - assert(x === 1); - assert(y === 25); - } - assert(x === 1); - assert(y === 50); -} - -for (var i = 0; i < NUM_LOOPS; i++) { - foo(); -} -})(); - - -;(function() { -function foo(x) { - let y = 50; - let result = null; - switch(x) { - case 10: - let y = 40; - assert(y === 40); - case 20: - y += 1; - assert(y === 41); - result = y; - break; - default: - result = x; - break; - } - assert(y === 50); - return result; -} - -for (var i = 0; i < NUM_LOOPS; i++) { - assert(foo(10) === 41); -} - -assert(foo("hello") === "hello"); -})(); - - -;(function() { -function foo(x) { - let y = 50; - let result = null; - switch(x) { - case 10: - let y = 40; - assert(y === 40); - case 20: - y += 1; - assert(y === 41); - result = function() { return y; }; - break; - default: - result = x; - break; - } - assert(y === 50); - return result; -} - -for (var i = 0; i < NUM_LOOPS; i++) { - assert(foo(10)() === 41); -} - -assert(foo("hello") === "hello"); -})(); diff --git a/implementation-contributed/javascriptcore/stress/lexical-let-tdz.js b/implementation-contributed/javascriptcore/stress/lexical-let-tdz.js deleted file mode 100644 index 3cede78c0d..0000000000 --- a/implementation-contributed/javascriptcore/stress/lexical-let-tdz.js +++ /dev/null @@ -1,473 +0,0 @@ -"use strict"; - -function truth() { - return true; -} -noInline(truth); - -function assert(cond) { - if (!cond) - throw new Error("broke assertion"); -} -noInline(assert); - -function shouldThrowTDZ(func) { - var hasThrown = false; - try { - func(); - } catch(e) { - if (e.name.indexOf("ReferenceError") !== -1) - hasThrown = true; - } - assert(hasThrown); -} -noInline(shouldThrowTDZ); - -const NUM_LOOPS = 1000; -const SHORT_LOOPS = 100; - - -;(function() { -function foo() { - x; - let x = 20; -} -function bar() { - let x = x; -} -function baz() { - let {x: prop, y: prop2} = {x: prop}; -} -function jaz() { - let {x: prop, y: prop2} = {x: 20, y: prop}; -} -for (var i = 0; i < NUM_LOOPS; i++) { - shouldThrowTDZ(foo); - shouldThrowTDZ(bar); - shouldThrowTDZ(baz); - shouldThrowTDZ(jaz); -} -})(); - - -;(function() { -function foo() { - x; - let x = 20; - function captureX() { return x; } -} -function bar() { - captureX(); - let x = 20; - function captureX() { return x; } -} - -for (var i = 0; i < NUM_LOOPS; i++) { - shouldThrowTDZ(foo); - shouldThrowTDZ(bar); -} -})(); - - -;(function() { -function foo() { - if (truth()) { - let x = 20; - assert(x === 20); - } - x; - let x = 20; -} - -for (var i = 0; i < NUM_LOOPS; i++) { - shouldThrowTDZ(foo); -} -})(); - - - -;(function() { -function foo() { - if (truth()) { - let y = 20; - let captureY = function() { return y; } - assert(y === 20); - x; - } - let x = 20; - let y; -} - -for (var i = 0; i < NUM_LOOPS; i++) { - shouldThrowTDZ(foo); -} -})(); - - -;(function() { -function foo() { - if (truth()) { - let y = 20; - let x = 40; - let captureAll = function() { return x + y; } - //noInline(captureAll); - assert(y === 20); - assert(x === 40); - assert(captureAll() === 60); - } - tdz; - let tdz = 20; -} - -for (var i = 0; i < NUM_LOOPS; i++) { - shouldThrowTDZ(foo); -} -})(); - - -;(function() { -function foo() { - if (truth()) { - let y = 20; - let x = 40; - let captureAll = function() { return x + y + tdz; } - assert(y === 20); - assert(x === 40); - } - tdz; - let tdz = 20; -} - -for (var i = 0; i < NUM_LOOPS; i++) { - shouldThrowTDZ(foo); -} -})(); - - -;(function() { -function foo() { - x = 10; - let x = 20; -} - -for (var i = 0; i < NUM_LOOPS; i++) { - shouldThrowTDZ(foo); -} -})(); - - -;(function() { -function foo() { - x = 10; - let x = 20; - function cap() { return x; } -} -function bar() { - captureX(); - let x = 20; - function captureX() { return x; } -} - -for (var i = 0; i < NUM_LOOPS; i++) { - shouldThrowTDZ(foo); - shouldThrowTDZ(bar); -} -})(); - - -;(function() { -function foo() { - if (!truth()) { - y; - assert(false); - } - let y; - assert(y === undefined); - if (truth()) { - x; - } - let x; -} - -for (var i = 0; i < NUM_LOOPS; i++) { - shouldThrowTDZ(foo); -} -})(); - - -;(function() { -function foo() { - eval("x;"); - let x = 20; -} -function bar() { - function captureX() { return x; } - eval("captureX();"); - let x = 20; -} -function baz() { - function captureX() { return x; } - function other() { return captureX; } - other()(); - let x = 20; -} - -for (var i = 0; i < NUM_LOOPS; i++) { - shouldThrowTDZ(foo); - shouldThrowTDZ(bar); - shouldThrowTDZ(baz); -} -})(); - - -;(function() { -function foo() { - let y; - eval("y; x;"); - let x = 20; -} - -for (var i = 0; i < SHORT_LOOPS; i++) { - shouldThrowTDZ(foo); -} -})(); - - -;(function() { -function foo() { - let x = 20; - let y = 40; - assert(eval("x;") === 20); - if (truth()) { - assert(eval("eval('y');") === 40); - eval("eval('x');"); - let x = 40; - } -} - -for (var i = 0; i < SHORT_LOOPS; i++) { - shouldThrowTDZ(foo); -} -})(); - - -// FunctionResolveNode -;(function() { -function foo() { - function captureX() { return x; } - x(); - let x = function() { return 20; }; -} - -function bar() { - x(); - let x = function() { return 20; }; -} - -for (var i = 0; i < NUM_LOOPS; i++) { - shouldThrowTDZ(foo); - shouldThrowTDZ(bar); -} -})(); - - -// TypeofResolveNode -;(function() { -function foo() { - function captureX() { return x; } - typeof x; - let x = function() { return 20; }; -} - -function bar() { - typeof x; - let x = function() { return 20; }; -} - -for (var i = 0; i < NUM_LOOPS; i++) { - shouldThrowTDZ(foo); - shouldThrowTDZ(bar); -} -})(); - - -// ReadModifyResolveNode -;(function() { -function foo() { - function captureX() { return x; } - x++; - let x = 20; -} - -function bar() { - x--; - let x = 30; -} - -function baz() { - x *= 40; - let x = 30; -} - -function kaz() { - function captureX() { return x; } - x /= 20; - let x = 20; -} - -function haz() { - function captureX() { return x; } - --x; - let x = 20; -} - -function jaz() { - --x; - let x = 30; -} - -for (var i = 0; i < SHORT_LOOPS; i++) { - shouldThrowTDZ(foo); - shouldThrowTDZ(bar); - shouldThrowTDZ(baz); - shouldThrowTDZ(kaz); - shouldThrowTDZ(haz); - shouldThrowTDZ(jaz); -} -})(); - - -;(function() { -function foo(x) { - let y = 50; - let result = null; - switch(x) { - case 10: - let y = 40; - assert(y === 40); - case 20: - y += 1; - assert(y === 41); - result = y; - break; - default: - result = x; - break; - } - assert(y === 50); - return result; -} -function bar(x) { - let y = 50; - let result = null; - switch(x) { - case 10: - let y = 40; - assert(y === 40); - case 20: - let capY = function() { return y; } - y += 1; - assert(y === 41); - result = y; - break; - default: - result = x; - break; - } - assert(y === 50); - return result; -} -function baz(x) { - let y = 50; - let result = null; - switch(x) { - case 10: - let y = 40; - assert(y === 40); - case 20: - let inc = function() { y += 1; } - inc(); - assert(y === 41); - result = y; - break; - default: - result = x; - break; - } - assert(y === 50); - return result; -} - -for (var i = 0; i < NUM_LOOPS; i++) { - shouldThrowTDZ(function() { foo(20); }); - shouldThrowTDZ(function() { bar(20); }); - shouldThrowTDZ(function() { baz(20); }); -} - -assert(foo(10) === 41); -assert(foo("hello") === "hello"); -})(); - - -;(function() { -function foo() { - let y; - [y] = [40]; - assert(y === 40); - - [x] = [1]; - let x; -} - -function boo() { - let y; - [y] = [40]; - assert(y === 40); - - [x] = [1]; - let x; - function capX() { return x; } -} - -function bar() { - let x; - ({p: x} = {p: 40}); - assert(x === 40); - - ({a, p: y} = {a: 100, p: 40}); - let y; -} - -function zar() { - let x; - ({p: x} = {p: 40}); - assert(x === 40); - - ({a, p: y} = {a: 100, p: 40}); - let y; - function capY() { return y; } -} - -function baz() { - let x; - ({p: x} = {p: 40}); - assert(x === 40); - - ({a, p: {y}} = {a: 100, p: {p: {y: 40}}}); - let y; -} - -function jaz() { - ({y} = {}); - let y; -} - -for (var i = 0; i < NUM_LOOPS; i++) { - shouldThrowTDZ(foo); - shouldThrowTDZ(boo); - shouldThrowTDZ(bar); - shouldThrowTDZ(zar); - shouldThrowTDZ(baz); - shouldThrowTDZ(jaz); -} -})(); diff --git a/implementation-contributed/javascriptcore/stress/lexical-scoping-break-continue.js b/implementation-contributed/javascriptcore/stress/lexical-scoping-break-continue.js deleted file mode 100644 index cb03127e84..0000000000 --- a/implementation-contributed/javascriptcore/stress/lexical-scoping-break-continue.js +++ /dev/null @@ -1,216 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("bad assertion"); -} -noInline(assert); - -;(function() { - function test1() { - let x = 20; - function foo() { - label: { - let y = 21; - let capY = function () { return y; } - assert(x === 20); - break label; - } - assert(x === 20); - } - foo(); - } - - function test2() { - let x = 20; - function capX() { return x; } - function foo() { - label1: { - label2: { - let y = 21; - let capY = function () { return y; } - break label2; - } - assert(x === 20); - } - assert(x === 20); - - label1: { - label2: { - let y = 21; - let capY = function () { return y; } - assert(x === 20); - assert(y === 21); - break label1; - } - } - assert(x === 20); - - label1: { - let y = 21; - let capY = function () { return y; } - label2: { - let y = 21; - let capY = function () { return y; } - assert(x === 20); - assert(y === 21); - break label1; - } - } - assert(x === 20); - } - foo() - } - - function test3() { - let x = 20; - function capX() { return x; } - function foo() { - loop1: for (var i = 0; i++ < 1000; ) { - //assert(x === 20); - loop2: for (var j = 0; j++ < 1000; ) { - let y = 21; - let capY = function() { return y; } - assert(x === 20); - assert(y === 21); - continue loop1; - //break loop1; - } - } - assert(x === 20); - } - foo() - } - - function test4() { - let x = 20; - function capX() { return x; } - function foo() { - loop1: for (var i = 0; i++ < 1000; ) { - loop2: for (var j = 0; j++ < 1000; ) { - let y = 21; - let capY = function() { return y; } - assert(x === 20); - assert(y === 21); - break loop1; - } - } - assert(x === 20); - } - foo() - } - - function test5() { - let x = 20; - function capX() { return x; } - function foo() { - loop1: for (var i = 0; i++ < 1000; ) { - let y = 21; - let capY = function() { return y; } - loop2: for (var j = 0; j++ < 1000; ) { - let y = 21; - let capY = function() { return y; } - assert(x === 20); - assert(y === 21); - break loop1; - } - } - assert(x === 20); - } - foo() - } - - function test6() { - let x = 20; - function capX() { return x; } - function foo() { - loop1: for (var i = 0; i++ < 1000; ) { - assert(x === 20); - let y = 21; - let capY = function() { return y; } - loop2: for (var j = 0; j++ < 1000; ) { - let y = 21; - let capY = function() { return y; } - assert(x === 20); - assert(y === 21); - try { - throw new Error(); - } catch(e) { - } finally { - assert(x === 20); - continue loop1; - } - } - } - assert(x === 20); - } - foo() - } - - function test7() { - let x = 20; - function capX() { return x; } - function foo() { - loop1: for (var i = 0; i++ < 1000; ) { - assert(x === 20); - let y = 21; - let capY = function() { return y; } - loop2: for (var j = 0; j++ < 1000; ) { - let y = 21; - let capY = function() { return y; } - assert(x === 20); - assert(y === 21); - try { - throw new Error(); - } catch(e) { - continue loop1; - } finally { - let x = 40; - let capX = function() { return x; } - assert(x === 40); - } - } - } - assert(x === 20); - } - foo() - } - - function test8() { - let x = 20; - function capX() { return x; } - function foo() { - loop1: for (var i = 0; i++ < 1000; ) { - assert(x === 20); - let y = 21; - let capY = function() { return y; } - loop2: for (var j = 0; j++ < 1000; ) { - let y = 21; - let capY = function() { return y; } - assert(x === 20); - assert(y === 21); - try { - throw new Error(); - } catch(e) { - break loop1; - } finally { - let x = 40; - let capX = function() { return x; } - assert(x === 40); - } - } - } - assert(x === 20); - } - foo() - } - - for (var i = 0; i < 10; i++) { - test1(); - test2(); - test3(); - test4(); - test5(); - test6(); - test7(); - test8(); - } -})(); diff --git a/implementation-contributed/javascriptcore/stress/lexical-scoping-for-loop.js b/implementation-contributed/javascriptcore/stress/lexical-scoping-for-loop.js deleted file mode 100644 index 1e61e315f3..0000000000 --- a/implementation-contributed/javascriptcore/stress/lexical-scoping-for-loop.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -function assert(b) { - if (!b) - throw new Error("Bad"); -} - -function test1(x) { - for (let x = 20; x < 30; ++x) { } - return x; -} -function test2(x) { - for (let x of [1,2,3]) { } - return x; -} -function test3(x) { - for (let x in {}) { } - return x; -} -function test4(x) { - let i = 0; - for (const x = 20; i < 1; ++i) { } - return x; -} -function test5(x) { - for (const x of [1, 2, 3]) { } - return x; -} -function test6(x) { - for (const x in {}) { } - return x; -} - -let test7 = (x) => { - for (let x = 20; x < 30; ++x) { } - return x; -} -let test8 = (x) => { - for (let x of [1,2,3]) { } - return x; -} -let test9 = (x) => { - for (let x in {}) { } - return x; -} -let test10 = (x) => { - let i = 0; - for (const x = 20; i < 1; ++i) { } - return x; -} -let test11 = (x) => { - for (const x of [1, 2, 3]) { } - return x; -} -let test12 = (x) => { - for (const x in {}) { } - return x; -} - -for (let test of [test1, test2, test3, test4, test5, test7, test8, test9, test10, test11, test12]) - assert(test("foo") === "foo"); diff --git a/implementation-contributed/javascriptcore/stress/licm-no-pre-header-nested.js b/implementation-contributed/javascriptcore/stress/licm-no-pre-header-nested.js deleted file mode 100644 index ef22558e14..0000000000 --- a/implementation-contributed/javascriptcore/stress/licm-no-pre-header-nested.js +++ /dev/null @@ -1,23 +0,0 @@ -//@ runFTLNoCJIT("--createPreHeaders=false") - -function foo(array, y) { - var x = 0; - var j = 0; - do { - x = y * 3; - var result = 0; - var i = 0; - if (!array.length) - array = [1]; - do { - result += array[i++]; - } while (i < array.length) - j++; - } while (j < 3); - return result + x; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) - foo([1, 2, 3], 42); diff --git a/implementation-contributed/javascriptcore/stress/licm-no-pre-header.js b/implementation-contributed/javascriptcore/stress/licm-no-pre-header.js deleted file mode 100644 index 2390c93239..0000000000 --- a/implementation-contributed/javascriptcore/stress/licm-no-pre-header.js +++ /dev/null @@ -1,17 +0,0 @@ -//@ runFTLNoCJIT("--createPreHeaders=false") - -function foo(array) { - var result = 0; - var i = 0; - if (!array.length) - array = [1]; - do { - result += array[i++]; - } while (i < array.length) - return result; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) - foo([1, 2, 3]); diff --git a/implementation-contributed/javascriptcore/stress/lift-tdz-bypass-catch.js b/implementation-contributed/javascriptcore/stress/lift-tdz-bypass-catch.js deleted file mode 100644 index 3477b23dff..0000000000 --- a/implementation-contributed/javascriptcore/stress/lift-tdz-bypass-catch.js +++ /dev/null @@ -1,10 +0,0 @@ -//@ runNoFTL - -function foo () { -try{}catch(e){}print(e);let e; -} - -try { - foo(); -} catch (e) {} - diff --git a/implementation-contributed/javascriptcore/stress/lift-template-literal.js b/implementation-contributed/javascriptcore/stress/lift-template-literal.js deleted file mode 100644 index 12f8f5ee34..0000000000 --- a/implementation-contributed/javascriptcore/stress/lift-template-literal.js +++ /dev/null @@ -1,69 +0,0 @@ -function dump(callSite) -{ - return JSON.stringify({ cooked: callSite, raw: callSite.raw }); -} - -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -shouldBe(dump`\newcommand{\fun}{\textbf{Fun!}}`, `{"cooked":["\\newcommand{\\fun}{\\textbf{Fun!}}"],"raw":["\\\\newcommand{\\\\fun}{\\\\textbf{Fun!}}"]}`); -shouldBe(dump`\newcommand{\unicode}{\textbf{Unicode!}}`, `{"cooked":[null],"raw":["\\\\newcommand{\\\\unicode}{\\\\textbf{Unicode!}}"]}`); -shouldBe(dump`\newcommand{\xerxes}{\textbf{King!}}`, `{"cooked":[null],"raw":["\\\\newcommand{\\\\xerxes}{\\\\textbf{King!}}"]}`); -shouldBe(dump`Breve over the h goes \u{h}ere`, `{"cooked":[null],"raw":["Breve over the h goes \\\\u{h}ere"]}`); - -function testTag(expected) { - return function tag(callSite) { - shouldBe(callSite.length, expected.cooked.length); - shouldBe(callSite.raw.length, expected.raw.length); - expected.cooked.forEach((value, index) => shouldBe(callSite[index], value)); - expected.raw.forEach((value, index) => shouldBe(callSite.raw[index], value)); - } -} - -testTag({ - cooked: [ undefined ], - raw: [ "\\unicode and \\u{55}" ], -})`\unicode and \u{55}`; - -testTag({ - cooked: [ undefined, "test" ], - raw: [ "\\unicode and \\u{55}", "test" ], -})`\unicode and \u{55}${42}test`; - -testTag({ - cooked: [ undefined, undefined, "Cocoa" ], - raw: [ "\\unicode and \\u{55}", "\\uhello", "Cocoa" ], -})`\unicode and \u{55}${42}\uhello${42}Cocoa`; - -testTag({ - cooked: [ "Cocoa", undefined, undefined, "Cocoa" ], - raw: [ "Cocoa", "\\unicode and \\u{55}", "\\uhello", "Cocoa" ], -})`Cocoa${42}\unicode and \u{55}${42}\uhello${42}Cocoa`; - -testTag({ - cooked: [ "Cocoa", undefined, undefined, "Cocoa" ], - raw: [ "Cocoa", "\\unicode and \\u{55}", "\\uhello", "Cocoa" ], -})`Cocoa${42}\unicode and \u{55}${42}\uhello${42}Cocoa`; - -testTag({ - cooked: [ undefined, undefined, undefined ], - raw: [ "\\00", "\\01", "\\1" ] -})`\00${42}\01${42}\1`; - -testTag({ - cooked: [ undefined, undefined ], - raw: [ "\\xo", "\\x0o" ] -})`\xo${42}\x0o`; - -testTag({ - cooked: [ undefined, undefined, undefined, undefined ], - raw: [ "\\uo", "\\u0o", "\\u00o", "\\u000o" ] -})`\uo${42}\u0o${42}\u00o${42}\u000o`; - -testTag({ - cooked: [ undefined, undefined, undefined ], - raw: [ "\\u{o", "\\u{0o", "\\u{110000o" ] -})`\u{o${42}\u{0o${42}\u{110000o`; diff --git a/implementation-contributed/javascriptcore/stress/liveness-pruning-needed-for-osr-availability-eager.js b/implementation-contributed/javascriptcore/stress/liveness-pruning-needed-for-osr-availability-eager.js deleted file mode 100644 index e6078b5800..0000000000 --- a/implementation-contributed/javascriptcore/stress/liveness-pruning-needed-for-osr-availability-eager.js +++ /dev/null @@ -1,16 +0,0 @@ -// Note that this only fails in eager compilation. - -function each(ary, func) { - if (ary) - for (var i = 0; i < ary.length && (!ary[i] ||!func(ary[i], i, ary)); i += 1); -} - -var blah = function () { - var func = function() { - return (function () { }).apply(Object, arguments); - }; - each([ {}, {} ], func); -}; - -for (var i = 0; i < 1000; i++) - blah(); diff --git a/implementation-contributed/javascriptcore/stress/liveness-pruning-needed-for-osr-availability.js b/implementation-contributed/javascriptcore/stress/liveness-pruning-needed-for-osr-availability.js deleted file mode 100644 index bd2538b803..0000000000 --- a/implementation-contributed/javascriptcore/stress/liveness-pruning-needed-for-osr-availability.js +++ /dev/null @@ -1,15 +0,0 @@ -function each(ary, func) { - for (var i = 0; i < ary.length && (!ary[i] ||!func(ary[i], i, ary)); i += 1); -} - -function foo() { - each( - [ {}, {} ], - function () { - return (function (x) { })(arguments); - }); -}; -noInline(foo); - -for (var i = 0; i < 100000; i++) - foo(); diff --git a/implementation-contributed/javascriptcore/stress/llint-cache-replace-then-cache-get-and-fold-then-invalidate.js b/implementation-contributed/javascriptcore/stress/llint-cache-replace-then-cache-get-and-fold-then-invalidate.js deleted file mode 100644 index c2884827c4..0000000000 --- a/implementation-contributed/javascriptcore/stress/llint-cache-replace-then-cache-get-and-fold-then-invalidate.js +++ /dev/null @@ -1,26 +0,0 @@ -var o = {f:42}; - -function foo(v) { - o.f = v; -} - -function bar() { - return o.f; -} - -noInline(foo); -noInline(bar); - -foo(42); -foo(42); - -for (var i = 0; i < 100000; ++i) { - var result = bar(); - if (result != 42) - throw "Error: bad result: " + result; -} - -foo(53); -var result = bar(); -if (result != 53) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/llint-get-by-id-cache-prototype-load-from-dictionary.js b/implementation-contributed/javascriptcore/stress/llint-get-by-id-cache-prototype-load-from-dictionary.js deleted file mode 100644 index 44a27e1a23..0000000000 --- a/implementation-contributed/javascriptcore/stress/llint-get-by-id-cache-prototype-load-from-dictionary.js +++ /dev/null @@ -1,19 +0,0 @@ - -expected = Object.prototype.toString; -foo = {foo: 1, bar: 20}; -delete foo.bar; - - -function test() { - let toString = foo.toString; - if (toString !== expected) - throw new Error(); -} - -for (i = 0; i < 10; i++) - test(); - -foo.toString = 100; -expected = 100; - -test(); diff --git a/implementation-contributed/javascriptcore/stress/llint-proto-get-by-id-cache-change-prototype.js b/implementation-contributed/javascriptcore/stress/llint-proto-get-by-id-cache-change-prototype.js deleted file mode 100644 index 4f70b03f55..0000000000 --- a/implementation-contributed/javascriptcore/stress/llint-proto-get-by-id-cache-change-prototype.js +++ /dev/null @@ -1,19 +0,0 @@ -let p = Object.create({ foo: 1 }); -let o = Object.create(p); - -let other = { foo: 10 }; - -function foo() { - return o.foo -} - -for (let i = 0; i < 10; i++) - foo(); - -p.__proto__ = null; -gc(); - -Object.defineProperty(other, "foo", { get() { } }); - -if (foo() !== undefined) - throw new Error("bad get by id access"); diff --git a/implementation-contributed/javascriptcore/stress/llint-proto-get-by-id-cache-intercept-value.js b/implementation-contributed/javascriptcore/stress/llint-proto-get-by-id-cache-intercept-value.js deleted file mode 100644 index 0b90bea4d3..0000000000 --- a/implementation-contributed/javascriptcore/stress/llint-proto-get-by-id-cache-intercept-value.js +++ /dev/null @@ -1,17 +0,0 @@ -let p = Object.create({ foo: 1 }); -let o = Object.create(p); - -let other = { foo: 10 }; - -function foo() { - return o.foo -} - -for (let i = 0; i < 10; i++) - foo(); - -p.foo = null; -gc(); - -if (foo() !== null) - throw new Error("bad get by id access"); diff --git a/implementation-contributed/javascriptcore/stress/llint-put-to-scope-global-cache-watchpoint-invalidate.js b/implementation-contributed/javascriptcore/stress/llint-put-to-scope-global-cache-watchpoint-invalidate.js deleted file mode 100644 index 35fe10a3f3..0000000000 --- a/implementation-contributed/javascriptcore/stress/llint-put-to-scope-global-cache-watchpoint-invalidate.js +++ /dev/null @@ -1,22 +0,0 @@ -function foo(v) { - global = v; -} - -function bar() { - return global; -} - -noInline(foo); -noInline(bar); - -var value = 42; -foo(value); -var n = 100000; -var m = 100; -for (var i = 0; i < n; ++i) { - if (i == n - m) - foo(value = 53); - var result = bar(); - if (result != value) - throw "Error: on iteration " + i + " got: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/llint-stack-overflow-debugging-opcodes.js b/implementation-contributed/javascriptcore/stress/llint-stack-overflow-debugging-opcodes.js deleted file mode 100644 index bd9cfe227f..0000000000 --- a/implementation-contributed/javascriptcore/stress/llint-stack-overflow-debugging-opcodes.js +++ /dev/null @@ -1,8 +0,0 @@ -//@ runNoCJIT("--forceDebuggerBytecodeGeneration=true", "--useBaselineJIT=0", "--alwaysUseShadowChicken=true") - -function foo() { - foo() -} -try { - foo(); -} catch(e) { } diff --git a/implementation-contributed/javascriptcore/stress/llint-stack-overflow-location.js b/implementation-contributed/javascriptcore/stress/llint-stack-overflow-location.js deleted file mode 100644 index 14dcff656e..0000000000 --- a/implementation-contributed/javascriptcore/stress/llint-stack-overflow-location.js +++ /dev/null @@ -1,35 +0,0 @@ -//@ runNoJIT - -function stackTraceDescription(stackFrame) { - let indexOfAt = stackFrame.indexOf('@') - let indexOfLastSlash = stackFrame.lastIndexOf('/'); - if (indexOfLastSlash == -1) - indexOfLastSlash = indexOfAt - let functionName = stackFrame.substring(0, indexOfAt); - let fileName = stackFrame.substring(indexOfLastSlash + 1); - return functionName + " at " + fileName; -} - -function foo(j) { - for (let i = 0; i < 20; i++) { - i--; - i++; - } - foo(j + 1); -} - -let error = null; -try { - foo(10); -} catch(e) { - error = e; -} - -if (!error) - throw new Error("No exception!"); - -let frame = error.stack.split("\n")[0]; -let description = stackTraceDescription(frame); -if (description.indexOf(".js:18") < 0) - throw new Error("Bad location: '" + description + "'"); - diff --git a/implementation-contributed/javascriptcore/stress/load-hole-from-scope-into-live-var.js b/implementation-contributed/javascriptcore/stress/load-hole-from-scope-into-live-var.js deleted file mode 100644 index 2c23e03476..0000000000 --- a/implementation-contributed/javascriptcore/stress/load-hole-from-scope-into-live-var.js +++ /dev/null @@ -1,14 +0,0 @@ -//@ runDefault -var result = eval(` -try { - switch (0) { - case 1: - let x = eval(); - default: - x; - } -} catch (e) { -} -`); -if (result !== void 0) - throw "Bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/load-varargs-elimination-bounds-check-barely.js b/implementation-contributed/javascriptcore/stress/load-varargs-elimination-bounds-check-barely.js deleted file mode 100644 index 83c1328fc1..0000000000 --- a/implementation-contributed/javascriptcore/stress/load-varargs-elimination-bounds-check-barely.js +++ /dev/null @@ -1,35 +0,0 @@ -function foo() { - var result = 0; - for (var i = 0; i < arguments.length; ++i) - result += arguments[i]; - return result; -} - -function bar() { - return foo.apply(this, arguments); -} - -function baz(p) { - if (p) - return bar(1, 42); - return 0; -} - -noInline(baz); - -// Execute baz() once with p set, so that the call has a valid prediction. -baz(true); - -// Warm up profiling in bar and foo. Convince this profiling that bar()'s varargs call will tend to -// pass a small number of arguments; -for (var i = 0; i < 1000; ++i) - bar(1); - -// Now compile baz(), but don't run the bad code yet. -for (var i = 0; i < 10000; ++i) - baz(false); - -// Finally, trigger the bug. -var result = baz(true); -if (result != 43) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/load-varargs-elimination-bounds-check.js b/implementation-contributed/javascriptcore/stress/load-varargs-elimination-bounds-check.js deleted file mode 100644 index 0fd39075c1..0000000000 --- a/implementation-contributed/javascriptcore/stress/load-varargs-elimination-bounds-check.js +++ /dev/null @@ -1,35 +0,0 @@ -function foo() { - var result = 0; - for (var i = 0; i < arguments.length; ++i) - result += arguments[i]; - return result; -} - -function bar() { - return foo.apply(this, arguments); -} - -function baz(p) { - if (p) - return bar(1, 2, 3, 4); - return 0; -} - -noInline(baz); - -// Execute baz() once with p set, so that the call has a valid prediction. -baz(true); - -// Warm up profiling in bar and foo. Convince this profiling that bar()'s varargs call will tend to -// pass a small number of arguments; -for (var i = 0; i < 1000; ++i) - bar(1); - -// Now compile baz(), but don't run the bad code yet. -for (var i = 0; i < 10000; ++i) - baz(false); - -// Finally, trigger the bug. -var result = baz(true); -if (result != 10) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/load-varargs-on-new-array-with-spread-convert-to-static-loads.js b/implementation-contributed/javascriptcore/stress/load-varargs-on-new-array-with-spread-convert-to-static-loads.js deleted file mode 100644 index 48deb0dba1..0000000000 --- a/implementation-contributed/javascriptcore/stress/load-varargs-on-new-array-with-spread-convert-to-static-loads.js +++ /dev/null @@ -1,28 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad!"); -} -noInline(assert); - -function baz(...args) { - return args; -} -function bar(a, ...args) { - return baz(...args, 42, ...args); -} -function foo(a, b, c, d) { - return bar(a, b, c, d); -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - let r = foo(i, i+1, i+2, i+3); - assert(r.length === 7); - assert(r[0] === i+1); - assert(r[1] === i+2); - assert(r[2] === i+3); - assert(r[3] === 42); - assert(r[4] === i+1); - assert(r[5] === i+2); - assert(r[6] === i+3); -} diff --git a/implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call-and-exit-strict.js b/implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call-and-exit-strict.js deleted file mode 100644 index 3618f8cbb3..0000000000 --- a/implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call-and-exit-strict.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; - -function foo(a, b) { - var array = []; - for (var i = 0; i < arguments.length; ++i) - array.push(arguments[i]); - return {a:a + 1, b:b, c:array}; -} - -function bar(array) { - return foo.apply(this, array); -} - -noInline(bar); - -function checkEqual(a, b) { - if (a.a != b.a) - throw "Error: bad value of a: " + a.a + " versus " + b.a; - if (a.b != b.b) - throw "Error: bad value of b: " + a.b + " versus " + b.b; - if (a.c.length != b.c.length) - throw "Error: bad value of c, length mismatch: " + a.c + " versus " + b.c; - for (var i = a.c.length; i--;) { - if (a.c[i] != b.c[i]) - throw "Error: bad value of c, mismatch at i = " + i + ": " + a.c + " versus " + b.c; - } -} - -function test(array) { - var expected = {a:array[0] + 1, b:array[1], c:array}; - var actual = bar(array); - checkEqual(actual, expected); -} - -for (var i = 0; i < 10000; ++i) { - var array = []; - for (var j = 0; j < 1 + (i % 5); ++j) - array.push(j); - test(array); -} - -var array = [2147483647]; -test(array); diff --git a/implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call-and-exit.js b/implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call-and-exit.js deleted file mode 100644 index c378171e1d..0000000000 --- a/implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call-and-exit.js +++ /dev/null @@ -1,41 +0,0 @@ -function foo(a, b) { - var array = []; - for (var i = 0; i < arguments.length; ++i) - array.push(arguments[i]); - return {a:a + 1, b:b, c:array}; -} - -function bar(array) { - return foo.apply(this, array); -} - -noInline(bar); - -function checkEqual(a, b) { - if (a.a != b.a) - throw "Error: bad value of a: " + a.a + " versus " + b.a; - if (a.b != b.b) - throw "Error: bad value of b: " + a.b + " versus " + b.b; - if (a.c.length != b.c.length) - throw "Error: bad value of c, length mismatch: " + a.c + " versus " + b.c; - for (var i = a.c.length; i--;) { - if (a.c[i] != b.c[i]) - throw "Error: bad value of c, mismatch at i = " + i + ": " + a.c + " versus " + b.c; - } -} - -function test(array) { - var expected = {a:array[0] + 1, b:array[1], c:array}; - var actual = bar(array); - checkEqual(actual, expected); -} - -for (var i = 0; i < 10000; ++i) { - var array = []; - for (var j = 0; j < 1 + (i % 5); ++j) - array.push(j); - test(array); -} - -var array = [2147483647]; -test(array); diff --git a/implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call-exit-in-foo.js b/implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call-exit-in-foo.js deleted file mode 100644 index ecb227cc79..0000000000 --- a/implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call-exit-in-foo.js +++ /dev/null @@ -1,46 +0,0 @@ -function foo(a, b) { - var array = []; - for (var i = 0; i < arguments.length; ++i) - array.push(arguments[i] + 1); - return {a:a, b:b, c:array}; -} - -function bar(array) { - return foo.apply(this, array); -} - -noInline(bar); - -function checkEqual(a, b) { - if (a.a != b.a) - throw "Error: bad value of a: " + a.a + " versus " + b.a; - if (a.b != b.b) - throw "Error: bad value of b: " + a.b + " versus " + b.b; - if (a.c.length != b.c.length) - throw "Error: bad value of c, length mismatch: " + a.c + " versus " + b.c; - for (var i = a.c.length; i--;) { - if (a.c[i] != b.c[i]) - throw "Error: bad value of c, mismatch at i = " + i + ": " + a.c + " versus " + b.c; - } -} - -function test(array) { - var expected = {a:array[0], b:array[1], c:array.map(function(value) { return value + 1 })}; - var actual = bar(array); - checkEqual(actual, expected); -} - -// This is pretty dumb. We need to first make sure that the VM is prepared for double arrays being -// created. -var array = []; -array.push(42); -array.push(42.5); - -for (var i = 0; i < 10000; ++i) { - var array = []; - for (var j = 0; j < i % 6; ++j) - array.push(j); - test(array); -} - -test([1.5, 2.5, 3.5]); diff --git a/implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call-inlined.js b/implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call-inlined.js deleted file mode 100644 index 56d05269e4..0000000000 --- a/implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call-inlined.js +++ /dev/null @@ -1,43 +0,0 @@ -function foo(a, b) { - var array = []; - for (var i = 0; i < arguments.length; ++i) - array.push(arguments[i]); - return {a:a, b:b, c:array}; -} - -function bar(array) { - return foo.apply(this, array); -} - -function baz(array) { - return bar(array); -} - -noInline(baz); - -function checkEqual(a, b) { - if (a.a != b.a) - throw "Error: bad value of a: " + a.a + " versus " + b.a; - if (a.b != b.b) - throw "Error: bad value of b: " + a.b + " versus " + b.b; - if (a.c.length != b.c.length) - throw "Error: bad value of c, length mismatch: " + a.c + " versus " + b.c; - for (var i = a.c.length; i--;) { - if (a.c[i] != b.c[i]) - throw "Error: bad value of c, mismatch at i = " + i + ": " + a.c + " versus " + b.c; - } -} - -function test(array) { - var expected = {a:array[0], b:array[1], c:array}; - var actual = baz(array); - checkEqual(actual, expected); -} - -for (var i = 0; i < 10000; ++i) { - var array = []; - for (var j = 0; j < i % 6; ++j) - array.push(j); - test(array); -} - diff --git a/implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call.js b/implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call.js deleted file mode 100644 index 45e3ea1613..0000000000 --- a/implementation-contributed/javascriptcore/stress/load-varargs-then-inlined-call.js +++ /dev/null @@ -1,39 +0,0 @@ -function foo(a, b) { - var array = []; - for (var i = 0; i < arguments.length; ++i) - array.push(arguments[i]); - return {a:a, b:b, c:array}; -} - -function bar(array) { - return foo.apply(this, array); -} - -noInline(bar); - -function checkEqual(a, b) { - if (a.a != b.a) - throw "Error: bad value of a: " + a.a + " versus " + b.a; - if (a.b != b.b) - throw "Error: bad value of b: " + a.b + " versus " + b.b; - if (a.c.length != b.c.length) - throw "Error: bad value of c, length mismatch: " + a.c + " versus " + b.c; - for (var i = a.c.length; i--;) { - if (a.c[i] != b.c[i]) - throw "Error: bad value of c, mismatch at i = " + i + ": " + a.c + " versus " + b.c; - } -} - -function test(array) { - var expected = {a:array[0], b:array[1], c:array}; - var actual = bar(array); - checkEqual(actual, expected); -} - -for (var i = 0; i < 10000; ++i) { - var array = []; - for (var j = 0; j < i % 6; ++j) - array.push(j); - test(array); -} - diff --git a/implementation-contributed/javascriptcore/stress/logical-not-masquerades-as-undefined.js b/implementation-contributed/javascriptcore/stress/logical-not-masquerades-as-undefined.js deleted file mode 100644 index 3db7d1a94b..0000000000 --- a/implementation-contributed/javascriptcore/stress/logical-not-masquerades-as-undefined.js +++ /dev/null @@ -1,35 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(value) -{ - return !value; -} -noInline(test); - -var data = [ - [ {}, true ], - [ true, true ], - [ false, false ], - [ -0, false ], - [ 1, true ], - [ 4.2, true ], - [ NaN, false ], - [ Infinity, true ], - [ [], true ], - [ new Date(), true ], - [ "", false ], - [ "" + "" + "", false ], - [ "Cocoa", true ], - [ undefined, false ], - [ null, false ], - [ Symbol(), true ], - [ makeMasquerader() , false] -]; - -for (var i = 0; i < 1e4; ++i) { - for (let [ value, result ] of data) - shouldBe(!test(value), result); -} diff --git a/implementation-contributed/javascriptcore/stress/logical-not-masquerades.js b/implementation-contributed/javascriptcore/stress/logical-not-masquerades.js deleted file mode 100644 index 0fd59bad89..0000000000 --- a/implementation-contributed/javascriptcore/stress/logical-not-masquerades.js +++ /dev/null @@ -1,33 +0,0 @@ -function foo(value) { - return !!value; -} - -noInline(foo); - -var tests = [ - [0, false], - [1, true], - [0/0, false], - [0/-1, false], - [0.0, false], - ["", false], - ["f", true], - ["hello", true], - [{}, true], - [[], true], - [null, false], - [void 0, false], - [false, false], - [true, true], - [makeMasquerader(), false] -]; - -for (var i = 0; i < 10000; ++i) { - for (var j = 0; j < tests.length; ++j) { - var input = tests[j][0]; - var expected = tests[j][1]; - var result = foo(input); - if (result !== expected) - throw "Error: bad result for " + input + ": " + result; - } -} diff --git a/implementation-contributed/javascriptcore/stress/logical-not.js b/implementation-contributed/javascriptcore/stress/logical-not.js deleted file mode 100644 index aa90dcba5c..0000000000 --- a/implementation-contributed/javascriptcore/stress/logical-not.js +++ /dev/null @@ -1,34 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(value) -{ - return !value; -} -noInline(test); - -var data = [ - [ {}, true ], - [ true, true ], - [ false, false ], - [ -0, false ], - [ 1, true ], - [ 4.2, true ], - [ NaN, false ], - [ Infinity, true ], - [ [], true ], - [ new Date(), true ], - [ "", false ], - [ "" + "" + "", false ], - [ "Cocoa", true ], - [ undefined, false ], - [ null, false ], - [ Symbol(), true ], -]; - -for (var i = 0; i < 1e4; ++i) { - for (let [ value, result ] of data) - shouldBe(!test(value), result); -} diff --git a/implementation-contributed/javascriptcore/stress/make-dictionary-repatch.js b/implementation-contributed/javascriptcore/stress/make-dictionary-repatch.js deleted file mode 100644 index 992283708e..0000000000 --- a/implementation-contributed/javascriptcore/stress/make-dictionary-repatch.js +++ /dev/null @@ -1,36 +0,0 @@ -//@ if $jitTests then runNoCJIT("--useDFGJIT=false", "--useLLInt=false") else skip end - -function foo(o) { - return o.f; -} - -var p1 = {}; -p1.f = 42; - -var crazy = {}; -crazy.f = 1; -crazy.g = 2; - -var p2 = Object.create(p1); - -var crazy = Object.create(p1); -crazy.f = 1; -crazy.g = 2; - -function make() { - return Object.create(p2); -} - -for (var i = 0; i < 100; ++i) - foo(make()); - -for (var i = 0; i < 10000; ++i) - p2["i" + i] = i; -p2.f = 43; - -for (var i = 0; i < 100; ++i) - foo({f:24}); - -var result = foo(make()); -if (result != 43) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/make-large-string-jit-strcat.js b/implementation-contributed/javascriptcore/stress/make-large-string-jit-strcat.js deleted file mode 100644 index 979d044a97..0000000000 --- a/implementation-contributed/javascriptcore/stress/make-large-string-jit-strcat.js +++ /dev/null @@ -1,25 +0,0 @@ -//@ skip if $memoryLimited -// Like make-large-string-jit.js, but tests MakeRope with three arguments and op_strcat -// in the DFG and FTL JITs. - -var s = "s"; - -function foo(a, b) { - return "t" + a + b; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) - foo("a", "b"); - -try { - for (var i = 0; i < 31; ++i) - s = foo(s, s); - print("Should not have gotten here."); - print("String length: " + s.length); - throw "Should not have gotten here."; -} catch (e) { - if (e.message != "Out of memory") - throw "Wrong error: " + e; -} diff --git a/implementation-contributed/javascriptcore/stress/make-large-string-jit.js b/implementation-contributed/javascriptcore/stress/make-large-string-jit.js deleted file mode 100644 index dc8ed87727..0000000000 --- a/implementation-contributed/javascriptcore/stress/make-large-string-jit.js +++ /dev/null @@ -1,24 +0,0 @@ -//@ skip if $memoryLimited -// Like make-large-string.js, but tests MakeRope with two arguments in the DFG and FTL JITs. - -var s = "s"; - -function foo(a, b) { - return a + b; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) - foo("a", "b"); - -try { - for (var i = 0; i < 31; ++i) - s = foo(s, s); - print("Should not have gotten here."); - print("String length: " + s.length); - throw "Should not have gotten here."; -} catch (e) { - if (e.message != "Out of memory") - throw "Wrong error: " + e; -} diff --git a/implementation-contributed/javascriptcore/stress/make-large-string-strcat.js b/implementation-contributed/javascriptcore/stress/make-large-string-strcat.js deleted file mode 100644 index c50ee9da1e..0000000000 --- a/implementation-contributed/javascriptcore/stress/make-large-string-strcat.js +++ /dev/null @@ -1,14 +0,0 @@ -//@ skip if $memoryLimited - -var s = "s"; - -try { - for (var i = 0; i < 31; ++i) - s = "t" + s + s; - print("Should not have gotten here."); - print("String length: " + s.length); - throw "Should not have gotten here."; -} catch (e) { - if (e.message != "Out of memory") - throw "Wrong error: " + e; -} diff --git a/implementation-contributed/javascriptcore/stress/make-large-string.js b/implementation-contributed/javascriptcore/stress/make-large-string.js deleted file mode 100644 index 3ac31dca83..0000000000 --- a/implementation-contributed/javascriptcore/stress/make-large-string.js +++ /dev/null @@ -1,14 +0,0 @@ -//@ skip if $memoryLimited - -var s = "s"; - -try { - for (var i = 0; i < 31; ++i) - s = s + s; - print("Should not have gotten here."); - print("String length: " + s.length); - throw "Should not have gotten here."; -} catch (e) { - if (e.message != "Out of memory") - throw "Wrong error: " + e; -} diff --git a/implementation-contributed/javascriptcore/stress/make-rope-2.js b/implementation-contributed/javascriptcore/stress/make-rope-2.js deleted file mode 100644 index f2a23ab558..0000000000 --- a/implementation-contributed/javascriptcore/stress/make-rope-2.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(x) { - return "hello" + x; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(" world"); - if (typeof result != "string") { - describe(result); - throw "Error: bad result type: " + result; - } - if (result != "hello world") - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/make-rope-3.js b/implementation-contributed/javascriptcore/stress/make-rope-3.js deleted file mode 100644 index 3a852cc371..0000000000 --- a/implementation-contributed/javascriptcore/stress/make-rope-3.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(x) { - return "hello" + x + "!!"; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(" world"); - if (typeof result != "string") { - describe(result); - throw "Error: bad result type: " + result; - } - if (result != "hello world!!") - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/map-clone-instance-iterator-change.js b/implementation-contributed/javascriptcore/stress/map-clone-instance-iterator-change.js deleted file mode 100644 index 637916f638..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-clone-instance-iterator-change.js +++ /dev/null @@ -1,20 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -let map = new Map(); -for (let i = 0; i < 5; ++i) - map.set(i, i); - -for (let i = 0; i < 1e2; ++i) { - let cloned = new Map(map); - shouldBe(cloned.size, map.size); -} - -map[Symbol.iterator] = function () { return [][Symbol.iterator](); }; -for (let i = 0; i < 1e2; ++i) { - let cloned = new Map(map); - shouldBe(cloned.size, 0); -} diff --git a/implementation-contributed/javascriptcore/stress/map-clone-iterator-change.js b/implementation-contributed/javascriptcore/stress/map-clone-iterator-change.js deleted file mode 100644 index fe27aee9f9..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-clone-iterator-change.js +++ /dev/null @@ -1,20 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -let map = new Map(); -for (let i = 0; i < 5; ++i) - map.set(i, i); - -for (let i = 0; i < 1e2; ++i) { - let cloned = new Map(map); - shouldBe(cloned.size, map.size); -} - -Map.prototype[Symbol.iterator] = function () { return [][Symbol.iterator](); }; -for (let i = 0; i < 1e2; ++i) { - let cloned = new Map(map); - shouldBe(cloned.size, 0); -} diff --git a/implementation-contributed/javascriptcore/stress/map-clone-next-change.js b/implementation-contributed/javascriptcore/stress/map-clone-next-change.js deleted file mode 100644 index 37234effb8..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-clone-next-change.js +++ /dev/null @@ -1,21 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -let map = new Map(); -for (let i = 0; i < 5; ++i) - map.set(i, i); - -for (let i = 0; i < 1e2; ++i) { - let cloned = new Map(map); - shouldBe(cloned.size, map.size); -} - -map[Symbol.iterator]().__proto__.next = function () { return {done:true}; }; - -for (let i = 0; i < 1e2; ++i) { - let cloned = new Map(map); - shouldBe(cloned.size, 0); -} diff --git a/implementation-contributed/javascriptcore/stress/map-clone.js b/implementation-contributed/javascriptcore/stress/map-clone.js deleted file mode 100644 index 4d878ac950..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-clone.js +++ /dev/null @@ -1,20 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -let map = new Map(); -for (let i = 0; i < 5; ++i) - map.set(i, i); - -for (let i = 0; i < 1e2; ++i) { - let cloned = new Map(map); - shouldBe(cloned.size, map.size); -} - -Map.prototype.set = function empty(value) { }; -for (let i = 0; i < 1e2; ++i) { - let cloned = new Map(map); - shouldBe(cloned.size, 0); -} diff --git a/implementation-contributed/javascriptcore/stress/map-constructor-adder.js b/implementation-contributed/javascriptcore/stress/map-constructor-adder.js deleted file mode 100644 index e788264ffe..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-constructor-adder.js +++ /dev/null @@ -1,46 +0,0 @@ -// Map constructor with adder change. - -var originalAdder = Map.prototype.set; -var counter = 0; - -Map.prototype.set = function (key, value) { - counter++; - return originalAdder.call(this, key, value); -}; - -var values = [ - [ 0, 0 ], - [ 1, 1 ], - [ 2, 2 ], - [ 3, 3 ], - [ 4, 4 ], - [ 5, 5 ], - [ 4, 4 ], - [ 3, 3 ], - [ 2, 2 ], - [ 1, 1 ], - [ 0, 0 ], -]; -var map = new Map(values); -if (map.size !== 6) - throw "Error: bad map size " + map.size; -if (counter !== values.length) - throw "Error: bad counter " + counter; - -Map.prototype.set = function () { - throw new Error("adder called"); -}; - -var map = new Map(); -var map = new Map([]); -var error = null; -try { - var map = new Map([ [0, 0] ]); -} catch (e) { - error = e; -} -if (!error) - throw "Error: error not thrown"; -if (String(error) !== "Error: adder called") - throw "Error: bad error " + String(error); - diff --git a/implementation-contributed/javascriptcore/stress/map-constructor.js b/implementation-contributed/javascriptcore/stress/map-constructor.js deleted file mode 100644 index 457e221799..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-constructor.js +++ /dev/null @@ -1,133 +0,0 @@ -// Map constructor behaviors. - -if (typeof Map !== 'function') - throw "Error: bad value" + typeof Map; - -function testCallTypeError(item) { - var error = null; - try { - var map = Map(item); - } catch (e) { - error = e; - } - if (!error) - throw "Error: error not thrown"; - if (String(error) !== "TypeError: calling Map constructor without new is invalid") - throw "Error: bad error " + String(error); -} - -var pass = [ - [ null, 0 ], - [ undefined, 0 ], - [ [], 0 ], - [ new Set(), 0], - [ new Map(), 0], - [ "", 0], - - [ - [ - [0, 1], - [1, 2], - [1, 3], - ], - 2 - ], - - [ - [ - [1, 1], - [1, 2], - [1, 3], - ], - 1 - ], - - [ - new Map([ - { 0: 'C', 1: 'O' }, - { 0: 'C', 1: 'K' }, - { 0: 'V', 1: 'K' }, - ]), - 2 - ], - - [ - new Map([ - [0, 1], - [1, 2], - [1, 3], - ]), - 2 - ], - - [ - new Map([ - [1, 1], - [1, 2], - [1, 3], - ]), - 1 - ], - - [ - new Map([ - { 0: 'C', 1: 'O' }, - { 0: 'C', 1: 'K' }, - { 0: 'V', 1: 'K' }, - ]), - 2 - ], -]; - -for (var pair of pass) { - var map = new Map(pair[0]); - if (map.size !== pair[1]) - throw "Error: bad map size " + map.size; - testCallTypeError(pair[0]); -} - -function testTypeError(item) { - var error = null; - try { - var map = new Map(item); - } catch (e) { - error = e; - } - if (!error) - throw "Error: error not thrown"; - if (String(error) !== "TypeError: Type error") - throw "Error: bad error " + String(error); -} - -var nonIterable = [ - 42, - Symbol("Cappuccino"), - true, - false, - {}, - new Date(), - new Error(), - Object(Symbol("Matcha")), - (function () { }), -]; - -for (var item of nonIterable) { - testTypeError(item); - testCallTypeError(item); -} - -var notContainNextItem = [ - "Cocoa", - [0, 1, 2, 3, 4], - [0, 0, 0, 1, 0], - ["A", "B", "A"], - new String("cocoa"), - new String("Cocoa"), - new Set([0,1,2,3,4]), - new Set([1,1,1,1]), -]; - -for (var item of notContainNextItem) { - testTypeError(item); - testCallTypeError(item); -} diff --git a/implementation-contributed/javascriptcore/stress/map-cse-correctness.js b/implementation-contributed/javascriptcore/stress/map-cse-correctness.js deleted file mode 100644 index 02ceebb78e..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-cse-correctness.js +++ /dev/null @@ -1,66 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad result!"); -} -noInline(assert); - -function testHas(map, key, f) { - let first = map.has(key); - f(); - let second = map.has(key); - return {first, second}; -} -noInline(testHas); - -function testGet(map, key, f) { - let first = map.get(key); - f(); - let second = map.get(key); - return {first, second}; -} -noInline(testGet); - -function foo() { - let map = new Map; - for (let i = 0; i < 100000; i++) { - let key = i; - map.set(key, key); - let f = () => map.delete(key); - noInline(f); - let {first, second} = testHas(map, key, f); - assert(first); - assert(!second); - } - for (let i = 0; i < 100000; i++) { - let key = i; - map.set(key, key); - let f = () => {}; - noInline(f); - let {first, second} = testHas(map, key, f); - assert(first); - assert(second); - } - - - for (let i = 0; i < 100000; i++) { - let key = i; - let value = {}; - map.set(key, value); - let f = () => map.delete(key); - noInline(f); - let {first, second} = testGet(map, key, f); - assert(first === value); - assert(second === undefined); - } - for (let i = 0; i < 100000; i++) { - let key = i; - let value = {}; - map.set(key, value); - let f = () => {}; - noInline(f); - let {first, second} = testGet(map, key, f); - assert(first === value); - assert(second === value); - } -} -foo(); diff --git a/implementation-contributed/javascriptcore/stress/map-delete.js b/implementation-contributed/javascriptcore/stress/map-delete.js deleted file mode 100644 index 42a6af6546..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-delete.js +++ /dev/null @@ -1,19 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad!") -} - -let set = new Set; -for (let i = 0; i < 50000; i++) { - assert(set.size === i); - set.add(i); - assert(set.has(i)); -} - -for (let i = 0; i < 50000; i++) { - assert(set.size === 50000 - i); - set.delete(i); - assert(!set.has(i)); -} - -assert(!set.size); diff --git a/implementation-contributed/javascriptcore/stress/map-inherit-set.js b/implementation-contributed/javascriptcore/stress/map-inherit-set.js deleted file mode 100644 index f8cc82cdf7..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-inherit-set.js +++ /dev/null @@ -1,31 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -let map = new Map(); -for (let i = 0; i < 5; ++i) - map.set(i, i); - -for (let i = 0; i < 1e2; ++i) { - let cloned = new Map(map); - shouldBe(cloned.size, map.size); -} - -class DerivedMap extends Map { - constructor(map) - { - super(map); - } - - set(key, value) - { - // ignore. - } -} - -for (let i = 0; i < 1e2; ++i) { - let cloned = new DerivedMap(map); - shouldBe(cloned.size, 0); -} diff --git a/implementation-contributed/javascriptcore/stress/map-iteration.js b/implementation-contributed/javascriptcore/stress/map-iteration.js deleted file mode 100644 index c5130e3f72..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-iteration.js +++ /dev/null @@ -1,395 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad result!"); -} -noInline(assert); - -function test1() { - let map = new Map; - map.set(20, 30); - let iter = map[Symbol.iterator](); - let {value, done} = iter.next(); - assert(value[0] === 20); - assert(value[1] === 30); - assert(!done); - ({value, done} = iter.next()); - assert(done); - assert(value === undefined); -} -for (let i = 0; i < 100; i++) - test1(); - -function test2() { - let map = new Map; - map.set(20, 30); - let iter = map[Symbol.iterator](); - let {value, done} = iter.next(); - assert(value[0] === 20); - assert(value[1] === 30); - assert(!done); - - ({value, done} = iter.next()); - assert(done); - assert(value === undefined); - - map.set(40, 50); - ({value, done} = iter.next()); - assert(done); - assert(value === undefined); -} -for (let i = 0; i < 100; i++) - test2(); - -function test3() { - let map = new Map; - map.set(20, 30); - map.set(50, 60); - let iter = map[Symbol.iterator](); - let {value, done} = iter.next(); - assert(value[0] === 20); - assert(value[1] === 30); - assert(!done); - - ({value, done} = iter.next()); - assert(!done); - assert(value[0] === 50); - assert(value[1] === 60); - - map.set("foo", "bar"); - ({value, done} = iter.next()); - assert(!done); - assert(value[0] === "foo"); - assert(value[1] === "bar"); - - ({value, done} = iter.next()); - assert(done); - assert(value === undefined); -} -for (let i = 0; i < 100; i++) - test3(); - -function test4() { - let map = new Map; - map.set(20, 30); - map.set(50, 60); - let iter = map[Symbol.iterator](); - let {value, done} = iter.next(); - assert(value[0] === 20); - assert(value[1] === 30); - assert(!done); - - map.clear(); - - ({value, done} = iter.next()); - assert(done); - assert(value === undefined); -} -for (let i = 0; i < 100; i++) - test4(); - -function test5() { - let map = new Map; - map.set(20, 30); - map.set(50, 60); - let iter = map[Symbol.iterator](); - let {value, done} = iter.next(); - assert(value[0] === 20); - assert(value[1] === 30); - assert(!done); - - map.clear(); - map.set(50, 60); - - ({value, done} = iter.next()); - assert(!done); - assert(value[0] === 50); - assert(value[1] === 60); - - ({value, done} = iter.next()); - assert(done); - assert(value === undefined); -} -for (let i = 0; i < 100; i++) - test5(); - -function test6() { - let map = new Map; - map.set(20, 30); - let i = 0; - for (let [key, value] of map) { - map.delete(key); - map.set(key, value); - i++; - if (i === 1000) - break; - } - assert(i === 1000); -} -test6(); - -function test7() { - let map = new Map; - map.set(20, 30); - let i = 0; - for (let [key, value] of map) { - map.clear(); - map.set(key, value); - i++; - if (i === 1000) - break; - } - assert(i === 1000); -} -test7(); - -function test8() { - let map = new Map; - map.set(20, 30); - for (let i = 0; i < 500; i++) - map.set(i, i); - let i = 0; - for (let [key, value] of map) { - assert(key === value); - i++; - if (key === 250) - break; - } - assert(i === 251); -} -test8(); - -function test9() { - assert(1/(-0) === -Infinity); - - let map = new Map; - map.set(-0, 50); // We should normalize -0 to +0 in the key. - for (let [key, value] of map) { - assert(1/key === Infinity); - } - assert(map.get(0.0) === 50); - assert(map.get(0) === 50); - assert(map.get(-0) === 50); - assert(map.get(+0) === 50); -} -for (let i = 0; i < 100; i++) - test9(); - -function test10() { - let map = new Map; - map.set("negZero", -0); // We should *not* normalize -0 to +0 in the value. - for (let [key, value] of map) { - assert(1/value === -Infinity); - } -} -for (let i = 0; i < 100; i++) - test10(); - -function test11() { - let map = new Map; - map.set(20, 30); - let iter = map.keys(); - let {value, done} = iter.next(); - assert(!done); - assert(value === 20); - - ({value, done} = iter.next()); - assert(done); - assert(value === undefined); - - ({value, done} = iter.next()) - assert(done); - assert(value === undefined); -} -for (let i = 0; i < 100; i++) - test11(); - -function test12() { - let map = new Map; - map.set(20, 30); - let iter = map.values(); - let {value, done} = iter.next(); - assert(!done); - assert(value === 30); - - ({value, done} = iter.next()); - assert(done); - assert(value === undefined); - - ({value, done} = iter.next()) - assert(done); - assert(value === undefined); -} -for (let i = 0; i < 100; i++) - test12(); - -function test13() { - let map = new Map; - map.set(20, 30); - map.set(50, 60); - let iter = map.keys(); - let {value, done} = iter.next(); - assert(!done); - assert(value === 20); - - map.clear(); - map.set("foo", "bar"); - - ({value, done} = iter.next()); - assert(!done); - assert(value === "foo"); - - ({value, done} = iter.next()) - assert(done); - assert(value === undefined); -} -for (let i = 0; i < 100; i++) - test13(); - -function test14() { - let map = new Map; - map.set(20, 30); - map.set(50, 60); - let iter = map.values(); - let {value, done} = iter.next(); - assert(!done); - assert(value === 30); - - map.clear(); - map.set("foo", "bar"); - - ;({value, done} = iter.next()) - assert(!done); - assert(value === "bar"); - - ({value, done} = iter.next()) - assert(done); - assert(value === undefined); -} -for (let i = 0; i < 100; i++) - test14(); - -function test15() { - let map = new Map; - map.set(20, 30); - map.set(50, 60); - let iter = map.keys(); - - let {value, done} = iter.next(); - assert(!done); - assert(value === 20); - - ;({value, done} = iter.next()) - assert(!done); - assert(value === 50); - - map.clear(); - - map.set("foo", "bar"); - - ({value, done} = iter.next()) - assert(!done); - assert(value === "foo"); - - ({value, done} = iter.next()) - assert(done); - assert(value === undefined); -} -for (let i = 0; i < 100; i++) - test15(); - -function test16() { - let map = new Map; - map.set(20, 30); - map.set(50, 60); - let iter = map.values(); - - let {value, done} = iter.next(); - assert(!done); - assert(value === 30); - - ;({value, done} = iter.next()) - assert(!done); - assert(value === 60); - - map.clear(); - - map.set("foo", "bar"); - - ({value, done} = iter.next()) - assert(!done); - assert(value === "bar"); - - ({value, done} = iter.next()) - assert(done); - assert(value === undefined); -} -for (let i = 0; i < 100; i++) - test16(); - -function test17() { - let map = new Map; - map.set(20, 30); - map.set(50, 60); - let iter = map.keys(); - - let {value, done} = iter.next(); - assert(!done); - assert(value === 20); - - ;({value, done} = iter.next()) - assert(!done); - assert(value === 50); - - map.clear(); - - map.set("foo", "bar"); - - ({value, done} = iter.next()) - assert(!done); - assert(value === "foo"); - - ({value, done} = iter.next()) - assert(done); - assert(value === undefined); - - map.set("hello", "world"); - ({value, done} = iter.next()) - assert(done); - assert(value === undefined); -} -for (let i = 0; i < 100; i++) - test17(); - -function test18() { - let map = new Map; - map.set(20, 30); - map.set(50, 60); - let iter = map.values(); - - let {value, done} = iter.next(); - assert(!done); - assert(value === 30); - - ;({value, done} = iter.next()) - assert(!done); - assert(value === 60); - - map.clear(); - - map.set("foo", "bar"); - - ({value, done} = iter.next()) - assert(!done); - assert(value === "bar"); - - ({value, done} = iter.next()) - assert(done); - assert(value === undefined); - - map.set("hello", "world"); - ({value, done} = iter.next()) - assert(done); - assert(value === undefined); -} -for (let i = 0; i < 100; i++) - test18(); diff --git a/implementation-contributed/javascriptcore/stress/map-iterator-result-should-have-expected-shape.js b/implementation-contributed/javascriptcore/stress/map-iterator-result-should-have-expected-shape.js deleted file mode 100644 index b34a2a272c..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-iterator-result-should-have-expected-shape.js +++ /dev/null @@ -1,33 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -{ - let map = new Map(); - map.set(42, 42); - let iterator = map[Symbol.iterator](); - { - let result = iterator.next(); - shouldBe(JSON.stringify(Object.getOwnPropertyNames(result).sort()), `["done","value"]`); - shouldBe(result.done, false); - shouldBe(JSON.stringify(result.value), `[42,42]`); - } - { - let result = iterator.next(); - shouldBe(JSON.stringify(Object.getOwnPropertyNames(result).sort()), `["done","value"]`); - shouldBe(result.done, true); - shouldBe(result.value, undefined); - } -} - -{ - let map = new Map(); - let iterator = map[Symbol.iterator](); - { - let result = iterator.next(); - shouldBe(JSON.stringify(Object.getOwnPropertyNames(result).sort()), `["done","value"]`); - shouldBe(result.done, true); - shouldBe(result.value, undefined); - } -} diff --git a/implementation-contributed/javascriptcore/stress/map-iterators-next.js b/implementation-contributed/javascriptcore/stress/map-iterators-next.js deleted file mode 100644 index f893b73587..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-iterators-next.js +++ /dev/null @@ -1,111 +0,0 @@ -// This test checks the behavior of the iterator.next methods on Map objects - -var testArray = [1,2,3,4,5,6] -var testMap = new Map(); -for (var [key, value] of testArray.entries()) { - testMap.set(key, value); -} -var keys = testMap.keys(); -var i = 0; -while (true) { - var {done, value: key} = keys.next(); - if (done) - break; - if (key >= testArray.length) - throw "Error: bad value: " + key; - i++; -} - -if (testMap.size !== i) - throw "Error: bad value: " + i; - -var value = keys.next().value; -if (value !== undefined) - throw "Error: bad value: " + value; - -var values = testMap.values(); -var i = 0; -while (true) { - var {done, value} = values.next(); - if (done) - break; - i++; - if (testArray.indexOf(value) === -1) - throw "Error: bad value: " + value; -} - -if (testMap.size !== i) - throw "Error: bad value: " + i; - -var value = values.next().value; -if (value !== undefined) - throw "Error: bad value: " + value; - -var entries = testMap.entries(); -var i = 0; -do { - var {done, value: entry} = entries.next(); - if (done) - break; - var [key, value] = entry; - if (value !== testMap.get(key)) - throw "Error: bad value: " + value + " " + testMap.get(key); - if (key >= testArray.length) - throw "Error: bad value: " + key; - i++; - if (testArray.indexOf(value) === -1) - throw "Error: bad value: " + value + " " + i; -} while (!done); - -if (testMap.size !== i) - throw "Error: bad value: " + i; - -var value = entries.next().value; -if (value !== undefined) - throw "Error: bad value: " + value; - -var entries = testMap.entries(); -var i = 0; -do { - var {done, value: entry} = entries.next(); - if (done) - break; - var [key, value] = entry; - if (value !== testMap.get(key)) - throw "Error: bad value: " + value + " " + testMap.get(key); - i++; - if (i % 4 === 0) - testMap.set(100000 + i, i); -} while (!done); - -if (testMap.size !== i) - throw "Error: bad value: " + i; - -var value = entries.next().value; -if (value !== undefined) - throw "Error: bad value: " + value; - -function otherKey(key) { - return (key + 1) % testArray.length; -} - -var entries = testMap.entries(); -var i = 0; -do { - var {done, value: entry} = entries.next(); - if (done) - break; - var [key, value] = entry; - if (value !== testMap.get(key)) - throw "Error: bad value: " + value + " " + testMap.get(key); - i++; - if (i % 4 === 0) - testMap.delete(otherKey(key)); -} while (!done); - -if (testMap.size !== i) - throw "Error: bad value: " + i; - -var value = entries.next().value; -if (value !== undefined) - throw "Error: bad value: " + value; diff --git a/implementation-contributed/javascriptcore/stress/map-rehash-2.js b/implementation-contributed/javascriptcore/stress/map-rehash-2.js deleted file mode 100644 index a2172ff7a5..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-rehash-2.js +++ /dev/null @@ -1,13 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad!") -} - -let set = new Set; -for (let i = 0; i < 64 + ((128 - 64)/2); i++) { - set.add(i); -} - -for (let i = 0; i < 64 + ((128 - 64)/2); i++) { - set.delete(i); -} diff --git a/implementation-contributed/javascriptcore/stress/map-rehash.js b/implementation-contributed/javascriptcore/stress/map-rehash.js deleted file mode 100644 index 01a2de15ed..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-rehash.js +++ /dev/null @@ -1,26 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad!") -} - -let set = new Set; -let items = []; -for (let i = 0; i < 3000; i++) { - items.push(i); - set.add(i); -} - -let counter = 1000000; -while (items.length) { - if (Math.random() < 0.85) { - let item = items.pop(); - let removed = set.delete(item); - assert(removed); - assert(items.length === set.size); - } else { - let newItem = ++counter; - items.push(newItem); - set.add(newItem); - assert(items.length === set.size); - } -} diff --git a/implementation-contributed/javascriptcore/stress/map-set-change-get.js b/implementation-contributed/javascriptcore/stress/map-set-change-get.js deleted file mode 100644 index dd49eb7ddc..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-set-change-get.js +++ /dev/null @@ -1,21 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var map = new Map(); - map.set(42, 20); - var res1 = map.get(42); - map.set(42, 400); - var res2 = map.get(42); - return [res1, res2]; -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) { - var [res1, res2] = test(); - shouldBe(res1, 20); - shouldBe(res2, 400); -} diff --git a/implementation-contributed/javascriptcore/stress/map-set-check-failure.js b/implementation-contributed/javascriptcore/stress/map-set-check-failure.js deleted file mode 100644 index 6a95327523..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-set-check-failure.js +++ /dev/null @@ -1,35 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -var func = Map.prototype.set; -function target(map) -{ - return func.call(map, 42, 42); -} -noInline(target); - -for (var i = 0; i < 1e6; ++i) { - var map = new Map(); - shouldBe(target(map), map); - shouldBe(map.get(42), 42); -} -shouldThrow(() => { - target(new Set()); -}, `TypeError: Map operation called on non-Map object`); diff --git a/implementation-contributed/javascriptcore/stress/map-set-clobber-map-get.js b/implementation-contributed/javascriptcore/stress/map-set-clobber-map-get.js deleted file mode 100644 index 043dcf8d69..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-set-clobber-map-get.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var map = new Map(); - map.set(42, 42); - var res1 = map.get(42); - map.set(42, 100); - var res2 = map.get(42); - return res1 + res2; -} - -for (var i = 0; i < 1e6; ++i) - shouldBe(test(), 142); diff --git a/implementation-contributed/javascriptcore/stress/map-set-create-bucket.js b/implementation-contributed/javascriptcore/stress/map-set-create-bucket.js deleted file mode 100644 index 6d90d66756..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-set-create-bucket.js +++ /dev/null @@ -1,23 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var map = new Map(); - var res1 = map.get(42); - map.set(42, 20); - var res2 = map.get(42); - map.set(42, 400); - var res3 = map.get(42); - return [res1, res2, res3]; -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - var [res1, res2, res3] = test(); - shouldBe(res1, undefined); - shouldBe(res2, 20); - shouldBe(res3, 400); -} diff --git a/implementation-contributed/javascriptcore/stress/map-set-does-not-clobber-set-has.js b/implementation-contributed/javascriptcore/stress/map-set-does-not-clobber-set-has.js deleted file mode 100644 index e11b9d2d3b..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-set-does-not-clobber-set-has.js +++ /dev/null @@ -1,19 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var map = new Map(); - var set = new Set(); - set.add(42); - var res1 = set.has(42); - map.set(42, 42); - var res2 = set.has(42); - return res1 + res2; -} - -for (var i = 0; i < 1e6; ++i) - shouldBe(test(), 2); diff --git a/implementation-contributed/javascriptcore/stress/map-set-does-not-clobber-weak-map-get.js b/implementation-contributed/javascriptcore/stress/map-set-does-not-clobber-weak-map-get.js deleted file mode 100644 index 56499f6bcd..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-set-does-not-clobber-weak-map-get.js +++ /dev/null @@ -1,26 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var map = new Map(); - var weakMap = new WeakMap(); - var key = {}; - - var res1 = weakMap.get(key); - map.set(key, key); - var res2 = weakMap.get(key); - weakMap.set(key, 42); - var res3 = weakMap.get(key); - return [undefined, undefined, 42]; -} - -for (var i = 0; i < 1e5; ++i) { - var [res1, res2, res3] = test(); - shouldBe(res1, undefined); - shouldBe(res2, undefined); - shouldBe(res3, 42); -} diff --git a/implementation-contributed/javascriptcore/stress/map-untyped-normalize-cse.js b/implementation-contributed/javascriptcore/stress/map-untyped-normalize-cse.js deleted file mode 100644 index c31b0ae33f..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-untyped-normalize-cse.js +++ /dev/null @@ -1,46 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var keys = [ - "Cappuccino", - -0.0, - Symbol("Cocoa"), - 42, - -42, - null, - undefined, - 420.5, - 0xffffffff, - 0x80000000, - -1, - -2147483648, - {}, - [], - false, - true, - NaN, -]; - -let i = 0; -let map = new Map(); -for (let key of keys) - map.set(key, i++); - -function test(map, key) -{ - return map.get(key) + map.get(key); -} -noInline(test); - -for (let i = 0; i < 1e4; ++i) { - let j = 0; - for (let key of keys) { - let result = j + j; - j++ - shouldBe(test(map, key), result); - } -} -shouldBe(test(map, 0.0), 2); diff --git a/implementation-contributed/javascriptcore/stress/map-untyped-normalize.js b/implementation-contributed/javascriptcore/stress/map-untyped-normalize.js deleted file mode 100644 index 5e5e10346b..0000000000 --- a/implementation-contributed/javascriptcore/stress/map-untyped-normalize.js +++ /dev/null @@ -1,44 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var keys = [ - "Cappuccino", - -0.0, - Symbol("Cocoa"), - 42, - -42, - null, - undefined, - 420.5, - 0xffffffff, - 0x80000000, - -1, - -2147483648, - {}, - [], - false, - true, - NaN, -]; - -let i = 0; -let map = new Map(); -for (let key of keys) - map.set(key, i++); - -function test(map, key) -{ - return map.get(key); -} -noInline(test); - -for (let i = 0; i < 1e4; ++i) { - let j = 0; - for (let key of keys) { - shouldBe(test(map, key), j++); - } -} -shouldBe(test(map, 0.0), 1); diff --git a/implementation-contributed/javascriptcore/stress/marked-argument-buffer.js b/implementation-contributed/javascriptcore/stress/marked-argument-buffer.js deleted file mode 100644 index f8230d9781..0000000000 --- a/implementation-contributed/javascriptcore/stress/marked-argument-buffer.js +++ /dev/null @@ -1,96 +0,0 @@ -// Regression test for <rdar://problem/27889416>. - -function allocate() { - var i = 0; - var array = new Array(17); - for ( ; i < array.length; i++) - array[i] = new Uint32Array(0x00040000); - i = 0; - var arr = []; - arr.xxx = "xxx"; - for (var i = 0; i < 1024; i++) { - arr[i] = new Array(i); - arr[i].xxx = "xxx " + i - } - - if (this.gc) - this.gc(); -} - -function test() { - var array = new Array(256); - var targetReference = []; - var keepAlive = null; - - for (var x = 0; x < array.length; x++) { - if (x == array.length / 4) { - keepAlive = new Array(2047); - targetReference.shift(); - } - - array[x] = new Array(4095); - } - - var o = {}; - var l = 0; - o.toString = function() { - if (0 == l) { - keepAlive = null; - targetReference = null; - obj.prop.value = null; - allocate(); - } - l += 1; - return 10; - }; - var obj = { - x0 : { - value : 0 - }, - x1 : { - value : 0 - }, - x2 : { - value : 0 - }, - x3 : { - value : 0 - }, - x4 : { - value : 0 - }, - x5 : { - value : 0 - }, - x6 : { - value : 0 - }, - x7 : { - value : 0 - }, - x8 : { - value : 0 - }, - x9 : { - value : 0 - }, - x10 : { - value : 0 - }, - length : { - value : o - }, - prop : { - value : targetReference - }, - beast : { - value : 0 - } - }; - var array2 = []; - var expectedLength = targetReference.length - Object.defineProperties(array2, obj); - if (array2.prop.length != expectedLength) - throw "fail"; -} -test(); diff --git a/implementation-contributed/javascriptcore/stress/materialize-activation-referenced-from-phantom-function.js b/implementation-contributed/javascriptcore/stress/materialize-activation-referenced-from-phantom-function.js deleted file mode 100644 index e0ed6295f8..0000000000 --- a/implementation-contributed/javascriptcore/stress/materialize-activation-referenced-from-phantom-function.js +++ /dev/null @@ -1,42 +0,0 @@ -function bar() -{ -} - -noInline(bar); - -function foo(p, x) -{ - var value = 1; - function inc() - { - return value + 1; - } - function dec() - { - return value - 1; - } - - if (!p) - return 0; - - bar(inc); - - x += 2000000000; - - value = 42; - return dec(); -} - -noInline(foo); - -function test(x) -{ - var result = foo(true, x); - if (result != 42 - 1) - throw "Error: bad result: " + result; -} - -for (var i = 0; i < 100000; ++i) - test(0); - -test(2000000000); diff --git a/implementation-contributed/javascriptcore/stress/materialize-object-referenced-from-phantom-object.js b/implementation-contributed/javascriptcore/stress/materialize-object-referenced-from-phantom-object.js deleted file mode 100644 index cf29b94776..0000000000 --- a/implementation-contributed/javascriptcore/stress/materialize-object-referenced-from-phantom-object.js +++ /dev/null @@ -1,37 +0,0 @@ -function bar() -{ -} - -noInline(bar); - -function foo(p, x) -{ - var a = {f: 1}; - var b = {f: a}; - var c = {f: a}; - - if (!p) - return 0; - - bar(b); - - x += 2000000000; - - c.f.f = 42; - return b.f.f; -} - -noInline(foo); - -function test(x) -{ - var result = foo(true, x); - if (result != 42) - throw "Error: bad result: " + result; -} - -for (var i = 0; i < 100000; ++i) - test(0); - -test(2000000000); - diff --git a/implementation-contributed/javascriptcore/stress/materialize-past-butterfly-allocation.js b/implementation-contributed/javascriptcore/stress/materialize-past-butterfly-allocation.js deleted file mode 100644 index b57ac8f91e..0000000000 --- a/implementation-contributed/javascriptcore/stress/materialize-past-butterfly-allocation.js +++ /dev/null @@ -1,89 +0,0 @@ -function bar() { - return {f:42}; -} - -noInline(bar); - -function foo0(b) { - var o = {f:42}; - if (b) { - var p = bar(); - p.g = o; - return p; - } -} - -function foo1(b) { - var o = {f:42}; - if (b) { - var p = bar(); - p.f1 = 1; - p.g = o; - return p; - } -} - -function foo2(b) { - var o = {f:42}; - if (b) { - var p = bar(); - p.f1 = 1; - p.f2 = 2; - p.g = o; - return p; - } -} - -function foo3(b) { - var o = {f:42}; - if (b) { - var p = bar(); - p.f1 = 1; - p.f2 = 2; - p.f3 = 3; - p.g = o; - return p; - } -} - -function foo4(b) { - var o = {f:42}; - if (b) { - var p = bar(); - p.f1 = 1; - p.f2 = 2; - p.f3 = 3; - p.f4 = 4; - p.g = o; - return p; - } -} - -noInline(foo0); -noInline(foo1); -noInline(foo2); -noInline(foo3); -noInline(foo4); - -var array = new Array(1000); -for (var i = 0; i < 400000; ++i) { - var o = foo0(true); - array[i % array.length] = o; -} -for (var i = 0; i < 400000; ++i) { - var o = foo1(true); - array[i % array.length] = o; -} -for (var i = 0; i < 400000; ++i) { - var o = foo2(true); - array[i % array.length] = o; -} -for (var i = 0; i < 400000; ++i) { - var o = foo3(true); - array[i % array.length] = o; -} -for (var i = 0; i < 400000; ++i) { - var o = foo4(true); - array[i % array.length] = o; -} - diff --git a/implementation-contributed/javascriptcore/stress/materialize-past-put-structure.js b/implementation-contributed/javascriptcore/stress/materialize-past-put-structure.js deleted file mode 100644 index cd7397ab88..0000000000 --- a/implementation-contributed/javascriptcore/stress/materialize-past-put-structure.js +++ /dev/null @@ -1,14 +0,0 @@ -function foo(p) { - var o = {f:42}; - if (p) - return {f:42, g:o}; -} - -noInline(foo); - -var array = new Array(1000); -for (var i = 0; i < 4000000; ++i) { - var o = foo(true); - array[i % array.length] = o; -} - diff --git a/implementation-contributed/javascriptcore/stress/materialize-regexp-at-osr-exit.js b/implementation-contributed/javascriptcore/stress/materialize-regexp-at-osr-exit.js deleted file mode 100644 index 1beef5281d..0000000000 --- a/implementation-contributed/javascriptcore/stress/materialize-regexp-at-osr-exit.js +++ /dev/null @@ -1,24 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(flag) -{ - var regexp = /hello world/; - regexp.lastIndex = "Cocoa"; - if (flag) { - OSRExit(); - return regexp; - } - return regexp.lastIndex; -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) - shouldBe(test(false), "Cocoa"); - -var regexp = test(true); -shouldBe(regexp instanceof RegExp, true); -shouldBe(regexp.lastIndex, "Cocoa"); diff --git a/implementation-contributed/javascriptcore/stress/materialize-regexp-cyclic-regexp-at-osr-exit.js b/implementation-contributed/javascriptcore/stress/materialize-regexp-cyclic-regexp-at-osr-exit.js deleted file mode 100644 index 7b6eb2fdb4..0000000000 --- a/implementation-contributed/javascriptcore/stress/materialize-regexp-cyclic-regexp-at-osr-exit.js +++ /dev/null @@ -1,28 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(num) -{ - var regexp = /hello world/; - var world = /World/; - regexp.lastIndex = world; - world.lastIndex = regexp; - if (num === 0) { - OSRExit(); - return regexp; - } - return 42; -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) - shouldBe(test(1), 42); - -var regexp = test(0); -shouldBe(regexp instanceof RegExp, true); -shouldBe(regexp.toString(), "/hello world/"); -shouldBe(regexp.lastIndex instanceof RegExp, true); -shouldBe(regexp.lastIndex.toString(), "/World/"); diff --git a/implementation-contributed/javascriptcore/stress/materialize-regexp-cyclic-regexp.js b/implementation-contributed/javascriptcore/stress/materialize-regexp-cyclic-regexp.js deleted file mode 100644 index 1d6e5a3d38..0000000000 --- a/implementation-contributed/javascriptcore/stress/materialize-regexp-cyclic-regexp.js +++ /dev/null @@ -1,46 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(num) -{ - var regexp = /hello world/; - var world = /World/; - regexp.lastIndex = world; - world.lastIndex = regexp; - if (num === 0) - return regexp; - if (num === 1) - return regexp.lastIndex; - return regexp.lastIndex.lastIndex; -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) { - var num = i % 3; - switch (num) { - case 0: - var regexp = test(num); - shouldBe(regexp instanceof RegExp, true); - shouldBe(regexp.toString(), "/hello world/"); - shouldBe(regexp.lastIndex instanceof RegExp, true); - shouldBe(regexp.lastIndex.toString(), "/World/"); - break; - case 1: - var regexp = test(num); - shouldBe(regexp instanceof RegExp, true); - shouldBe(regexp.toString(), "/World/"); - shouldBe(regexp.lastIndex instanceof RegExp, true); - shouldBe(regexp.lastIndex.toString(), "/hello world/"); - break; - case 2: - var regexp = test(num); - shouldBe(regexp instanceof RegExp, true); - shouldBe(regexp.toString(), "/hello world/"); - shouldBe(regexp.lastIndex instanceof RegExp, true); - shouldBe(regexp.lastIndex.toString(), "/World/"); - break; - } -} diff --git a/implementation-contributed/javascriptcore/stress/materialize-regexp-cyclic.js b/implementation-contributed/javascriptcore/stress/materialize-regexp-cyclic.js deleted file mode 100644 index 1097041204..0000000000 --- a/implementation-contributed/javascriptcore/stress/materialize-regexp-cyclic.js +++ /dev/null @@ -1,39 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(num) -{ - var regexp = /hello world/; - regexp.lastIndex = { ok: regexp, value: 42 }; - if (num === 0) - return regexp; - if (num === 1) - return regexp.lastIndex; - return regexp.lastIndex.value; -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) { - var num = i % 3; - switch (num) { - case 0: - var regexp = test(num); - shouldBe(regexp instanceof RegExp, true); - shouldBe(typeof regexp.lastIndex, "object"); - shouldBe(regexp.lastIndex.ok, regexp); - break; - case 1: - var object = test(num); - shouldBe(object.value, 42); - shouldBe(object.ok instanceof RegExp, true); - shouldBe(object.ok.lastIndex, object); - break; - case 2: - var value = test(num); - shouldBe(value, 42); - break; - } -} diff --git a/implementation-contributed/javascriptcore/stress/materialize-regexp-referenced-from-phantom-regexp-cyclic.js b/implementation-contributed/javascriptcore/stress/materialize-regexp-referenced-from-phantom-regexp-cyclic.js deleted file mode 100644 index 1c32353fb0..0000000000 --- a/implementation-contributed/javascriptcore/stress/materialize-regexp-referenced-from-phantom-regexp-cyclic.js +++ /dev/null @@ -1,43 +0,0 @@ -function bar() -{ -} - -noInline(bar); - -function foo(p, x) -{ - var a = /Hello/; - a.lastIndex = 1; - var b = /World/; - b.lastIndex = a; - var c = /World/; - c.lastIndex = a; - var d = /Cocoa/; - d.lastIndex = c; - a.lastIndex = d; - - if (!p) - return 0; - - bar(b); - - x += 2000000000; - - c.lastIndex.lastIndex = 42; - return b.lastIndex.lastIndex; -} - -noInline(foo); - -function test(x) -{ - var result = foo(true, x); - if (result != 42) - throw "Error: bad result: " + result; -} - -for (var i = 0; i < 100000; ++i) - test(0); - -test(2000000000); - diff --git a/implementation-contributed/javascriptcore/stress/materialize-regexp-referenced-from-phantom-regexp.js b/implementation-contributed/javascriptcore/stress/materialize-regexp-referenced-from-phantom-regexp.js deleted file mode 100644 index d11b9dd90b..0000000000 --- a/implementation-contributed/javascriptcore/stress/materialize-regexp-referenced-from-phantom-regexp.js +++ /dev/null @@ -1,40 +0,0 @@ -function bar() -{ -} - -noInline(bar); - -function foo(p, x) -{ - var a = /Hello/; - a.lastIndex = 1; - var b = /World/; - b.lastIndex = a; - var c = /World/; - c.lastIndex = a; - - if (!p) - return 0; - - bar(b); - - x += 2000000000; - - c.lastIndex.lastIndex = 42; - return b.lastIndex.lastIndex; -} - -noInline(foo); - -function test(x) -{ - var result = foo(true, x); - if (result != 42) - throw "Error: bad result: " + result; -} - -for (var i = 0; i < 100000; ++i) - test(0); - -test(2000000000); - diff --git a/implementation-contributed/javascriptcore/stress/materialize-regexp.js b/implementation-contributed/javascriptcore/stress/materialize-regexp.js deleted file mode 100644 index 1fccf8d83b..0000000000 --- a/implementation-contributed/javascriptcore/stress/materialize-regexp.js +++ /dev/null @@ -1,24 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(flag) -{ - var regexp = /hello world/; - regexp.lastIndex = "Cocoa"; - if (flag) - return regexp; - return regexp.lastIndex; -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) { - if (i & 0x1) { - var regexp = test(true); - shouldBe(regexp instanceof RegExp, true); - shouldBe(regexp.lastIndex, "Cocoa"); - } else - shouldBe(test(false), "Cocoa"); -} diff --git a/implementation-contributed/javascriptcore/stress/materialized-regexp-has-correct-last-index-set-by-match-at-osr-exit.js b/implementation-contributed/javascriptcore/stress/materialized-regexp-has-correct-last-index-set-by-match-at-osr-exit.js deleted file mode 100644 index ea7750525a..0000000000 --- a/implementation-contributed/javascriptcore/stress/materialized-regexp-has-correct-last-index-set-by-match-at-osr-exit.js +++ /dev/null @@ -1,41 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(num, string) -{ - var regexp = /hello/g; - regexp.lastIndex = "Cocoa"; - if (num === 2) - return regexp.lastIndex; - var result = string.match(regexp); - if (num === 1) { - OSRExit(); - return [result, regexp]; - } - return regexp.lastIndex; -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - var num = i % 3; - switch (num) { - case 0: - shouldBe(test(num, "hellohello"), 0); - break; - case 1: - break; - case 2: - shouldBe(test(num, "hellohello"), "Cocoa"); - break; - } -} - -var [result, regexp] = test(1, "hellohello"); -shouldBe(regexp instanceof RegExp, true); -shouldBe(regexp.lastIndex, 0); -shouldBe(result.length, 2); -shouldBe(result[0], "hello"); -shouldBe(result[1], "hello"); diff --git a/implementation-contributed/javascriptcore/stress/materialized-regexp-has-correct-last-index-set-by-match.js b/implementation-contributed/javascriptcore/stress/materialized-regexp-has-correct-last-index-set-by-match.js deleted file mode 100644 index fb55123f61..0000000000 --- a/implementation-contributed/javascriptcore/stress/materialized-regexp-has-correct-last-index-set-by-match.js +++ /dev/null @@ -1,28 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(flag, string) -{ - var regexp = /hello/g; - regexp.lastIndex = "Cocoa"; - var result = string.match(regexp); - if (flag) - return [result, regexp]; - return regexp.lastIndex; -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) { - if (i & 0x1) { - var [result, regexp] = test(true, "hellohello"); - shouldBe(regexp instanceof RegExp, true); - shouldBe(regexp.lastIndex, 0); - shouldBe(result.length, 2); - shouldBe(result[0], "hello"); - shouldBe(result[1], "hello"); - } else - shouldBe(test(false, "hellohello"), 0); -} diff --git a/implementation-contributed/javascriptcore/stress/multiply-typed-double-and-object.js b/implementation-contributed/javascriptcore/stress/multiply-typed-double-and-object.js deleted file mode 100644 index c31f4d5dc1..0000000000 --- a/implementation-contributed/javascriptcore/stress/multiply-typed-double-and-object.js +++ /dev/null @@ -1,63 +0,0 @@ -var otherObject = { - valueOf: function() { return 5.1; } -}; -// DFG. -var targetDFG = { - value: 5.5, - multiply: function(arg) { - let returnValue = 1; - if (typeof arg == "number") { - returnValue = this.value * arg; - } - return returnValue + 1; - } -}; -noInline(targetDFG.multiply); - -for (let i = 0; i < 400; ++i) { - if (targetDFG.multiply(otherObject) !== 2) - throw "Failed targetDFG.multiply(otherObject)"; - let result = targetDFG.multiply(Math.PI); - if (result !== (5.5 * Math.PI + 1)) - throw "Failed targetDFG.multiply(Math.PI), expected " + (5.5 * Math.PI + 1) + " got " + result + " at iteration " + i; -} -for (let i = 0; i < 1e3; ++i) { - let result = targetDFG.multiply(Math.PI); - if (result !== (5.5 * Math.PI + 1)) - throw "Failed targetDFG.multiply(Math.PI), expected " + (5.5 * Math.PI + 1) + " got " + result + " at iteration " + i; -} - -// FTL. -var targetFTL = { - value: 5.5, - multiply: function(arg) { - let returnValue = 1; - if (typeof arg == "number") { - returnValue = this.value * arg; - } - return returnValue + 1; - } -}; -noInline(targetFTL.multiply); - -// Warmup to baseline. -for (let i = 0; i < 400; ++i) { - if (targetFTL.multiply(otherObject) !== 2) - throw "Failed targetFTL.multiply(otherObject)"; - let result = targetFTL.multiply(Math.PI); - if (result !== (5.5 * Math.PI + 1)) - throw "Failed targetFTL.multiply(Math.PI), expected " + (5.5 * Math.PI + 1) + " got " + result + " at iteration " + i; -} - -// Step over DFG *WITHOUT* OSR Exit. -for (let i = 0; i < 1e6; ++i) { - if (targetFTL.multiply(otherObject) !== 2) - throw "Failed targetFTL.multiply(otherObject)"; -} - -// Now OSR Exit in FTL. -for (let i = 0; i < 1e2; ++i) { - let result = targetFTL.multiply(Math.PI); - if (result !== (5.5 * Math.PI + 1)) - throw "Failed targetFTL.multiply(Math.PI), expected " + (5.5 * Math.PI + 1) + " got " + result + " at iteration " + i; -} diff --git a/implementation-contributed/javascriptcore/stress/mutual-tail-call-no-stack-overflow.js b/implementation-contributed/javascriptcore/stress/mutual-tail-call-no-stack-overflow.js deleted file mode 100644 index ccafeb2f0c..0000000000 --- a/implementation-contributed/javascriptcore/stress/mutual-tail-call-no-stack-overflow.js +++ /dev/null @@ -1,73 +0,0 @@ -//@ defaultNoSamplingProfilerRun - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -function sloppyCountdown(n) { - function even(n) { - if (n == 0) - return n; - return odd(n - 1); - } - - function odd(n) { - if (n == 1) - return n; - return even(n - 1); - } - - if (n % 2 === 0) - return even(n); - else - return odd(n); -} - -function strictCountdown(n) { - "use strict"; - - function even(n) { - if (n == 0) - return n; - return odd(n - 1); - } - - function odd(n) { - if (n == 1) - return n; - return even(n - 1); - } - - if (n % 2 === 0) - return even(n); - else - return odd(n); -} - -shouldThrow(function () { sloppyCountdown(100000); }, "RangeError: Maximum call stack size exceeded."); -strictCountdown(100000); - -// Parity alterning -function odd(n) { - "use strict"; - if (n > 0) - return even(n, 0); -} - -function even(n) { - "use strict"; - return odd(n - 1); -} - -odd(100000); diff --git a/implementation-contributed/javascriptcore/stress/nan-equal-untyped.js b/implementation-contributed/javascriptcore/stress/nan-equal-untyped.js deleted file mode 100644 index 7584d20329..0000000000 --- a/implementation-contributed/javascriptcore/stress/nan-equal-untyped.js +++ /dev/null @@ -1,24 +0,0 @@ -function foo(x) { - return x == x; -} - -noInline(foo); - -function test(value) { - var result = foo(value); - if (result !== true) - throw "Error: bad result for " + value + ": " + result; -} - -for (var i = 0; i < 10000; ++i) { - test(true); - test(4); - test("hello"); - test(new Object()); - test(1.5); -} - -var result = foo(0/0); -if (result !== false) - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/nan-equal.js b/implementation-contributed/javascriptcore/stress/nan-equal.js deleted file mode 100644 index eaf2b6e919..0000000000 --- a/implementation-contributed/javascriptcore/stress/nan-equal.js +++ /dev/null @@ -1,12 +0,0 @@ -function foo(x) { - return x == x; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(0/0); - if (result !== false) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/native-constructors-length.js b/implementation-contributed/javascriptcore/stress/native-constructors-length.js deleted file mode 100644 index 78bc0eccc6..0000000000 --- a/implementation-contributed/javascriptcore/stress/native-constructors-length.js +++ /dev/null @@ -1,41 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion"); -} - -function assertLengthDescriptorAttributes(ctor, lengthValue) { - let descriptor = Object.getOwnPropertyDescriptor(ctor, "length"); - - assert(descriptor.value === lengthValue); - assert(!descriptor.enumerable); - assert(!descriptor.writable); - assert(descriptor.configurable); -} - -assertLengthDescriptorAttributes(Array, 1); -assertLengthDescriptorAttributes(ArrayBuffer, 1); -assertLengthDescriptorAttributes(Boolean, 1); -assertLengthDescriptorAttributes(DataView, 3); -assertLengthDescriptorAttributes(Date, 7); -assertLengthDescriptorAttributes(Error, 1); -assertLengthDescriptorAttributes(Function, 1); -assertLengthDescriptorAttributes(Map, 0); -assertLengthDescriptorAttributes(Number, 1); -assertLengthDescriptorAttributes(Object, 1); -assertLengthDescriptorAttributes(Promise, 1); -assertLengthDescriptorAttributes(Proxy, 2); -assertLengthDescriptorAttributes(RegExp, 2); -assertLengthDescriptorAttributes(Set, 0); -assertLengthDescriptorAttributes(String, 1); -assertLengthDescriptorAttributes(Symbol, 0); -assertLengthDescriptorAttributes(WeakMap, 0); -assertLengthDescriptorAttributes(WeakSet, 0); - -assertLengthDescriptorAttributes(Int8Array, 3); -assertLengthDescriptorAttributes(Uint8Array, 3); -assertLengthDescriptorAttributes(Int16Array, 3); -assertLengthDescriptorAttributes(Uint16Array, 3); -assertLengthDescriptorAttributes(Int32Array, 3); -assertLengthDescriptorAttributes(Uint32Array, 3); -assertLengthDescriptorAttributes(Float32Array, 3); -assertLengthDescriptorAttributes(Float64Array, 3); diff --git a/implementation-contributed/javascriptcore/stress/native-error-properties.js b/implementation-contributed/javascriptcore/stress/native-error-properties.js deleted file mode 100644 index ecc56b1c89..0000000000 --- a/implementation-contributed/javascriptcore/stress/native-error-properties.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; - -function assert(b) { - if (!b) - throw new Error("Bad assertion"); -} - -function shouldNotThrow(expr) { - let testFunc = new Function(expr); - let error; - try { - testFunc(); - } catch (e) { - error = e; - } - assert(!error); -} - -function checkEmptyErrorPropertiesDescriptors(error) { - let descriptor = Object.getOwnPropertyDescriptor(error, "message"); - assert(descriptor === undefined); -} - -function checkNonEmptyErrorPropertiesDescriptors(error) { - let descriptor = Object.getOwnPropertyDescriptor(error, "message"); - assert(descriptor.configurable); - assert(!descriptor.enumerable); - assert(descriptor.writable); -} - -function checkErrorPropertiesWritable(error) { - let properties = ["name", "message", "line", "lineNumber", "column", "columnNumber", "sourceURL", "stack"]; - for (let p of properties) { - assert(error[p] !== 999); - error[p] = 999; - assert(error[p] === 999); - } -} - -// User created error instances. -let errorConstructors = [Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError]; -for (let constructor of errorConstructors) { - shouldNotThrow(`checkErrorPropertiesWritable(new ${constructor.name})`); - shouldNotThrow(`checkEmptyErrorPropertiesDescriptors(new ${constructor.name})`); - shouldNotThrow(`checkNonEmptyErrorPropertiesDescriptors(new ${constructor.name}('message'))`); -} - -// Engine created error instances. -var globalError = null; - -try { - eval("{"); -} catch (e) { - globalError = e; - assert(e.name === "SyntaxError"); - assert(e.message.length); - shouldNotThrow("checkNonEmptyErrorPropertiesDescriptors(globalError)"); - shouldNotThrow("checkErrorPropertiesWritable(globalError)"); -} - -try { - a.b.c; -} catch (e) { - globalError = e; - assert(e.name === "ReferenceError"); - assert(e.message.length); - shouldNotThrow("checkNonEmptyErrorPropertiesDescriptors(globalError)"); - shouldNotThrow("checkErrorPropertiesWritable(globalError)"); -} - -try { - undefined.x; -} catch (e) { - globalError = e; - assert(e.name === "TypeError"); - assert(e.message.length); - shouldNotThrow("checkNonEmptyErrorPropertiesDescriptors(globalError)"); - shouldNotThrow("checkErrorPropertiesWritable(globalError)"); -} diff --git a/implementation-contributed/javascriptcore/stress/need-bytecode-liveness-for-unreachable-blocks-at-dfg-time.js b/implementation-contributed/javascriptcore/stress/need-bytecode-liveness-for-unreachable-blocks-at-dfg-time.js deleted file mode 100644 index 5fa74d209b..0000000000 --- a/implementation-contributed/javascriptcore/stress/need-bytecode-liveness-for-unreachable-blocks-at-dfg-time.js +++ /dev/null @@ -1,31 +0,0 @@ -//@ run("--useConcurrentJIT=false") - -// This test is set up delicately to: -// 1. cause the test() function to DFG compile with just the right amount of profiling -// so that ... -// 2. the DFG identifies the "return Function()" path as dead, and ... -// 3. the DFG compiled function doesn't OSR exit too many times before ... -// 4. we change the implementation of the inlined foo() and execute test() again. -// -// This test should not crash. - -eval("\"use strict\"; var w;"); -foo = function() { throw 0; } -var x; - -(function() { - eval("test = function() { ~foo(~(0 ? ~x : x) ? 0 : 0); return Function(); }"); -})(); - -// This loop count of 2000 was empirically determined to be the right amount to get this -// this issue to manifest. Dropping or raising it may mask the issue and prevent it from -// manifesting. -for (var i = 0; i < 2000; ++i) { - try { - test(); - } catch(e) { - } -} - -foo = function() { }; -test(); diff --git a/implementation-contributed/javascriptcore/stress/new-array-buffer-sinking-osrexit.js b/implementation-contributed/javascriptcore/stress/new-array-buffer-sinking-osrexit.js deleted file mode 100644 index a95c3266de..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-array-buffer-sinking-osrexit.js +++ /dev/null @@ -1,17 +0,0 @@ -function target(p, a0, a1, a2, a3, a4, a5) -{ - if (p) - OSRExit(); - return a5 -} - -function test(p) -{ - var array = [1,2,3,4,5]; - return target(p, ...array); -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) - test(false); -test(true); diff --git a/implementation-contributed/javascriptcore/stress/new-array-dead.js b/implementation-contributed/javascriptcore/stress/new-array-dead.js deleted file mode 100644 index 617e4725ee..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-array-dead.js +++ /dev/null @@ -1,42 +0,0 @@ -// Tests when we have a dead NewArray that we end up killing and there are other things in the basic block. - -function foo(a, b, c) { - var d = a + b; - var e = b + c; - var f = c + a; - var g = a - b; - var h = b - c; - var i = c - a; - var j = [a + 1, b + 2, c + 3, d + 4, e + 5, f + 6, g + 7, h + 8, i + 9]; - var d = a * b; - var e = b * c; - var f = c * a; - var g = a / b; - var h = b / c; - var i = c / a; - var j = [a + 10, b + 11, c + 12, d + 13, e + 14, f + 15, g + 16, h + 17, i + 18]; - var d = a % b; - var e = b % c; - var f = c % a; - var g = b - a; - var h = c - b; - var i = a - c; - var j = [a + 19, b + 20, c + 21, d + 22, e + 23, f + 24, g + 25, h + 26, i + 27]; - var d = b / a; - var e = c / b; - var f = a + c; - var g = b % a; - var h = c % b; - var i = a % c; - var j = [a + 28, b + 29, c + 30, d + 31, e + 32, f + 33, g + 34, h + 35, i + 36]; - return 42; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(1.5, 2.5, 3.5); - if (result != 42) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/new-array-having-a-bad-time-double.js b/implementation-contributed/javascriptcore/stress/new-array-having-a-bad-time-double.js deleted file mode 100644 index 5ee4f6a3db..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-array-having-a-bad-time-double.js +++ /dev/null @@ -1,25 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad"); -} - -function foo(a, b, c) { - let x = a + b + c; - return [a, b, c, x]; -} -noInline(foo); - -Object.defineProperty(Object.prototype, "10000", {get() { return 20; }}); - -for (let i = 0; i < 10000; ++i) { - let a = 10.5; - let b = 1.1; - let c = 1.2; - let x = a + b + c; - let result = foo(a, b, c); - assert(result.length === 4); - assert(result[0] === a); - assert(result[1] === b); - assert(result[2] === c); - assert(result[3] === x); -} diff --git a/implementation-contributed/javascriptcore/stress/new-array-storage-array-with-size.js b/implementation-contributed/javascriptcore/stress/new-array-storage-array-with-size.js deleted file mode 100644 index af3a239ef5..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-array-storage-array-with-size.js +++ /dev/null @@ -1,29 +0,0 @@ -function foo(x) { - return new Array(x); -} - -noInline(foo); - -// Warm up up to create array storage. -for (var i = 0; i < 10000; ++i) { - var array = foo(10); - array.__defineSetter__(0, function(v) { }); -} - -function test(size) { - var result = foo(size); - if (result.length != size) - throw "Error: bad result: " + result; - var sawThings = false; - for (var s in result) - sawThings = true; - if (sawThings) - throw "Error: array is in bad state: " + result; - result[0] = "42.5"; - if (result[0] != "42.5") - throw "Error: array is in wierd state: " + result; -} - -for (var i = 0; i < 100000; ++i) { - test(10); -} diff --git a/implementation-contributed/javascriptcore/stress/new-array-then-exit.js b/implementation-contributed/javascriptcore/stress/new-array-then-exit.js deleted file mode 100644 index 7c8a6901e8..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-array-then-exit.js +++ /dev/null @@ -1,14 +0,0 @@ -function foo(f) { - return new f(); -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) - foo(Array); - -var didCall = false; -foo(function() { didCall = true; }); - -if (!didCall) - throw "Error: didn't call my function."; diff --git a/implementation-contributed/javascriptcore/stress/new-array-with-size-div.js b/implementation-contributed/javascriptcore/stress/new-array-with-size-div.js deleted file mode 100644 index f0d113f92d..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-array-with-size-div.js +++ /dev/null @@ -1,22 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(length, number) -{ - return new Array(length / number); -} -noInline(test); - -var value = 0; -var number = 0; -for (var i = 0; i < 1e4; ++i) { - value = i * 2; - number = 2; - if (i === (1e4 - 1)) { - value = 0; - number = -1; - } - shouldBe(test(value, number).length, (value / number)); -} diff --git a/implementation-contributed/javascriptcore/stress/new-array-with-size-throw-exception-and-tear-off-arguments.js b/implementation-contributed/javascriptcore/stress/new-array-with-size-throw-exception-and-tear-off-arguments.js deleted file mode 100644 index 8908bce17a..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-array-with-size-throw-exception-and-tear-off-arguments.js +++ /dev/null @@ -1,26 +0,0 @@ -function foo() { - var a = arguments; - return new Array(a[0]); -} - -function bar(x) { - return foo(x); -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var result = bar(42); - if (result.length != 42) - throw "Error: bad result length: " + result; -} - -var didThrow = false; -try { - bar(-1); -} catch (e) { - didThrow = e; -} - -if (("" + didThrow).indexOf("RangeError") != 0) - throw "Error: did not throw right exception: " + didThrow; diff --git a/implementation-contributed/javascriptcore/stress/new-array-with-size-with-bad-time.js b/implementation-contributed/javascriptcore/stress/new-array-with-size-with-bad-time.js deleted file mode 100644 index f56774156f..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-array-with-size-with-bad-time.js +++ /dev/null @@ -1,34 +0,0 @@ -function foo(x) { - return new Array(x); -} - -noInline(foo); - -var poke; -Array.prototype.__defineSetter__("1", function() { - poke = "poke"; -}); - -function test(size) { - var result = foo(size); - if (result.length != size) - throw "Error: bad result: " + result; - var sawThings = false; - for (var s in result) { - if (s != "1") - sawThings = true; - } - if (sawThings) - throw "Error: array is in bad state: " + result; - result[0] = "42.5"; - if (result[0] != "42.5") - throw "Error: array is in wierd state: " + result; - poke = null; - result[1] = 42; - if (poke != "poke") - throw "Error: setter not called."; -} - -for (var i = 0; i < 100000; ++i) { - test(42); -} diff --git a/implementation-contributed/javascriptcore/stress/new-array-with-spread-double-new-array-buffer.js b/implementation-contributed/javascriptcore/stress/new-array-with-spread-double-new-array-buffer.js deleted file mode 100644 index aaf88a667d..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-array-with-spread-double-new-array-buffer.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - return [...[1.2, 2.3, 3.4]]; -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) { - var [a, b, c] = test(); - shouldBe(a, 1.2); - shouldBe(b, 2.3); - shouldBe(c, 3.4); -} diff --git a/implementation-contributed/javascriptcore/stress/new-array-with-spread-with-normal-spread-and-phantom-spread.js b/implementation-contributed/javascriptcore/stress/new-array-with-spread-with-normal-spread-and-phantom-spread.js deleted file mode 100644 index 001ec72628..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-array-with-spread-with-normal-spread-and-phantom-spread.js +++ /dev/null @@ -1,33 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} -noInline(assert); - -function foo(a, ...args) { - let r = [...a, ...args]; - return r; -} -noInline(foo); - -function escape(a) { return a; } -noInline(escape); -function bar(a, ...args) { - escape(args); - let r = [...a, ...args]; - return r; -} -noInline(foo); - -for (let i = 0; i < 50000; i++) { - for (let f of [foo, bar]) { - let o = {}; - let a = [o, 20]; - let r = f(a, 30, 40); - assert(r.length === 4); - assert(r[0] === o); - assert(r[1] === 20); - assert(r[2] === 30); - assert(r[3] === 40); - } -} diff --git a/implementation-contributed/javascriptcore/stress/new-array-with-spread-with-phantom-new-array-buffer.js b/implementation-contributed/javascriptcore/stress/new-array-with-spread-with-phantom-new-array-buffer.js deleted file mode 100644 index f4d40391a6..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-array-with-spread-with-phantom-new-array-buffer.js +++ /dev/null @@ -1,28 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function target(array) -{ - return [...array, 4, ...array]; -} - -function test() -{ - return target([1, 2, 3]); -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) { - var result = test(); - shouldBe(result.length, 7); - shouldBe(result[0], 1); - shouldBe(result[1], 2); - shouldBe(result[2], 3); - shouldBe(result[3], 4); - shouldBe(result[4], 1); - shouldBe(result[5], 2); - shouldBe(result[6], 3); -} diff --git a/implementation-contributed/javascriptcore/stress/new-contiguous-array-with-size.js b/implementation-contributed/javascriptcore/stress/new-contiguous-array-with-size.js deleted file mode 100644 index d08a6f67e8..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-contiguous-array-with-size.js +++ /dev/null @@ -1,31 +0,0 @@ -function foo(x) { - return new Array(x); -} - -noInline(foo); - -function test(size) { - var result = foo(size); - if (result.length != size) { - print("Got a weird length: " + result.length); - throw "Error: bad result: " + result; - } - var sawThings = false; - for (var s in result) - sawThings = true; - if (sawThings) { - print("Saw things!"); - throw "Error: array is in bad state: " + result; - } - result[0] = "42.5"; - if (result[0] != "42.5") { - print("Didn't store what I thought I stored."); - throw "Error: array is in wierd state: " + result; - } -} - -for (var i = 0; i < 100000; ++i) { - test(0); - test(1); - test(42); -} diff --git a/implementation-contributed/javascriptcore/stress/new-double-array-with-size.js b/implementation-contributed/javascriptcore/stress/new-double-array-with-size.js deleted file mode 100644 index 64f28ba643..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-double-array-with-size.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(x) { - return new Array(x); -} - -noInline(foo); - -function test(size) { - var result = foo(size); - if (result.length != size) - throw "Error: bad result: " + result; - var sawThings = false; - for (var s in result) - sawThings = true; - if (sawThings) - throw "Error: array is in bad state: " + result; - result[0] = 42.5; - if (result[0] != 42.5) - throw "Error: array is in wierd state: " + result; -} - -for (var i = 0; i < 100000; ++i) { - test(0); - test(1); - test(42); -} diff --git a/implementation-contributed/javascriptcore/stress/new-function-expression-has-structures.js b/implementation-contributed/javascriptcore/stress/new-function-expression-has-structures.js deleted file mode 100644 index ce0751a3a2..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-function-expression-has-structures.js +++ /dev/null @@ -1,11 +0,0 @@ -function foo() { - var f = function() { return 42 }; - f.prototype.f = function() { return 43; }; - return f.prototype.f; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) - foo(); - diff --git a/implementation-contributed/javascriptcore/stress/new-int32-array-with-size.js b/implementation-contributed/javascriptcore/stress/new-int32-array-with-size.js deleted file mode 100644 index 4f8c5db720..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-int32-array-with-size.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(x) { - return new Array(x); -} - -noInline(foo); - -function test(size) { - var result = foo(size); - if (result.length != size) - throw "Error: bad result: " + result; - var sawThings = false; - for (var s in result) - sawThings = true; - if (sawThings) - throw "Error: array is in bad state: " + result; - result[0] = 42; - if (result[0] != 42) - throw "Error: array is in wierd state: " + result; -} - -for (var i = 0; i < 100000; ++i) { - test(0); - test(1); - test(42); -} diff --git a/implementation-contributed/javascriptcore/stress/new-largeish-contiguous-array-with-size.js b/implementation-contributed/javascriptcore/stress/new-largeish-contiguous-array-with-size.js deleted file mode 100644 index 05a2614a45..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-largeish-contiguous-array-with-size.js +++ /dev/null @@ -1,47 +0,0 @@ -// We only need one run of this with any GC or JIT strategy. This test is not particularly fast. -// Unfortunately, it needs to run for a while to test the thing it's testing. -//@ if $architecture =~ /arm/ then skip else runWithRAMSize(10000000) end -//@ slow! - -function foo(x) { - return new Array(x); -} - -noInline(foo); - -function test(size) { - var result = foo(size); - if (result.length != size) - throw "Error: bad result: " + result; - var sawThings = false; - for (var s in result) - sawThings = true; - if (sawThings) - throw "Error: array is in bad state: " + result; - result[0] = "42.5"; - if (result[0] != "42.5") - throw "Error: array is in weird state: " + result; -} - -var result = gcHeapSize(); - -for (var i = 0; i < 1000; ++i) { - // The test was written when we found that large array allocations weren't being accounted for - // in that part of the GC's accounting that determined the GC trigger. Consequently, the GC - // would run too infrequently in this loop and we would use an absurd amount of memory when this - // loop exited. - test(50000); -} - -// Last time I tested, the heap should be 3725734 before and 125782 after. I don't want to enforce -// exactly that. If you regress the accounting code, the GC heap size at this point will be much -// more than that. -var result = gcHeapSize(); -if (result > 10000000) - throw "Error: heap too big before forced GC: " + result; - -// Do a final check after GC, just for sanity. -gc(); -result = gcHeapSize(); -if (result > 1000000) - throw "Error: heap too big after forced GC: " + result; diff --git a/implementation-contributed/javascriptcore/stress/new-promise-capabilities-requires-constructor.js b/implementation-contributed/javascriptcore/stress/new-promise-capabilities-requires-constructor.js deleted file mode 100644 index ec222646d6..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-promise-capabilities-requires-constructor.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -shouldThrow(() => { - Promise.race.call(() => { }, []); -}, `TypeError: promise capability requires a constructor function`); diff --git a/implementation-contributed/javascriptcore/stress/new-regex-inline.js b/implementation-contributed/javascriptcore/stress/new-regex-inline.js deleted file mode 100644 index 22feeb5b13..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-regex-inline.js +++ /dev/null @@ -1,82 +0,0 @@ -function assert(a) { - if (!a) - throw Error("bad assertion"); -} - -function testRegexpInline(functor) { - for (let i = 0; i < 100000; i++) { - functor(); - } - - gc(); - - // Create objects to force collected objects be reused - for (let i = 0; i < 10000000; i++) { - let a = {value: i}; - } - - // Checking if RegExp were collected - for (let i = 0; i < 100; i++) { - functor(); - } -} - -function toInlineGlobal() { - var re = /cc+/; - - assert(re.test("ccc")); - assert(!re.test("abc")); - return 0; -} - -function withRegexp() { - toInlineGlobal(); - var re = /(ab)+/; - assert(re.test("ab")); - assert(!re.test("ba")); - return 0; -} - -noInline(withRegexp); - -testRegexpInline(withRegexp); - -function inlineRegexpNotGlobal() { - let toInline = () => { - let re = /a+/; - - assert(re.test("aaaaaa")); - assert(!re.test("bc")); - } - - toInline(); -} - -noInline(inlineRegexpNotGlobal); - -testRegexpInline(inlineRegexpNotGlobal); - -function toInlineRecursive(depth) { - if (depth == 5) { - return; - } - - var re = /(ef)+/; - - assert(re.test("efef")); - assert(!re.test("abc")); - - toInlineRecursive(depth + 1); -} - -function regexpContainsRecursive() { - var re = /r+/; - toInlineRecursive(0); - - assert(re.test("r")); - assert(!re.test("ab")); -} -noInline(regexpContainsRecursive); - -testRegexpInline(regexpContainsRecursive); - diff --git a/implementation-contributed/javascriptcore/stress/new-string-object.js b/implementation-contributed/javascriptcore/stress/new-string-object.js deleted file mode 100644 index e2e770d6a1..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-string-object.js +++ /dev/null @@ -1,16 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(string) -{ - return new String(string); -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) { - var object = test("Cocoa"); - shouldBe(object instanceof String, true); - shouldBe(object.valueOf(), "Cocoa"); -} diff --git a/implementation-contributed/javascriptcore/stress/new-target-syntax-errors.js b/implementation-contributed/javascriptcore/stress/new-target-syntax-errors.js deleted file mode 100644 index b37dceb3a8..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-target-syntax-errors.js +++ /dev/null @@ -1,184 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} - -function shouldBeSyntaxError(str) { - let failed = true; - try { - new Function(str); - } catch(e) { - if (e instanceof SyntaxError) - failed = false; - } - - if (failed) - throw new Error("Did not throw syntax error: " + str); -} - -function shouldNotBeSyntaxError(str) { - let failed = false; - try { - new Function(str); - } catch(e) { - if (e instanceof SyntaxError && e.message.indexOf("new.target") !== -1) - failed = true; - } - - if (failed) - throw new Error("Did throw a syntax error: " + str); -} - - -let operators = ["=", "+=", "-=", "*=", "<<=", ">>=", ">>>=", "&=", "^=", "|=", "%="]; -for (let operator of operators) { - let functionBody = `new.target ${operator} 20`; - shouldBeSyntaxError(functionBody); - - functionBody = `foo = new.target ${operator} 20`; - shouldBeSyntaxError(functionBody); - - functionBody = `foo ${operator} new.target ${operator} 20`; - shouldBeSyntaxError(functionBody); - - functionBody = `new.target ${operator} foo *= 40`; - shouldBeSyntaxError(functionBody); - - - // Make sure our tests cases our sound and they should not be syntax errors if new.target is replaced by foo - functionBody = `foo ${operator} 20`; - shouldNotBeSyntaxError(functionBody); - - functionBody = `foo = foo ${operator} 20`; - shouldNotBeSyntaxError(functionBody); - - functionBody = `foo ${operator} foo ${operator} 20`; - shouldNotBeSyntaxError(functionBody); - - functionBody = `foo ${operator} foo *= 40`; - shouldNotBeSyntaxError(functionBody); -} - -let prePostFixOperators = ["++", "--"]; -for (let operator of prePostFixOperators) { - let functionBody = `${operator}new.target`; - shouldBeSyntaxError(functionBody); - - functionBody = `foo = ${operator}new.target`; - shouldBeSyntaxError(functionBody); - - functionBody = `${operator}foo`; - shouldNotBeSyntaxError(functionBody); - - functionBody = `foo = ${operator}foo`; - shouldNotBeSyntaxError(functionBody); -} - -for (let operator of prePostFixOperators) { - let functionBody = `new.target${operator}`; - shouldBeSyntaxError(functionBody); - - functionBody = `foo = new.target${operator}`; - shouldBeSyntaxError(functionBody); - - functionBody = `foo${operator}`; - shouldNotBeSyntaxError(functionBody); - - functionBody = `foo = foo${operator}`; - shouldNotBeSyntaxError(functionBody); -} - -let otherUnaryOperators = ["!", "~", "+", "-", "typeof ", "void ", "delete "]; -for (let operator of otherUnaryOperators) { - function strict(body) { return `"use strict" ${body}`; } - let functionBody = `${operator}new.target`; - shouldNotBeSyntaxError(functionBody); - shouldNotBeSyntaxError(strict(functionBody)); -} - -shouldBeSyntaxError(`({foo: new.target} = {foo:20})`); - -// Scripts - 15.1.1 Static Semantics: Early Errors -// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-early-errors -// -// Modules - 15.2.1.1 Static Semantics: Early Errors -// https://tc39.github.io/ecma262/#sec-module-semantics-static-semantics-early-errors -// -// new.target is not allowed in arrow functions in global scope. - -let sawSyntaxError; - -sawSyntaxError = false; -try { - eval(`() => new.target`); -} catch(e) { - sawSyntaxError = e instanceof SyntaxError; -} -assert(sawSyntaxError); - -sawSyntaxError = false; -try { - eval(`() => { new.target }`); -} catch(e) { - sawSyntaxError = e instanceof SyntaxError; -} -assert(sawSyntaxError); - -sawSyntaxError = false; -try { - eval(`async () => new.target`); -} catch(e) { - sawSyntaxError = e instanceof SyntaxError; -} -assert(sawSyntaxError); - -sawSyntaxError = false; -try { - eval(`async () => { new.target }`); -} catch(e) { - sawSyntaxError = e instanceof SyntaxError; -} -assert(sawSyntaxError); - -sawSyntaxError = false; -try { - eval(`async () => await new.target`); -} catch(e) { - sawSyntaxError = e instanceof SyntaxError; -} -assert(sawSyntaxError); - -sawSyntaxError = false; -try { - eval(`async () => { await new.target }`); -} catch(e) { - sawSyntaxError = e instanceof SyntaxError; -} -assert(sawSyntaxError); - -let sawError = false; -try { - new Function(`() => new.target`); - new Function(`() => { new.target }`); - new Function(`async () => new.target`); - new Function(`async () => { new.target }`); - new Function(`async () => await new.target`); - new Function(`async () => { await new.target }`); - - function f() { () => new.target }; - function f() { () => { new.target } }; - function f() { async () => new.target }; - function f() { async () => { new.target } }; - function f() { async () => await new.target }; - function f() { async () => { await new.target } }; - - (function() { eval(`() => new.target`) })(); - (function() { eval(`() => { new.target }`) })(); - (function() { eval(`async () => new.target`) })(); - (function() { eval(`async () => { new.target }`) })(); - (function() { eval(`async () => await new.target`) })(); - (function() { eval(`async () => { await new.target }`) })(); -} catch (e) { - sawError = true; -} -assert(!sawError); diff --git a/implementation-contributed/javascriptcore/stress/new-target.js b/implementation-contributed/javascriptcore/stress/new-target.js deleted file mode 100644 index c3dc7ee7f8..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-target.js +++ /dev/null @@ -1,201 +0,0 @@ -var passed = true; -try { - eval("new.target;"); - passed = false; -} catch(e) {} - -test(passed, true, "new.target cannot be called in global scope"); - -passed = true; -try { - eval("eval(\"eval('new.target;')\")"); - passed = false; -} catch(e) { - passed = e instanceof SyntaxError; -} - -test(passed, true, "new.target cannot be called in global scope"); - - -// Test without class syntax - -function test(result, expected, message) { - if (result !== expected && !(expected !== expected && result !== result)) - throw "Error: " + message + ". was: " + result + " wanted: " + expected; -} - -function call() { - test(new.target, undefined, "new.target should be undefined in a function call"); -} -call(); - -function Constructor() { - test(new.target, Constructor, "new.target should be the same as constructor"); - function subCall() { - test(new.target, undefined, "new.target should be undefined in a sub function call"); - } - subCall(); - - function SubConstructor() { - test(new.target, SubConstructor, "new.target should be subConstructor"); - } - new SubConstructor(); - -} -new Constructor(); - -// This is mostly to test that calling new on new.target deos the right thing. -function doWeirdThings(arg) { - if (new.target) { - if (arg) - this.value = new.target(1); - else - this.value = new new.target(true); - } else - return arg; -} - -test(new doWeirdThings(false).value.value, 1, "calling new on new.target did something weird"); - -// Test with class syntax - -class SuperClass { - constructor() { - this.target = new.target; - } -} - -class SubClass extends SuperClass { - constructor() { - super(); - } -} - -test(new SuperClass().target, SuperClass, "new.target should be the same as the class constructor"); -test(new SubClass().target, SubClass, "new.target should not change when passed through super()"); - -class A {} - -class B extends A { - constructor() { - super(); - this.target = eval('new.target'); - } -} - -class C extends A { - constructor() { - super(); - this.target = eval("eval('new.target')"); - } -} - -class D extends A { - constructor() { - super(); - this.target = eval("eval('(function () { return new.target; })()')"); - } -} - -test(new B().target, B, "new.target should be the same in eval as without eval"); -test(new C().target, C, "new.target should be the same in double eval as without eval"); -test(new D().target, undefined, "new.target should be the same in double eval as without eval"); - -var newTargetInEval = function () { - var result; - var klass = function () { - result = eval('new.target'); - }; - klass(); - test(result, undefined, "new.target should be the same in eval as without eval"); - new klass(); - test(result, klass, "new.target should be the same in eval as without eval"); -} -newTargetInEval(); - -var newTargetInFunctionInEval = function () { - var result; - var klass = function () { - result = eval('(function () { return new.target;})()'); - }; - klass(); - test(result, undefined, "new.target should be the same in eval as without eval"); - new klass(); - test(result, undefined, "new.target should be the same in eval as without eval"); - -}; -newTargetInFunctionInEval(); - -function testUnaryOps() { - var result; - function call(f) { f(); return result; } - function construct(f) { new f(); return result; } - - function unaryExclamation() { result = !new.target; } - test(construct(unaryExclamation), false, "`!new.target` should be false when new.target is not undefined"); - test(call(unaryExclamation), true, "`!new.target` should be true when new.target is undefined"); - - function unaryBitwiseNot() { result = ~new.target; } - test(construct(unaryBitwiseNot), -1, "`~new.target` should be -1"); - test(call(unaryBitwiseNot), -1, "`~new.target` should be -1"); - - function unaryTypeof() { result = typeof new.target; } - test(construct(unaryTypeof), "function", "`typeof new.target` should be 'function' when new.target is not undefined"); - test(call(unaryTypeof), "undefined", "`typeof new.target` should be 'undefined' when new.target is undefined"); - - function unaryVoid() { result = void new.target; } - test(construct(unaryVoid), undefined, "`void new.target` should be undefined"); - test(call(unaryVoid), undefined, "`void new.target` should be undefined"); - - function unaryAbs() { result = +new.target; } - test(construct(unaryAbs), NaN, "+new.target should be NaN"); - test(call(unaryAbs), NaN, "+new.target should be NaN"); - - function unaryNeg() { result = -new.target; } - test(construct(unaryNeg), NaN, "-new.target should be NaN"); - test(call(unaryNeg), NaN, "-new.target should be NaN"); - - // Multiple variations of delete are tested for completeness: - function unaryDelete() { result = delete new.target; } - function strictUnaryDelete() { "use strict"; result = delete new.target; } - - // If Type(ref) is not Reference, return true. (per #sec-delete-operator-runtime-semantics-evaluation) - test(construct(unaryDelete), true, "`delete new.target` should be true"); - test(call(unaryDelete), true, "`delete new.target` should be true"); - test(construct(strictUnaryDelete), true, "`delete new.target` should be true"); - test(call(strictUnaryDelete), true, "`delete new.target` should be true"); - - var unaryDeleteProp = function unaryDeleteProp() { result = delete new.target.prop; } - var strictUnaryDeleteProp = function strictUnaryDeleteProp() { "use strict"; result = delete new.target.prop; } - unaryDeleteProp.prop = 1; - test(construct(unaryDeleteProp), true, "`delete new.target.prop` should be true when new.target is not undefined and prop is a configurable property"); - strictUnaryDeleteProp.prop = 1; - test(construct(strictUnaryDeleteProp), true, "`delete new.target.prop` should be true when new.target is not undefined and prop is a configurable property"); - - unaryDeleteProp = function unaryDeleteProp() { result = delete new.target.prop; } - Object.defineProperty(unaryDeleteProp, "prop", { value: false, configurable: false }); - test(construct(unaryDeleteProp), false, "`delete new.target.prop` should be false when new.target is not undefined and prop is a non-configurable property"); - - strictUnaryDeleteProp = function strictUnaryDeleteProp() { "use strict"; result = delete new.target.prop; } - // If deleteStatus is false and IsStrictReference(ref) is true, throw a TypeError exception. - Object.defineProperty(strictUnaryDeleteProp, "prop", { value: false, configurable: false }); - try { - var passed = false; - construct(strictUnaryDeleteProp); - } catch (e) { - passed = e instanceof TypeError && e.message.indexOf("delete") >= 0; - } - test(passed, true, "`delete new.target.prop` should throw a TypeError in strict code when prop is a non-configurable property"); - - unaryDeleteProp = function unaryDeleteProp() { result = delete new.target.prop; } - unaryDeleteProp.prop = 1; - try { - var passed = false; - call(unaryDeleteProp); - } catch (e) { - passed = e instanceof TypeError && e.message.indexOf("undefined") >= 0; - } - test(passed, true, "`delete new.target.prop` should throw a TypeError when new.target is undefined"); -} -testUnaryOps(); - diff --git a/implementation-contributed/javascriptcore/stress/new-typed-array-cse-effects.js b/implementation-contributed/javascriptcore/stress/new-typed-array-cse-effects.js deleted file mode 100644 index 1f1914be67..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-typed-array-cse-effects.js +++ /dev/null @@ -1,28 +0,0 @@ -function foo(o, v) -{ - var x = o.f; - new Int8Array(v); - return x + o.f; -} - -noInline(foo); - -// Break some watchpoints. -var o = {f:42}; -o.f = 43; - -for (var i = 0; i < 10000; ++i) { - var result = foo({f:42}, [1, 2, 3]); - if (result != 84) - throw "Error: bad result: " + result; -} - -var globalO = {f:42}; -var weirdValue = {}; -weirdValue.__defineGetter__("length", function() { - globalO.f = 43; - return 11; -}); -var result = foo(globalO, weirdValue); -if (result != 85) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/new-undecided-array-with-size.js b/implementation-contributed/javascriptcore/stress/new-undecided-array-with-size.js deleted file mode 100644 index b142c7e211..0000000000 --- a/implementation-contributed/javascriptcore/stress/new-undecided-array-with-size.js +++ /dev/null @@ -1,22 +0,0 @@ -function foo(x) { - return new Array(x); -} - -noInline(foo); - -function test(size) { - var result = foo(size); - if (result.length != size) - throw "Error: bad result: " + result; - var sawThings = false; - for (var s in result) - sawThings = true; - if (sawThings) - throw "Error: array is in bad state: " + result; -} - -for (var i = 0; i < 100000; ++i) { - test(0); - test(1); - test(42); -} diff --git a/implementation-contributed/javascriptcore/stress/no-abc-skippy-loop.js b/implementation-contributed/javascriptcore/stress/no-abc-skippy-loop.js deleted file mode 100644 index 67d867ed80..0000000000 --- a/implementation-contributed/javascriptcore/stress/no-abc-skippy-loop.js +++ /dev/null @@ -1,24 +0,0 @@ -function foo(array) { - var result = 0; - for (var i = 0; i != array.length; i += 2) { - var element = array[i]; - if (element === void 0) - break; - result += array[i]; - } - return result; -} - -noInline(foo); - -var array = [1, 2, 3, 4]; -for (var i = 0; i < 10000; ++i) { - var result = foo(array); - if (result != 4) - throw "Error: bad result in loop: " + result; -} - -var array = [1, 2, 3]; -var result = foo(array); -if (result != 4) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/no-abc-skippy-paired-loop.js b/implementation-contributed/javascriptcore/stress/no-abc-skippy-paired-loop.js deleted file mode 100644 index 8bf8dd94df..0000000000 --- a/implementation-contributed/javascriptcore/stress/no-abc-skippy-paired-loop.js +++ /dev/null @@ -1,20 +0,0 @@ -function foo(array) { - var result = 0; - for (var i = 0; i < array.length; i += 2) - result += array[i] + array[i + 1]; - return result; -} - -noInline(foo); - -var array = [1, 2, 3, 4]; -for (var i = 0; i < 10000; ++i) { - var result = foo(array); - if (result != 10) - throw "Error: bad result in loop: " + result; -} - -var array = [1, 2, 3]; -var result = foo(array); -if ("" + result != "NaN") - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/non-constructors.js b/implementation-contributed/javascriptcore/stress/non-constructors.js deleted file mode 100644 index 32de719914..0000000000 --- a/implementation-contributed/javascriptcore/stress/non-constructors.js +++ /dev/null @@ -1,116 +0,0 @@ -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -class ClassTest { - constructor() { - } - - method() { - } - - get getter() { - return 20; - } - - set setter(name) { - } - - static method() { - } - - static get getter() { - return 20; - } - - static set setter(name) { - return 20; - } -}; - -// Should not throw ('constructor' is a function). -var test = new ClassTest(); -var test2 = new test.constructor(); - -shouldThrow(() => { - new test.method(); -}, `TypeError: function is not a constructor (evaluating 'new test.method()')`); - -shouldThrow(() => { - var descriptor = Object.getOwnPropertyDescriptor(test.__proto__, 'getter'); - new descriptor.get(); -}, `TypeError: function is not a constructor (evaluating 'new descriptor.get()')`); - -shouldThrow(() => { - var descriptor = Object.getOwnPropertyDescriptor(test.__proto__, 'setter'); - new descriptor.set(); -}, `TypeError: function is not a constructor (evaluating 'new descriptor.set()')`); - -shouldThrow(() => { - new ClassTest.method(); -}, `TypeError: function is not a constructor (evaluating 'new ClassTest.method()')`); - -shouldThrow(() => { - var descriptor = Object.getOwnPropertyDescriptor(ClassTest, 'getter'); - new descriptor.get(); -}, `TypeError: function is not a constructor (evaluating 'new descriptor.get()')`); - -shouldThrow(() => { - var descriptor = Object.getOwnPropertyDescriptor(ClassTest, 'setter'); - new descriptor.set(); -}, `TypeError: function is not a constructor (evaluating 'new descriptor.set()')`); - - -var test = { - method() { - }, - - get getter() { - return 20; - }, - - set setter(name) { - }, - - normal: function () { - }, - - constructor() { - } -}; - -shouldThrow(() => { - new test.method(); -}, `TypeError: function is not a constructor (evaluating 'new test.method()')`); - -shouldThrow(() => { - new test.constructor(); -}, `TypeError: function is not a constructor (evaluating 'new test.constructor()')`); - -shouldThrow(() => { - var descriptor = Object.getOwnPropertyDescriptor(test, 'getter'); - new descriptor.get(); -}, `TypeError: function is not a constructor (evaluating 'new descriptor.get()')`); - -shouldThrow(() => { - var descriptor = Object.getOwnPropertyDescriptor(test, 'setter'); - new descriptor.set(); -}, `TypeError: function is not a constructor (evaluating 'new descriptor.set()')`); - -new test.normal(); - -shouldThrow(() => { - var arrow = () => { }; - new arrow(); -}, `TypeError: function is not a constructor (evaluating 'new arrow()')`); diff --git a/implementation-contributed/javascriptcore/stress/normalize-map-key-constant-folding.js b/implementation-contributed/javascriptcore/stress/normalize-map-key-constant-folding.js deleted file mode 100644 index e30437abba..0000000000 --- a/implementation-contributed/javascriptcore/stress/normalize-map-key-constant-folding.js +++ /dev/null @@ -1,13 +0,0 @@ -function test(i) -{ - var map = new Map(); - var key = "Hello"; - if (i & 0x1) - key = 42; - map.set(key, 42); - return map; -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) - test(i); diff --git a/implementation-contributed/javascriptcore/stress/not-cell-use.js b/implementation-contributed/javascriptcore/stress/not-cell-use.js deleted file mode 100644 index c4a2bdb6bb..0000000000 --- a/implementation-contributed/javascriptcore/stress/not-cell-use.js +++ /dev/null @@ -1,29 +0,0 @@ -function foo(a, b, c) { - return (a|0) + (b|0) + (c|0); -} - -function bar(o) { - var a = o.f; - var b = o.g; - var c = o.h; - var d = o.i; - var e = o.j; - var f = o.k; - var g = o.l; - return foo(42, void 0, void 0) + a + b + c + d + e + f + g; -} - -noInline(foo); -noInline(bar); - -for (var i = 0; i < 100000; ++i) { - var result = bar({ - f:i * 3, g:i - 1, h:(i / 2)|0, i:-i, j:13 + ((i / 5)|0), k:14 - ((i / 6)|0), - l:1 - i}); - - var expected = 42 + i * 3 + i - 1 + ((i / 2)|0) - i + 13 + ((i / 5)|0) + 14 - - ((i / 6)|0) + 1 - i; - - if (result != expected) - throw "Error: for iteration " + i + " expected " + expected + " but got " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/number-is-finite.js b/implementation-contributed/javascriptcore/stress/number-is-finite.js deleted file mode 100644 index 887efb97a1..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-is-finite.js +++ /dev/null @@ -1,37 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${actual}`); -} - -function test1(i) -{ - shouldBe(Number.isFinite(i), true); -} -noInline(test1); - -for (var i = -1e4; i < 1e4; ++i) - test1(i); - -function test2(i) -{ - shouldBe(Number.isFinite(Infinity), false); - shouldBe(Number.isFinite(-Infinity), false); - shouldBe(Number.isFinite(NaN), false); -} -noInline(test2); - -// Emit DoubleRep. -for (var i = 0; i < 100; ++i) - test2(i); - - -function test3(i) -{ - shouldBe(Number.isFinite("0"), false); - shouldBe(Number.isFinite("Hello"), false); -} -noInline(test3); - -// Emit IsNumber. -for (var i = 0; i < 100; ++i) - test3(i); diff --git a/implementation-contributed/javascriptcore/stress/number-is-integer-intrinsic.js b/implementation-contributed/javascriptcore/stress/number-is-integer-intrinsic.js deleted file mode 100644 index 788d6b228d..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-is-integer-intrinsic.js +++ /dev/null @@ -1,72 +0,0 @@ -function assert(b) { - if (!b) - throw new Error; -} - -function onlyDouble(x) { - return Number.isInteger(x); -} -noInline(onlyDouble); - -let interestingValues = [ - [Infinity, false], - [-Infinity, false], - [NaN, false], - [0.0, true], - [-0.0, true], - [90071992547490009021129120, true], - [9007199254749001000, true], - [Number.MAX_SAFE_INTEGER, true], - [Number.MIN_SAFE_INTEGER, true], - [0.5, false], - [Math.PI, false], - [42, true], - [0, true], - [-10, true], - [2147483647, true], - [-2147483648, true], - [Number.MIN_VALUE, false], - [Number.MAX_VALUE, true], - [-Number.MAX_VALUE, true], -]; - -for (let i = 0; i < 10000; ++i) { - for (let [value, result] of interestingValues) { - assert(onlyDouble(value) === result); - } -} - -interestingValues.push( - [true, false], - [false, false], - [undefined, false], - [null, false], - [{}, false], - [{valueOf() { throw new Error("Should not be called"); }}, false], - [function(){}, false], -); - -function generic(x) { - return Number.isInteger(x); -} -noInline(generic); - -for (let i = 0; i < 10000; ++i) { - for (let [value, result] of interestingValues) { - assert(generic(value) === result); - } -} - -function onlyInts(x) { - return Number.isInteger(x); -} -noInline(onlyInts); - -for (let i = 0; i < 10000; ++i) { - assert(onlyInts(i) === true); -} -for (let i = 0; i < 10000; ++i) { - for (let [value, result] of interestingValues) { - assert(onlyInts(value) === result); - } -} diff --git a/implementation-contributed/javascriptcore/stress/number-is-nan.js b/implementation-contributed/javascriptcore/stress/number-is-nan.js deleted file mode 100644 index de4812ef69..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-is-nan.js +++ /dev/null @@ -1,38 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${actual}`); -} - -function test1(i) -{ - shouldBe(Number.isNaN(i), false); -} -noInline(test1); - -for (var i = -1e4; i < 1e4; ++i) - test1(i); - -function test2(i) -{ - shouldBe(Number.isNaN(Infinity), false); - shouldBe(Number.isNaN(-Infinity), false); - shouldBe(Number.isNaN(NaN), true); -} -noInline(test2); - -// Emit DoubleRep. -for (var i = 0; i < 100; ++i) - test2(i); - - -function test3(i) -{ - shouldBe(Number.isNaN("0"), false); - shouldBe(Number.isNaN("Hello"), false); - shouldBe(Number.isNaN("NaN"), false); -} -noInline(test3); - -// Emit IsNumber. -for (var i = 0; i < 100; ++i) - test3(i); diff --git a/implementation-contributed/javascriptcore/stress/number-prototype-to-string-cast-overflow.js b/implementation-contributed/javascriptcore/stress/number-prototype-to-string-cast-overflow.js deleted file mode 100644 index f12ab051a1..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-prototype-to-string-cast-overflow.js +++ /dev/null @@ -1,18 +0,0 @@ -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function assertThrowRangeError(input) { - try { - let number = 3; - number.toString(input); - assert(false); - } catch (e) { - assert(e instanceof RangeError); - } -} - -assertThrowRangeError(1e100); -assertThrowRangeError(-1e101); - diff --git a/implementation-contributed/javascriptcore/stress/number-prototype-to-string-exception.js b/implementation-contributed/javascriptcore/stress/number-prototype-to-string-exception.js deleted file mode 100644 index 74459075de..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-prototype-to-string-exception.js +++ /dev/null @@ -1,20 +0,0 @@ -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -let o = { - valueOf: () => { - throw new Error("Bad"); - return 2; - } -} - -let a = 2; -try { - a.toString(o); - assert(false); -} catch (e) { - assert(e.message == "Bad"); -} - diff --git a/implementation-contributed/javascriptcore/stress/number-prototype-to-string-wrong-values.js b/implementation-contributed/javascriptcore/stress/number-prototype-to-string-wrong-values.js deleted file mode 100644 index 52e6e111c0..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-prototype-to-string-wrong-values.js +++ /dev/null @@ -1,29 +0,0 @@ -function assert(a) { - if (!a) - throw new Error("Bad assertion"); -} - -function assertRangeError(v) { - let a = 2; - try { - a.toString(v); - assert(false); - } catch (e) { - assert(e instanceof RangeError); - } -} - -assertRangeError(1); -assertRangeError(37); -assertRangeError(37.1); -assertRangeError(37.2); -assertRangeError(0); -assertRangeError(-1); -assertRangeError(1.999999); -assertRangeError(37.00000000000000001); -assertRangeError(NaN); -assertRangeError(null); -assertRangeError(+Infinity); -assertRangeError(-Infinity); -assertRangeError(-0); - diff --git a/implementation-contributed/javascriptcore/stress/number-to-locale-string-should-accept-strange-number-objects.js b/implementation-contributed/javascriptcore/stress/number-to-locale-string-should-accept-strange-number-objects.js deleted file mode 100644 index aa99cc4bb0..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-to-locale-string-should-accept-strange-number-objects.js +++ /dev/null @@ -1,11 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -var otherRealm = createGlobalObject(); -shouldBe(otherRealm.Number.prototype.toLocaleString.call(new Number(42)), `42`) - -var numberObject = new Number(42); -numberObject.__proto__ = null; -shouldBe(Number.prototype.toLocaleString.call(numberObject), `42`) diff --git a/implementation-contributed/javascriptcore/stress/number-to-string-abstract-operation.js b/implementation-contributed/javascriptcore/stress/number-to-string-abstract-operation.js deleted file mode 100644 index e1a9d5d4e8..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-to-string-abstract-operation.js +++ /dev/null @@ -1,80 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error(`bad value: expected:(${expected}),actual:(${actual})`); -} - -function expected(num, radix) -{ - let characters = "0123456789abcdefghijklmnopqrstuvwxyz"; - let result = ""; - let negative = false; - if (num < 0) { - negative = true; - num = -num; - } - - do { - const index = num % radix; - result = characters[index] + result; - num = (num - index) / radix; - } while (num); - - if (negative) - return '-' + result; - return result; -} - -{ - function int32ToString(num) - { - return `${num}`; - } - noInline(int32ToString); - - for (var i = 0; i < 1e3; ++i) { - shouldBe(int32ToString(i), expected(i, 10)); - shouldBe(int32ToString(-i), expected(-i, 10)); - } - - shouldBe(int32ToString(0xffffffffff), expected(0xffffffffff, 10)); - shouldBe(int32ToString(0.1), `0.1`); - shouldBe(int32ToString(-0.1), `-0.1`); - shouldBe(int32ToString(new Number(0xff)), `255`); -} - -{ - function int52ToString(num) - { - return `${fiatInt52(num)}`; - } - noInline(int52ToString); - - for (var i = 0; i < 1e3; ++i) { - shouldBe(int52ToString(0xffffffff + i), expected(0xffffffff + i, 10)); - shouldBe(int52ToString(-(0xffffffff + i)), expected(-(0xffffffff + i), 10)); - } - - shouldBe(int52ToString(0xff), `255`); - shouldBe(int52ToString(0.1), `0.1`); - shouldBe(int52ToString(-0.1), `-0.1`); - shouldBe(int52ToString(new Number(0xff)), `255`); -} - -{ - function doubleToString(num) - { - return `${num}`; - } - noInline(doubleToString); - - for (var i = 0; i < 1e3; ++i) { - shouldBe(doubleToString(1.01), `1.01`); - shouldBe(doubleToString(-1.01), `-1.01`); - } - - shouldBe(doubleToString(0xff), `255`); - shouldBe(doubleToString(0.1), `0.1`); - shouldBe(doubleToString(-0.1), `-0.1`); - shouldBe(doubleToString(new Number(0xff)), `255`); -} diff --git a/implementation-contributed/javascriptcore/stress/number-to-string-radix.js b/implementation-contributed/javascriptcore/stress/number-to-string-radix.js deleted file mode 100644 index 6dd3a841a1..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-to-string-radix.js +++ /dev/null @@ -1,80 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error(`bad value: expected:(${expected}),actual:(${actual})`); -} - -function expected(num, radix) -{ - let characters = "0123456789abcdefghijklmnopqrstuvwxyz"; - let result = ""; - let negative = false; - if (num < 0) { - negative = true; - num = -num; - } - - do { - const index = num % radix; - result = characters[index] + result; - num = (num - index) / radix; - } while (num); - - if (negative) - return '-' + result; - return result; -} - -{ - function int32ToString(num, radix) - { - return num.toString(radix); - } - noInline(int32ToString); - - for (var i = 0; i < 1e3; ++i) { - shouldBe(int32ToString(i, 16), expected(i, 16)); - shouldBe(int32ToString(-i, 16), expected(-i, 16)); - } - - shouldBe(int32ToString(0xffffffffff, 16), expected(0xffffffffff, 16)); - shouldBe(int32ToString(0.1, 16), `0.1999999999999a`); - shouldBe(int32ToString(-0.1, 16), `-0.1999999999999a`); - shouldBe(int32ToString(new Number(0xff), 16), `ff`); -} - -{ - function int52ToString(num, radix) - { - return fiatInt52(num).toString(radix); - } - noInline(int52ToString); - - for (var i = 0; i < 1e3; ++i) { - shouldBe(int52ToString(0xffffffff + i, 16), expected(0xffffffff + i, 16)); - shouldBe(int52ToString(-(0xffffffff + i), 16), expected(-(0xffffffff + i), 16)); - } - - shouldBe(int52ToString(0xff, 16), `ff`); - shouldBe(int52ToString(0.1, 16), `0.1999999999999a`); - shouldBe(int52ToString(-0.1, 16), `-0.1999999999999a`); - shouldBe(int52ToString(new Number(0xff), 16), `ff`); -} - -{ - function doubleToString(num, radix) - { - return num.toString(radix); - } - noInline(doubleToString); - - for (var i = 0; i < 1e3; ++i) { - shouldBe(doubleToString(1.01, 16), `1.028f5c28f5c29`); - shouldBe(doubleToString(-1.01, 16), `-1.028f5c28f5c29`); - } - - shouldBe(doubleToString(0xff, 16), `ff`); - shouldBe(doubleToString(0.1, 16), `0.1999999999999a`); - shouldBe(doubleToString(-0.1, 16), `-0.1999999999999a`); - shouldBe(doubleToString(new Number(0xff), 16), `ff`); -} diff --git a/implementation-contributed/javascriptcore/stress/number-to-string-strength-reduction.js b/implementation-contributed/javascriptcore/stress/number-to-string-strength-reduction.js deleted file mode 100644 index 6f0993f31c..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-to-string-strength-reduction.js +++ /dev/null @@ -1,14 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var target = 42; - return target.toString(16); -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) - shouldBe(test(), `2a`); diff --git a/implementation-contributed/javascriptcore/stress/number-to-string-with-add.js b/implementation-contributed/javascriptcore/stress/number-to-string-with-add.js deleted file mode 100644 index 2722864cc5..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-to-string-with-add.js +++ /dev/null @@ -1,40 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error(`bad value: expected:(${expected}),actual:(${actual})`); -} - -function toStringLeft(num) -{ - return num + 'Cocoa'; -} -noInline(toStringLeft); - -function toStringRight(num) -{ - return 'Cocoa' + num; -} -noInline(toStringRight); - -function toStringLeftEmpty(num) -{ - return num + ''; -} -noInline(toStringLeftEmpty); - -function toStringRightEmpty(num) -{ - return '' + num; -} -noInline(toStringRightEmpty); - -for (var i = 0; i < 1e4; ++i) { - shouldBe(toStringLeft(2), `2Cocoa`); - shouldBe(toStringRight(2), `Cocoa2`); - shouldBe(toStringLeftEmpty(2), `2`); - shouldBe(toStringRightEmpty(2), `2`); - shouldBe(toStringLeft(42), `42Cocoa`); - shouldBe(toStringRight(42), `Cocoa42`); - shouldBe(toStringLeftEmpty(42), `42`); - shouldBe(toStringRightEmpty(42), `42`); -} diff --git a/implementation-contributed/javascriptcore/stress/number-to-string-with-radix-10.js b/implementation-contributed/javascriptcore/stress/number-to-string-with-radix-10.js deleted file mode 100644 index bf8f6a0d0d..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-to-string-with-radix-10.js +++ /dev/null @@ -1,15 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} -noInline(shouldBe); - -function test() -{ - for (var i = 0; i < 10; ++i) - shouldBe(i.toString(10), "" + i); -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) - test(); diff --git a/implementation-contributed/javascriptcore/stress/number-to-string-with-radix-cse.js b/implementation-contributed/javascriptcore/stress/number-to-string-with-radix-cse.js deleted file mode 100644 index db78216d58..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-to-string-with-radix-cse.js +++ /dev/null @@ -1,21 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var result; - for (var i = 0; i < 1e2; ++i) { - i.toString(16); - i.toString(16); - i.toString(16); - i.toString(16); - result = i.toString(16); - } - return result; -} -noInline(test); - -for (var i = 0; i < 1e3; ++i) - shouldBe(test(), `63`); diff --git a/implementation-contributed/javascriptcore/stress/number-to-string-with-radix-invalid.js b/implementation-contributed/javascriptcore/stress/number-to-string-with-radix-invalid.js deleted file mode 100644 index 069096514f..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-to-string-with-radix-invalid.js +++ /dev/null @@ -1,24 +0,0 @@ -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -function test(i, radix) -{ - return i.toString(radix); -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) { - shouldThrow(() => test(i, 42), `RangeError: toString() radix argument must be between 2 and 36`); -} diff --git a/implementation-contributed/javascriptcore/stress/number-to-string-with-radix-watchpoint.js b/implementation-contributed/javascriptcore/stress/number-to-string-with-radix-watchpoint.js deleted file mode 100644 index 7968f58a1a..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-to-string-with-radix-watchpoint.js +++ /dev/null @@ -1,27 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - for (var i = 0; i < 10; ++i) { - var result = ''; - result += i.toString(2); - result += i.toString(4); - result += i.toString(8); - result += i.toString(16); - result += i.toString(32); - } - return result; -} -noInline(test); - -var result = `1001211199`; -for (var i = 0; i < 1e4; ++i) { - if (i === 1e3) { - Number.prototype.toString = function (radix) { return "Hello"; } - result = `HelloHelloHelloHelloHello`; - } - shouldBe(test(), result); -} diff --git a/implementation-contributed/javascriptcore/stress/number-to-string-with-radix.js b/implementation-contributed/javascriptcore/stress/number-to-string-with-radix.js deleted file mode 100644 index e51a976000..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-to-string-with-radix.js +++ /dev/null @@ -1,21 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - for (var i = 0; i < 10; ++i) { - var result = ''; - result += i.toString(2); - result += i.toString(4); - result += i.toString(8); - result += i.toString(16); - result += i.toString(32); - } - return result; -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) - shouldBe(test(), `1001211199`); diff --git a/implementation-contributed/javascriptcore/stress/number-to-string.js b/implementation-contributed/javascriptcore/stress/number-to-string.js deleted file mode 100644 index ae0c2fa2ff..0000000000 --- a/implementation-contributed/javascriptcore/stress/number-to-string.js +++ /dev/null @@ -1,80 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error(`bad value: expected:(${expected}),actual:(${actual})`); -} - -function expected(num, radix) -{ - let characters = "0123456789abcdefghijklmnopqrstuvwxyz"; - let result = ""; - let negative = false; - if (num < 0) { - negative = true; - num = -num; - } - - do { - const index = num % radix; - result = characters[index] + result; - num = (num - index) / radix; - } while (num); - - if (negative) - return '-' + result; - return result; -} - -{ - function int32ToString(num) - { - return num.toString(16); - } - noInline(int32ToString); - - for (var i = 0; i < 1e3; ++i) { - shouldBe(int32ToString(i), expected(i, 16)); - shouldBe(int32ToString(-i), expected(-i, 16)); - } - - shouldBe(int32ToString(0xffffffffff), expected(0xffffffffff, 16)); - shouldBe(int32ToString(0.1), `0.1999999999999a`); - shouldBe(int32ToString(-0.1), `-0.1999999999999a`); - shouldBe(int32ToString(new Number(0xff)), `ff`); -} - -{ - function int52ToString(num) - { - return fiatInt52(num).toString(16); - } - noInline(int52ToString); - - for (var i = 0; i < 1e3; ++i) { - shouldBe(int52ToString(0xffffffff + i), expected(0xffffffff + i, 16)); - shouldBe(int52ToString(-(0xffffffff + i)), expected(-(0xffffffff + i), 16)); - } - - shouldBe(int52ToString(0xff), `ff`); - shouldBe(int52ToString(0.1), `0.1999999999999a`); - shouldBe(int52ToString(-0.1), `-0.1999999999999a`); - shouldBe(int52ToString(new Number(0xff)), `ff`); -} - -{ - function doubleToString(num) - { - return num.toString(16); - } - noInline(doubleToString); - - for (var i = 0; i < 1e3; ++i) { - shouldBe(doubleToString(1.01), `1.028f5c28f5c29`); - shouldBe(doubleToString(-1.01), `-1.028f5c28f5c29`); - } - - shouldBe(doubleToString(0xff), `ff`); - shouldBe(doubleToString(0.1), `0.1999999999999a`); - shouldBe(doubleToString(-0.1), `-0.1999999999999a`); - shouldBe(doubleToString(new Number(0xff)), `ff`); -} diff --git a/implementation-contributed/javascriptcore/stress/numeric-setter-on-prototype-non-blank-array.js b/implementation-contributed/javascriptcore/stress/numeric-setter-on-prototype-non-blank-array.js deleted file mode 100644 index eb44ed7b56..0000000000 --- a/implementation-contributed/javascriptcore/stress/numeric-setter-on-prototype-non-blank-array.js +++ /dev/null @@ -1,36 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -class Trace { - constructor() - { - this.__count = 0; - } - - trace() - { - this.__count++; - } - - get count() - { - return this.__count; - } -} - -for (var i = 0; i < 10000; ++i) { - var t3 = new Trace(); - - var object = { 2: 2, 4: 4 }; - shouldBe(t3.count, 0); - var a = {__proto__: object }; - shouldBe(t3.count, 0); - Object.defineProperty(object, 3, { - set: function (x) { t3.trace() } - }); - a[3] = 7; - shouldBe(t3.count, 1); -} diff --git a/implementation-contributed/javascriptcore/stress/numeric-setter-on-prototype.js b/implementation-contributed/javascriptcore/stress/numeric-setter-on-prototype.js deleted file mode 100644 index 17e0b3c9fe..0000000000 --- a/implementation-contributed/javascriptcore/stress/numeric-setter-on-prototype.js +++ /dev/null @@ -1,32 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -class Trace { - constructor() - { - this.__count = 0; - } - - trace() - { - this.__count++; - } - - get count() - { - return this.__count; - } -} - -for (var i = 0; i < 10000; ++i) { - var t0 = new Trace(); - - shouldBe(t0.count, 0); - var z = {__proto__: {set 3(x) { t0.trace() }}}; - shouldBe(t0.count, 0); - z[3] = 7; - shouldBe(t0.count, 1); -} diff --git a/implementation-contributed/javascriptcore/stress/numeric-setter-on-self.js b/implementation-contributed/javascriptcore/stress/numeric-setter-on-self.js deleted file mode 100644 index 5b19460f15..0000000000 --- a/implementation-contributed/javascriptcore/stress/numeric-setter-on-self.js +++ /dev/null @@ -1,32 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -class Trace { - constructor() - { - this.__count = 0; - } - - trace() - { - this.__count++; - } - - get count() - { - return this.__count; - } -} - -for (var i = 0; i < 10000; ++i) { - var t0 = new Trace(); - - shouldBe(t0.count, 0); - var y = {set 2(x) { t0.trace() }}; - shouldBe(t0.count, 0); - y[2] = 5; - shouldBe(t0.count, 1); -} diff --git a/implementation-contributed/javascriptcore/stress/obj-rest-destructuring-order.js b/implementation-contributed/javascriptcore/stress/obj-rest-destructuring-order.js deleted file mode 100644 index af26f48ea2..0000000000 --- a/implementation-contributed/javascriptcore/stress/obj-rest-destructuring-order.js +++ /dev/null @@ -1,45 +0,0 @@ -function assert(a) { - if (!a) - throw new Error('Bad assertion'); -} - -// Check rest ordering without Proxy -(function () { - var calls = []; - var o = { get z() { calls.push('z') }, get a() { calls.push('a') } }; - Object.defineProperty(o, 1, { get: () => { calls.push(1) }, enumerable: true }); - Object.defineProperty(o, Symbol('foo'), { get: () => { calls.push('Symbol(foo)') }, enumerable: true }); - - var {...r} = o; - - assert(calls[0] === 1); - assert(calls[1] === 'z'); - assert(calls[2] === 'a'); - assert(calls[3] === 'Symbol(foo)'); - assert(Object.keys(r).length === 3); -})(); - -// Check spread ordering with Proxy -(function () { - var calls = []; - var o = { z: 2, a: 3 }; - var fooSymbol = Symbol('foo'); - Object.defineProperty(o, 1, { value: 4, enumerable: true }); - Object.defineProperty(o, fooSymbol, { value: 5, enumerable: true }); - - var p = new Proxy(o, { - get: function(target, property, receiver) { - calls.push(property); - return target[property]; - } - }); - - var {...r} = p; - - assert(calls[0] == 1); - assert(calls[1] == 'z'); - assert(calls[2] == 'a'); - assert(calls[3] === fooSymbol); - assert(Object.keys(r).length === 3); -})(); - diff --git a/implementation-contributed/javascriptcore/stress/obj-spread-order.js b/implementation-contributed/javascriptcore/stress/obj-spread-order.js deleted file mode 100644 index d03930f03f..0000000000 --- a/implementation-contributed/javascriptcore/stress/obj-spread-order.js +++ /dev/null @@ -1,45 +0,0 @@ -function assert(a) { - if (!a) - throw new Error('Bad assertion'); -} - -// Check spread ordering without Proxy -(function () { - var calls = []; - var o = { get z() { calls.push('z') }, get a() { calls.push('a') } }; - Object.defineProperty(o, 1, { get: () => { calls.push(1) }, enumerable: true }); - Object.defineProperty(o, Symbol('foo'), { get: () => { calls.push('Symbol(foo)') }, enumerable: true }); - - var obj = {...o}; - - assert(calls[0] === 1); - assert(calls[1] === 'z'); - assert(calls[2] === 'a'); - assert(calls[3] === 'Symbol(foo)'); - assert(Object.keys(obj).length === 3); -})(); - -// Check spread ordering with Proxy -(function () { - var calls = []; - var o = { z: 2, a: 3 }; - var fooSymbol = Symbol('foo'); - Object.defineProperty(o, 1, { value: 4, enumerable: true }); - Object.defineProperty(o, fooSymbol, { value: 5, enumerable: true }); - - var p = new Proxy(o, { - get: function(target, property, receiver) { - calls.push(property); - return target[property]; - } - }); - - var obj = {...p}; - - assert(calls[0] == 1); - assert(calls[1] == 'z'); - assert(calls[2] == 'a'); - assert(calls[3] === fooSymbol); - assert(Object.keys(obj).length === 3); -})(); - diff --git a/implementation-contributed/javascriptcore/stress/object-add.js b/implementation-contributed/javascriptcore/stress/object-add.js deleted file mode 100644 index c486e82385..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-add.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a + b; -} - -noInline(foo); - -var things = [{valueOf: function() { return 4; }}]; -var results = [5]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 1); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/object-allocation-sinking-with-uninitialized-property-on-one-path.js b/implementation-contributed/javascriptcore/stress/object-allocation-sinking-with-uninitialized-property-on-one-path.js deleted file mode 100644 index 374b3b0ab7..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-allocation-sinking-with-uninitialized-property-on-one-path.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2015 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. ``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 - * 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. - */ - -// Regression test for https://bugs.webkit.org/show_bug.cgi?id=144020. -// This test should not crash. - -// What happened in the bug: -function foo(p) { - var b = {}; - b.a = {}; - if (p) - b.a.C = p.q; - return b.a.C; -} -noInline(foo); - -for (var i = 0; i < 10000; i++) - foo(true); - -// A reduced version: -function foo2(p) { - var o = {}; - if (p) - o.f = {}; - return o.f; -} -noInline(foo2); - -for (var i = 0; i < 10000; i++) - foo2(true); - diff --git a/implementation-contributed/javascriptcore/stress/object-assign-changing-properties.js b/implementation-contributed/javascriptcore/stress/object-assign-changing-properties.js deleted file mode 100644 index 7056918f9e..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-assign-changing-properties.js +++ /dev/null @@ -1,80 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -{ - let source = { - get x() { - delete this.y; - return 42; - }, - y: 42 - }; - let result = Object.assign({}, source); - shouldBe(result.x, 42); - shouldBe(result.hasOwnProperty('y'), false); -} - -{ - let source = { - get x() { - return 42; - }, - y: 42 - }; - var store = 0; - let target = { - set x(value) { - store = value; - delete source.y; - }, - get x() { - return store; - }, - }; - let result = Object.assign(target, source); - shouldBe(result.x, 42); - shouldBe(result.hasOwnProperty('y'), false); -} - - -{ - let source = { - get x() { - Object.defineProperty(source, 'y', { - enumerable: false - }); - return 42; - }, - y: 42 - }; - let result = Object.assign({}, source); - shouldBe(result.x, 42); - shouldBe(result.hasOwnProperty('y'), false); -} - -{ - let source = { - get x() { - return 42; - }, - y: 42 - }; - var store = 0; - let target = { - set x(value) { - store = value; - Object.defineProperty(source, 'y', { - enumerable: false - }); - }, - get x() { - return store; - }, - }; - let result = Object.assign(target, source); - shouldBe(result.x, 42); - shouldBe(result.hasOwnProperty('y'), false); -} diff --git a/implementation-contributed/javascriptcore/stress/object-assign-correctness.js b/implementation-contributed/javascriptcore/stress/object-assign-correctness.js deleted file mode 100644 index 530e3ab7cd..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-assign-correctness.js +++ /dev/null @@ -1,180 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion."); -} -function test(f) { - for (let i = 0; i < 500; i++) - f(); -} - -var originalReflect = Reflect; -var ownKeys = Reflect.ownKeys; -var getOwnPropertyDescriptor = Reflect.getOwnPropertyDescriptor; - -function runTests() { - test(function() { - let ownKeysCalled = false; - let getOwnPropertyDescriptorProps = []; - let getProps = []; - let enumerableCalled = false; - let handler = { - getOwnPropertyDescriptor: function(target, key) { - getOwnPropertyDescriptorProps.push(key); - switch(key) { - case "foo": - return { - enumerable: true, - configurable: true, - value: 45 - }; - case "bar": - return { - enumerable: true, - get enumerable() { - enumerableCalled = true; - return true; - }, - configurable: true, - value: 50 - } - case "baz": - return { - enumerable: false, - configurable: true, - value: 50 - } - default: - assert(false, "should not be reached."); - break; - } - }, - ownKeys: function(target) { - ownKeysCalled = true; - return ["foo", "bar", "baz"]; - }, - get: function(target, key) { - getProps.push(key); - switch(key) { - case "foo": - return 20; - case "bar": - return "bar"; - default: - assert(false, "should not be reached."); - break; - } - } - }; - - let proxy = new Proxy({}, handler); - let foo = {}; - Object.assign(foo, proxy); - - assert(enumerableCalled); - - assert(ownKeys(foo).length === 2); - assert(ownKeys(foo)[0] === "foo"); - assert(ownKeys(foo)[1] === "bar"); - assert(foo.foo === 20); - assert(foo.bar === "bar"); - - assert(ownKeysCalled); - assert(getOwnPropertyDescriptorProps.length === 3); - assert(getOwnPropertyDescriptorProps[0] === "foo"); - assert(getOwnPropertyDescriptorProps[1] === "bar"); - assert(getOwnPropertyDescriptorProps[2] === "baz"); - - assert(getProps.length === 2); - assert(getProps[0] === "foo"); - assert(getProps[1] === "bar"); - }); - - - let oldReflect = Reflect; - Reflect = null; - assert(Reflect === null); // Make sure Object.assign's use of Reflect is safe. - - test(function() { - let ownKeysCalled = false; - let getOwnPropertyDescriptorProps = []; - let getProps = []; - let enumerableCalled = false; - let handler = { - getOwnPropertyDescriptor: function(target, key) { - getOwnPropertyDescriptorProps.push(key); - switch(key) { - case "foo": - return { - enumerable: true, - configurable: true, - value: 45 - }; - case "bar": - return { - get enumerable() { - enumerableCalled = true; - return true; - }, - configurable: true, - value: 50 - } - case "baz": - return { - enumerable: false, - configurable: true, - value: 50 - } - default: - assert(false, "should not be reached."); - break; - } - }, - ownKeys: function(target) { - ownKeysCalled = true; - return ["foo", "bar", "baz"]; - }, - get: function(target, key) { - getProps.push(key); - switch(key) { - case "foo": - return 20; - case "bar": - return "bar"; - default: - assert(false, "should not be reached."); - break; - } - } - }; - - let proxy = new Proxy({}, handler); - let foo = {}; - Object.assign(foo, proxy); - - assert(enumerableCalled); - - assert(ownKeys(foo).length === 2); - assert(ownKeys(foo)[0] === "foo"); - assert(ownKeys(foo)[1] === "bar"); - assert(foo.foo === 20); - assert(foo.bar === "bar"); - - assert(ownKeysCalled); - assert(getOwnPropertyDescriptorProps.length === 3); - assert(getOwnPropertyDescriptorProps[0] === "foo"); - assert(getOwnPropertyDescriptorProps[1] === "bar"); - assert(getOwnPropertyDescriptorProps[2] === "baz"); - - assert(getProps.length === 2); - assert(getProps[0] === "foo"); - assert(getProps[1] === "bar"); - - }); - - Reflect = oldReflect; -} - -runTests(); -Reflect.ownKeys = function () {}; -Reflect.getOwnPropertyDescriptor = function () {}; -runTests(); diff --git a/implementation-contributed/javascriptcore/stress/object-assign-enumerable.js b/implementation-contributed/javascriptcore/stress/object-assign-enumerable.js deleted file mode 100644 index 8223a0df59..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-assign-enumerable.js +++ /dev/null @@ -1,14 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var object = Object.defineProperties({}, { - nonEnumerable: { - enumerable: false, - value: 42 - } -}); - -var result = Object.assign({}, object); -shouldBe(result.nonEnumerable, undefined); diff --git a/implementation-contributed/javascriptcore/stress/object-assign-order.js b/implementation-contributed/javascriptcore/stress/object-assign-order.js deleted file mode 100644 index 8af3ed63c1..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-assign-order.js +++ /dev/null @@ -1,40 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var symbol = Symbol('Cocoa'); - -var object = { - [symbol]: 3, - 0: 0, - hello: 2, - 1: 1, -}; - -var count = 0; - -var tester = Object.defineProperties({}, { - 0: { - set: () => { - shouldBe(count++, 0); - } - }, - 1: { - set: () => { - shouldBe(count++, 1); - } - }, - 'hello': { - set: () => { - shouldBe(count++, 2); - } - }, - [symbol]: { - set: () => { - shouldBe(count++, 3); - } - }, -}); - -Object.assign(tester, object); diff --git a/implementation-contributed/javascriptcore/stress/object-assign-proxy.js b/implementation-contributed/javascriptcore/stress/object-assign-proxy.js deleted file mode 100644 index d0b0e3b4d5..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-assign-proxy.js +++ /dev/null @@ -1,31 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -{ - var order = []; - let target = {x: 20, y:42}; - let handler = { - getOwnPropertyDescriptor(theTarget, propName) - { - order.push(`getOwnPropertyDescriptor ${propName}`); - return { - enumerable: true, - configurable: true, - value: 42 - }; - }, - get(theTarget, propName, receiver) - { - order.push(`get ${propName}`); - return 42; - } - }; - - let proxy = new Proxy(target, handler); - var result = Object.assign({}, proxy); - shouldBe(result.x, 42); - shouldBe(result.y, 42); - shouldBe(order.join(','), `getOwnPropertyDescriptor x,get x,getOwnPropertyDescriptor y,get y`); -} diff --git a/implementation-contributed/javascriptcore/stress/object-assign-string-first.js b/implementation-contributed/javascriptcore/stress/object-assign-string-first.js deleted file mode 100644 index 55c2489f22..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-assign-string-first.js +++ /dev/null @@ -1,32 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var order = []; - -var source = { - get [Symbol.iterator]() - { - order.push(`Symbol.iterator`); - return `Symbol.iterator`; - }, - - get 1() - { - order.push(`1`); - return `1`; - }, - - get cocoa() - { - order.push(`cocoa`); - return `cocoa`; - }, -}; - -var result = Object.assign({}, source); -shouldBe(result[1], `1`); -shouldBe(result.cocoa, `cocoa`); -shouldBe(result[Symbol.iterator], `Symbol.iterator`); -shouldBe(order.join(','), `1,cocoa,Symbol.iterator`); diff --git a/implementation-contributed/javascriptcore/stress/object-assign-symbols.js b/implementation-contributed/javascriptcore/stress/object-assign-symbols.js deleted file mode 100644 index d649eeaff4..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-assign-symbols.js +++ /dev/null @@ -1,38 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var a = Symbol("a"); -var b = Symbol("b"); -var c = Symbol("c"); -var d = Symbol("d"); -var e = Symbol("e"); - -var obj = { - [a]: 1, - [b]: 2, - [c]: 3, - [d]: null, - [e]: 'e' -}; - -function test(src) { - var o = {}; - var keys = Object.getOwnPropertySymbols(src); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - o[key] = src[key]; - } - return o; -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) { - var result = test(obj); - shouldBe(result[a], 1); - shouldBe(result[b], 2); - shouldBe(result[c], 3); - shouldBe(result[d], null); - shouldBe(result[e], 'e'); -} diff --git a/implementation-contributed/javascriptcore/stress/object-assign.js b/implementation-contributed/javascriptcore/stress/object-assign.js deleted file mode 100644 index d4572a2f47..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-assign.js +++ /dev/null @@ -1,26 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var obj = { - a: 1, - b: 2, - c: 3, - d: null, - e: 'e' -}; - -function test(src) { - var o = {}; - var keys = Object.keys(src); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - o[key] = src[key]; - } - return o; -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) - shouldBe(JSON.stringify(test(obj)), `{"a":1,"b":2,"c":3,"d":null,"e":"e"}`); diff --git a/implementation-contributed/javascriptcore/stress/object-bit-and.js b/implementation-contributed/javascriptcore/stress/object-bit-and.js deleted file mode 100644 index e90ade20bb..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-bit-and.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a & b; -} - -noInline(foo); - -var things = [{valueOf: function() { return 6; }}]; -var results = [2]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 10); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/object-bit-or.js b/implementation-contributed/javascriptcore/stress/object-bit-or.js deleted file mode 100644 index bfbd42e6c1..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-bit-or.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a | b; -} - -noInline(foo); - -var things = [{valueOf: function() { return 6; }}]; -var results = [14]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 10); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/object-bit-xor.js b/implementation-contributed/javascriptcore/stress/object-bit-xor.js deleted file mode 100644 index 356004dcbd..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-bit-xor.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a ^ b; -} - -noInline(foo); - -var things = [{valueOf: function() { return 6; }}]; -var results = [12]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 10); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/object-constructor-boolean-edge.js b/implementation-contributed/javascriptcore/stress/object-constructor-boolean-edge.js deleted file mode 100644 index b91e9eea01..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-constructor-boolean-edge.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(target) -{ - return Object(target); -} -noInline(test); - -(function () { - for (var i = 0; i < 1e4; ++i) { - var object = test(true); - shouldBe(object instanceof Boolean, true); - shouldBe(object.valueOf(), true); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/object-constructor-global.js b/implementation-contributed/javascriptcore/stress/object-constructor-global.js deleted file mode 100644 index 7f82352c85..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-constructor-global.js +++ /dev/null @@ -1,22 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var globalObject = createGlobalObject(); -var constructor = globalObject.Object; -var tests = [ - [ null, globalObject.Object ], - [ undefined, globalObject.Object ], - [ "Hello", globalObject.String ], - [ 42, globalObject.Number ], - [ false, globalObject.Boolean ], - [ Symbol("Cocoa"), globalObject.Symbol ], -]; - -for (var i = 0; i < 1e4; ++i) { - for (var [target, cls] of tests) { - var result = constructor(target); - shouldBe(result instanceof cls, true); - } -} diff --git a/implementation-contributed/javascriptcore/stress/object-constructor-null-edge.js b/implementation-contributed/javascriptcore/stress/object-constructor-null-edge.js deleted file mode 100644 index 9b8eaf3276..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-constructor-null-edge.js +++ /dev/null @@ -1,17 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(target) -{ - return Object(target); -} -noInline(test); - -(function () { - for (var i = 0; i < 1e4; ++i) { - var object = test(null); - shouldBe(object.__proto__, Object.prototype); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/object-constructor-number-edge.js b/implementation-contributed/javascriptcore/stress/object-constructor-number-edge.js deleted file mode 100644 index 1e35177fe0..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-constructor-number-edge.js +++ /dev/null @@ -1,22 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(target) -{ - return Object(target); -} -noInline(test); - -(function () { - for (var i = 0; i < 1e4; ++i) { - var object = test(42); - shouldBe(object instanceof Number, true); - shouldBe(object.valueOf(), 42); - - var object = test(42.195); - shouldBe(object instanceof Number, true); - shouldBe(object.valueOf(), 42.195); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/object-constructor-object-edge.js b/implementation-contributed/javascriptcore/stress/object-constructor-object-edge.js deleted file mode 100644 index 186964ad20..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-constructor-object-edge.js +++ /dev/null @@ -1,26 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(target) -{ - return Object(target); -} -noInline(test); - -(function () { - for (var i = 0; i < 1e4; ++i) { - var arg = {}; - var object = test(arg); - shouldBe(object, arg); - - var arg = []; - var object = test(arg); - shouldBe(object, arg); - - var arg = function () { }; - var object = test(arg); - shouldBe(object, arg); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/object-constructor-should-be-new-target-aware.js b/implementation-contributed/javascriptcore/stress/object-constructor-should-be-new-target-aware.js deleted file mode 100644 index 7ce93853a7..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-constructor-should-be-new-target-aware.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -class Hello extends Object { - constructor() - { - super(); - } -} - -var hello = new Hello(); -shouldBe(hello.__proto__, Hello.prototype); - -shouldBe(Reflect.construct(Object, [], Hello).__proto__, Hello.prototype); - -gc(); // Regression test for https:/webkit.org/b/160666. diff --git a/implementation-contributed/javascriptcore/stress/object-constructor-string-edge.js b/implementation-contributed/javascriptcore/stress/object-constructor-string-edge.js deleted file mode 100644 index 13f564181b..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-constructor-string-edge.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(target) -{ - return Object(target); -} -noInline(test); - -(function () { - for (var i = 0; i < 1e4; ++i) { - var object = test("Cocoa"); - shouldBe(object instanceof String, true); - shouldBe(object.valueOf(), "Cocoa"); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/object-constructor-symbol-edge.js b/implementation-contributed/javascriptcore/stress/object-constructor-symbol-edge.js deleted file mode 100644 index d1d12731f4..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-constructor-symbol-edge.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(target) -{ - return Object(target); -} -noInline(test); - -(function () { - for (var i = 0; i < 1e4; ++i) { - var object = test(Symbol("Cocoa")); - shouldBe(object instanceof Symbol, true); - shouldBe(String(object.valueOf()), `Symbol(Cocoa)`); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/object-constructor-undefined-edge.js b/implementation-contributed/javascriptcore/stress/object-constructor-undefined-edge.js deleted file mode 100644 index b87d0049fb..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-constructor-undefined-edge.js +++ /dev/null @@ -1,17 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(target) -{ - return Object(target); -} -noInline(test); - -(function () { - for (var i = 0; i < 1e4; ++i) { - var object = test(undefined); - shouldBe(object.__proto__, Object.prototype); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/object-create-define.js b/implementation-contributed/javascriptcore/stress/object-create-define.js deleted file mode 100644 index a3ed990f7e..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-create-define.js +++ /dev/null @@ -1,31 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(prototype, data) -{ - return Object.create(prototype, data); -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) { - var prototype = { Cocoa: false }; - var object = test(prototype, { - Cappuccino: { - value: 42, - enumerable: true, - configurable: true, - writable: true - }, - Matcha: { - value: 40, - enumerable: false, - configurable: true, - writable: true - } - }); - shouldBe(Object.getPrototypeOf(object), prototype); - shouldBe(JSON.stringify(Object.getOwnPropertyNames(object).sort()), `["Cappuccino","Matcha"]`); - shouldBe(JSON.stringify(Object.keys(object).sort()), `["Cappuccino"]`); -} diff --git a/implementation-contributed/javascriptcore/stress/object-create-null-external.js b/implementation-contributed/javascriptcore/stress/object-create-null-external.js deleted file mode 100644 index 96fd04d77d..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-create-null-external.js +++ /dev/null @@ -1,16 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(prototype) -{ - return Object.create(prototype); -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) { - var object = test(null); - shouldBe(Object.getPrototypeOf(object), null); - shouldBe(JSON.stringify(Object.getOwnPropertyNames(object)), `[]`); -} diff --git a/implementation-contributed/javascriptcore/stress/object-create-null.js b/implementation-contributed/javascriptcore/stress/object-create-null.js deleted file mode 100644 index 0bc968e771..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-create-null.js +++ /dev/null @@ -1,16 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - return Object.create(null); -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) { - var object = test(); - shouldBe(Object.getPrototypeOf(object), null); - shouldBe(JSON.stringify(Object.getOwnPropertyNames(object)), `[]`); -} diff --git a/implementation-contributed/javascriptcore/stress/object-create-prototype.js b/implementation-contributed/javascriptcore/stress/object-create-prototype.js deleted file mode 100644 index 0d33fb439e..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-create-prototype.js +++ /dev/null @@ -1,17 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(prototype) -{ - return Object.create(prototype); -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) { - var prototype = { Cocoa: false }; - var object = test(prototype); - shouldBe(Object.getPrototypeOf(object), prototype); - shouldBe(JSON.stringify(Object.getOwnPropertyNames(object)), `[]`); -} diff --git a/implementation-contributed/javascriptcore/stress/object-create-undefined.js b/implementation-contributed/javascriptcore/stress/object-create-undefined.js deleted file mode 100644 index 9aa3c21c8d..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-create-undefined.js +++ /dev/null @@ -1,26 +0,0 @@ -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -function test(value) -{ - return Object.create(value); -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) { - shouldThrow(() => { - test(undefined); - }, `TypeError: Object prototype may only be an Object or null.`); -} diff --git a/implementation-contributed/javascriptcore/stress/object-div.js b/implementation-contributed/javascriptcore/stress/object-div.js deleted file mode 100644 index ea91b53704..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-div.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a / b; -} - -noInline(foo); - -var things = [{valueOf: function() { return 4; }}]; -var results = [2]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 2); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/object-entries.js b/implementation-contributed/javascriptcore/stress/object-entries.js deleted file mode 100644 index 544be2dd14..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-entries.js +++ /dev/null @@ -1,123 +0,0 @@ -var obj = Object.create({ a: "qux", d: "qux" }); -obj.a = "foo"; obj.b = "bar"; obj.c = "baz"; -var entries = Object.entries(obj); -var passed = Array.isArray(entries) - && String(entries[0]) === "a,foo" - && String(entries[1]) === "b,bar" - && String(entries[2]) === "c,baz"; - -if (!passed) - throw new Error("Object.entries return wrong result."); - -var complexObject = { - obj : { - a: 'x', - b: 'y' - }, - primitive : 'z' -}; - -passed = false; -entries = Object.entries(complexObject); - -passed = entries.length === 2 - && entries[0][0] === 'obj' - && entries[0][1].a === 'x' - && entries[0][1].b === 'y' - && entries[1][0] === 'primitive' - && entries[1][1] === 'z'; - -if (!passed) - throw new Error("Object.entries return wrong result."); - -entries = Object.entries({ a: 'abcdef' }); - -passed = entries.length === 1 - && entries[0][0] === 'a' - && entries[0][1] === 'abcdef'; - -if (!passed) - throw new Error("Object.entries return wrong result."); - -var primitives = [ - ["string", [[0, 's'], [1, 't'], [2, 'r'], [3, 'i'], [4, 'n'], [5, 'g']]], - [42, []], - [Symbol("symbol"), []], - [true, []], - [false, []] -]; - -function compare(ax, bx) { - if (ax.length !== bx.length) - return false; - for (var i = 0, iz = ax.length; i < iz; ++i) { - if (String(ax[i]) !== String(bx[i])) - return false; - } - return true; -} - -for (var [primitive, expected] of primitives) { - var ret = Object.entries(primitive); - if (!compare(ret, expected)) - throw new Error("bad value for " + String(primitive) + ": " + String(ret)); -} - -[ - [ null, "TypeError: Object.entries requires that input parameter not be null or undefined" ], - [ undefined, "TypeError: Object.entries requires that input parameter not be null or undefined" ] -].forEach(function ([value, message]) { - var error = null; - try { - Object.entries(value); - } catch (e) { - error = e; - } - if (!error) - throw new Error("error not thrown"); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -}); - -const getInvokedFunctions = (obj) => { - let arr = [] - let p = new Proxy(obj, { - ownKeys: function(...args) { - arr.push("ownKeys"); - return Reflect.ownKeys(...args); - }, - getOwnPropertyDescriptor: function(...args) { - arr.push("getOwnPropertyDescriptor"); - return Reflect.getOwnPropertyDescriptor(...args); - } - }); - - Object.entries(p); - return arr; -}; - -const arr1 = getInvokedFunctions({}); -passed = arr1.length === 1 && arr1[0] === "ownKeys"; - -if (!passed) - throw new Error("Object.entries should invoke ownkeys."); - -const arr2 = getInvokedFunctions({a:'foo', b:'boo'}); -passed = arr2.length === 3 && arr2[0] === "ownKeys"; - -if (!passed) - throw new Error("Object.entries should invoke ownkeys."); - -passed = arr2[1] === "getOwnPropertyDescriptor"; - -if (!passed) - throw new Error("Object.entries should get property descriptor."); - -Array.prototype.push = function () { throw new Error("Array.prototype.push should not be used during invoking of Object.entries.")}; -Object.getOwnPropertyDescriptor = function () { throw new Error("Array.prototype.getOwnPropertyDescriptor should not be used during invoking of Object.entries.")}; - -entries = Object.entries({a:'1-2', b:'3-4'}); -passed = Array.isArray(entries) && String(entries[0]) === "a,1-2" && String(entries[1]) === "b,3-4"; - -if (!passed) - throw new Error("Object.entries return wrong result."); diff --git a/implementation-contributed/javascriptcore/stress/object-escapes-in-loop.js b/implementation-contributed/javascriptcore/stress/object-escapes-in-loop.js deleted file mode 100644 index 196f72fe83..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-escapes-in-loop.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo(p) { - var o = {}; - if (p) { - for (var i = 0; i < 100; ++i) - bar(o); - } - return 42; -} - -function bar() { -} - -noInline(foo); -noInline(bar); - -for (var i = 0; i < 100000; ++i) - foo(true); diff --git a/implementation-contributed/javascriptcore/stress/object-freeze-accept-non-object.js b/implementation-contributed/javascriptcore/stress/object-freeze-accept-non-object.js deleted file mode 100644 index c4008c0ef1..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-freeze-accept-non-object.js +++ /dev/null @@ -1,15 +0,0 @@ -var primitives = [ - "string", - 42, - null, - undefined, - Symbol("symbol"), - true, - false -]; - -for (var primitive of primitives) { - var ret = Object.freeze(primitive); - if (ret !== primitive) - throw new Error("bad value: " + String(ret)); -} diff --git a/implementation-contributed/javascriptcore/stress/object-freeze-with-proxy-preventExtensions.js b/implementation-contributed/javascriptcore/stress/object-freeze-with-proxy-preventExtensions.js deleted file mode 100644 index c7cbc05d9e..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-freeze-with-proxy-preventExtensions.js +++ /dev/null @@ -1,29 +0,0 @@ -// See https://tc39.github.io/ecma262/#sec-object.freeze -// See https://tc39.github.io/ecma262/#sec-setintegritylevel - -var x = [10]; -var visited = []; - -var proxy = new Proxy(x, { - preventExtensions() { - visited.push("proxy_preventExtensions"); - return false; - } -}); - -var exception; -try { - visited.push("before_freeze"); - Object.freeze(proxy); - visited.push("after_freeze"); -} catch (e) { - visited.push("catch"); - exception = e; -} - -var exceptionStr = "" + exception; -if (!exceptionStr.startsWith("TypeError:")) - throw "Did not throw expected TypeError"; - -if (visited != "before_freeze,proxy_preventExtensions,catch") - throw "ERROR: visited = " + visited; diff --git a/implementation-contributed/javascriptcore/stress/object-get-own-property-descriptor-perform-to-object.js b/implementation-contributed/javascriptcore/stress/object-get-own-property-descriptor-perform-to-object.js deleted file mode 100644 index 50d772bc24..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-get-own-property-descriptor-perform-to-object.js +++ /dev/null @@ -1,43 +0,0 @@ -var primitives = [ - ["string", 6], - [42, undefined], - [Symbol("symbol"), undefined], - [true, undefined], - [false, undefined] -]; - -for (var [primitive, expected] of primitives) { - var ret = Object.getOwnPropertyDescriptor(primitive, 'length'); - if (expected === undefined) { - if (ret !== expected) - throw new Error("bad value for " + String(primitive) + ": " + String(ret)); - } else if (ret.value !== expected) - throw new Error("bad value for " + String(primitive) + ": " + String(ret)); -} - -function canary() { - return { - called: false, - toString() { - this.called = true; - throw new Error("out"); - } - }; -} - -[ - [ null, "TypeError: null is not an object (evaluating 'Object.getOwnPropertyDescriptor(value, property)')" ], - [ undefined, "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(value, property)')" ] -].forEach(function ([value, message]) { - var property = canary(); - var error = null; - try { - Object.getOwnPropertyDescriptor(value, property); - } catch (e) { - error = e; - } - if (!error) - throw new Error("error not thrown"); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -}); diff --git a/implementation-contributed/javascriptcore/stress/object-get-own-property-names-perform-to-object.js b/implementation-contributed/javascriptcore/stress/object-get-own-property-names-perform-to-object.js deleted file mode 100644 index 38ff56cbb9..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-get-own-property-names-perform-to-object.js +++ /dev/null @@ -1,39 +0,0 @@ -var primitives = [ - ["string", ['0', '1', '2', '3', '4', '5', 'length']], - [42, []], - [Symbol("symbol"), []], - [true, []], - [false, []] -]; - -function compare(ax, bx) { - if (ax.length !== bx.length) - return false; - for (var i = 0, iz = ax.length; i < iz; ++i) { - if (ax[i] !== bx[i]) - return false; - } - return true; -} - -for (var [primitive, expected] of primitives) { - var ret = Object.getOwnPropertyNames(primitive); - if (!compare(ret, expected)) - throw new Error("bad value for " + String(primitive) + ": " + String(ret)); -} - -[ - [ null, "TypeError: null is not an object (evaluating 'Object.getOwnPropertyNames(value)')" ], - [ undefined, "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyNames(value)')" ] -].forEach(function ([value, message]) { - var error = null; - try { - Object.getOwnPropertyNames(value); - } catch (e) { - error = e; - } - if (!error) - throw new Error("error not thrown"); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -}); diff --git a/implementation-contributed/javascriptcore/stress/object-get-own-property-symbols-perform-to-object.js b/implementation-contributed/javascriptcore/stress/object-get-own-property-symbols-perform-to-object.js deleted file mode 100644 index 031c3fa43e..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-get-own-property-symbols-perform-to-object.js +++ /dev/null @@ -1,39 +0,0 @@ -var primitives = [ - ["string", []], - [42, []], - [Symbol("symbol"), []], - [true, []], - [false, []] -]; - -function compare(ax, bx) { - if (ax.length !== bx.length) - return false; - for (var i = 0, iz = ax.length; i < iz; ++i) { - if (ax[i] !== bx[i]) - return false; - } - return true; -} - -for (var [primitive, expected] of primitives) { - var ret = Object.getOwnPropertySymbols(primitive); - if (!compare(ret, expected)) - throw new Error("bad value for " + String(primitive) + ": " + String(ret)); -} - -[ - [ null, "TypeError: null is not an object (evaluating 'Object.getOwnPropertySymbols(value)')" ], - [ undefined, "TypeError: undefined is not an object (evaluating 'Object.getOwnPropertySymbols(value)')" ] -].forEach(function ([value, message]) { - var error = null; - try { - Object.getOwnPropertySymbols(value); - } catch (e) { - error = e; - } - if (!error) - throw new Error("error not thrown"); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -}); diff --git a/implementation-contributed/javascriptcore/stress/object-get-own-property-symbols.js b/implementation-contributed/javascriptcore/stress/object-get-own-property-symbols.js deleted file mode 100644 index 40e93d8b24..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-get-own-property-symbols.js +++ /dev/null @@ -1,35 +0,0 @@ -// This tests Object.getOwnPropertySymbols. - -var global = (Function("return this")()); - -// private names for privileged code should not be exposed. -if (Object.getOwnPropertySymbols(global).length !== 0) - throw "Error: bad value " + Object.getOwnPropertySymbols(global).length; - -var object = {}; -var symbol = Symbol("Cocoa"); -object[symbol] = "Cappuccino"; -if (Object.getOwnPropertyNames(object).length !== 0) - throw "Error: bad value " + Object.getOwnPropertyNames(object).length; -if (Object.getOwnPropertySymbols(object).length !== 1) - throw "Error: bad value " + Object.getOwnPropertySymbols(object).length; -if (Object.getOwnPropertySymbols(object)[0] !== symbol) - throw "Error: bad value " + String(Object.getOwnPropertySymbols(object)[0]); - -function forIn(obj) { - var array = []; - // Symbol should not be enumerated. - for (var key in obj) array.push(key); - return array; -} - -if (forIn(object).length !== 0) - throw "Error: bad value " + forIn(object).length; -if (Object.keys(object).length !== 0) - throw "Error: bad value " + Object.keys(object).length; - -delete object[symbol]; -if (Object.getOwnPropertyNames(object).length !== 0) - throw "Error: bad value " + Object.getOwnPropertyNames(object).length; -if (Object.getOwnPropertySymbols(object).length !== 0) - throw "Error: bad value " + Object.getOwnPropertySymbols(object).length; diff --git a/implementation-contributed/javascriptcore/stress/object-get-prototype-of-filtered.js b/implementation-contributed/javascriptcore/stress/object-get-prototype-of-filtered.js deleted file mode 100644 index e1a0808d09..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-get-prototype-of-filtered.js +++ /dev/null @@ -1,64 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -// In this case, we cannot handle it as GetPrototypeOf since GetById is opaque. - -(function () { - function target(object) - { - return Object.getPrototypeOf(object); - } - noInline(target); - - for (var i = 0; i < 1e4; ++i) { - var object = {}; - object[`Cocoa${i}`] = `Cocoa`; - shouldBe(target(object), Object.prototype); - } -}()); - -(function () { - function target(object) - { - return Object.getPrototypeOf(object); - } - noInline(target); - - for (var i = 0; i < 1e4; ++i) { - var array = []; - array[`Cocoa${i}`] = `Cocoa`; - shouldBe(target(array), Array.prototype); - } -}()); - -(function () { - function target(object) - { - return Object.getPrototypeOf(object); - } - noInline(target); - - for (var i = 0; i < 1e4; ++i) { - function Cocoa() { } - Cocoa[`Cocoa${i}`] = `Cocoa`; - shouldBe(target(Cocoa), Function.prototype); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/object-get-prototype-of-mono-proto.js b/implementation-contributed/javascriptcore/stress/object-get-prototype-of-mono-proto.js deleted file mode 100644 index 5e0754e20f..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-get-prototype-of-mono-proto.js +++ /dev/null @@ -1,34 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function makePolyProtoObject() { - function foo() { - class C { - constructor() { - this._field = 42; - this.hello = 33; - } - }; - return new C; - } - for (let i = 0; i < 15; ++i) - foo(); - return foo(); -} - -function target(object) -{ - return [object.hello, Object.getPrototypeOf(object)]; -} -noInline(target); - -var polyProtoObject = makePolyProtoObject(); -var prototype = Reflect.getPrototypeOf(polyProtoObject); -var object1 = { __proto__: prototype, hello: 44 }; -var object2 = { hello: 45 }; -for (var i = 0; i < 1e5; ++i) { - shouldBe(target(object1)[1], prototype); - shouldBe(target(object2)[1], Object.prototype); -} diff --git a/implementation-contributed/javascriptcore/stress/object-get-prototype-of-perform-to-object.js b/implementation-contributed/javascriptcore/stress/object-get-prototype-of-perform-to-object.js deleted file mode 100644 index c952337757..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-get-prototype-of-perform-to-object.js +++ /dev/null @@ -1,29 +0,0 @@ -var primitives = [ - ["string", String.prototype], - [42, Number.prototype], - [Symbol("symbol"), Symbol.prototype], - [true, Boolean.prototype], - [false, Boolean.prototype] -]; - -for (var [primitive, expected] of primitives) { - var ret = Object.getPrototypeOf(primitive); - if (ret !== expected) - throw new Error("bad value for " + String(primitive) + ": " + String(ret)); -} - -[ - [ null, "TypeError: null is not an object (evaluating 'Object.getPrototypeOf(value)')" ], - [ undefined, "TypeError: undefined is not an object (evaluating 'Object.getPrototypeOf(value)')" ] -].forEach(function ([value, message]) { - var error = null; - try { - Object.getPrototypeOf(value); - } catch (e) { - error = e; - } - if (!error) - throw new Error("error not thrown"); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -}); diff --git a/implementation-contributed/javascriptcore/stress/object-get-prototype-of-poly-mono-proto.js b/implementation-contributed/javascriptcore/stress/object-get-prototype-of-poly-mono-proto.js deleted file mode 100644 index 3fa09ef096..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-get-prototype-of-poly-mono-proto.js +++ /dev/null @@ -1,33 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function makePolyProtoObject() { - function foo() { - class C { - constructor() { - this._field = 42; - this.hello = 33; - } - }; - return new C; - } - for (let i = 0; i < 15; ++i) - foo(); - return foo(); -} - -function target(object) -{ - return [object.hello, Object.getPrototypeOf(object)]; -} -noInline(target); - -var polyProtoObject = makePolyProtoObject(); -var prototype = Reflect.getPrototypeOf(polyProtoObject); -var object = { __proto__: prototype, hello: 44 }; -for (var i = 0; i < 1e5; ++i) { - shouldBe(target(polyProtoObject)[1], prototype); - shouldBe(target(object)[1], prototype); -} diff --git a/implementation-contributed/javascriptcore/stress/object-get-prototype-of-poly-proto.js b/implementation-contributed/javascriptcore/stress/object-get-prototype-of-poly-proto.js deleted file mode 100644 index 43d649d743..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-get-prototype-of-poly-proto.js +++ /dev/null @@ -1,30 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function makePolyProtoObject() { - function foo() { - class C { - constructor() { - this._field = 42; - this.hello = 33; - } - }; - return new C; - } - for (let i = 0; i < 15; ++i) - foo(); - return foo(); -} - -function target(object) -{ - return [object.hello, Object.getPrototypeOf(object)]; -} -noInline(target); - -var polyProtoObject = makePolyProtoObject(); -var prototype = Reflect.getPrototypeOf(polyProtoObject); -for (var i = 0; i < 1e5; ++i) - shouldBe(target(polyProtoObject)[1], prototype); diff --git a/implementation-contributed/javascriptcore/stress/object-is-extensible-accept-non-object.js b/implementation-contributed/javascriptcore/stress/object-is-extensible-accept-non-object.js deleted file mode 100644 index 44c371da62..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-is-extensible-accept-non-object.js +++ /dev/null @@ -1,15 +0,0 @@ -var primitives = [ - "string", - 42, - null, - undefined, - Symbol("symbol"), - true, - false -]; - -for (var primitive of primitives) { - var ret = Object.isExtensible(primitive); - if (ret !== false) - throw new Error("bad value: " + String(ret)); -} diff --git a/implementation-contributed/javascriptcore/stress/object-is-frozen-accept-non-object.js b/implementation-contributed/javascriptcore/stress/object-is-frozen-accept-non-object.js deleted file mode 100644 index e98823b609..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-is-frozen-accept-non-object.js +++ /dev/null @@ -1,15 +0,0 @@ -var primitives = [ - "string", - 42, - null, - undefined, - Symbol("symbol"), - true, - false -]; - -for (var primitive of primitives) { - var ret = Object.isFrozen(primitive); - if (ret !== true) - throw new Error("bad value: " + String(ret)); -} diff --git a/implementation-contributed/javascriptcore/stress/object-is-sealed-accept-non-object.js b/implementation-contributed/javascriptcore/stress/object-is-sealed-accept-non-object.js deleted file mode 100644 index 08d5e60afd..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-is-sealed-accept-non-object.js +++ /dev/null @@ -1,15 +0,0 @@ -var primitives = [ - "string", - 42, - null, - undefined, - Symbol("symbol"), - true, - false -]; - -for (var primitive of primitives) { - var ret = Object.isSealed(primitive); - if (ret !== true) - throw new Error("bad value: " + String(ret)); -} diff --git a/implementation-contributed/javascriptcore/stress/object-is.js b/implementation-contributed/javascriptcore/stress/object-is.js deleted file mode 100644 index 4e74e35dc2..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-is.js +++ /dev/null @@ -1,72 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function is1(a, b) { return Object.is(a, b); } -noInline(is1); -function is2(a, b) { return Object.is(a, b); } -noInline(is2); -function is3(a, b) { return Object.is(a, b); } -noInline(is3); -function is4(a, b) { return Object.is(a, b); } -noInline(is4); -function is5(a, b) { return Object.is(a, b); } -noInline(is5); -function is6(a, b) { return Object.is(a, b); } -noInline(is6); -function is7(a, b) { return Object.is(a, b); } -noInline(is7); -function is8(a, b) { return Object.is(a, b); } -noInline(is8); -function is9(a, b) { return Object.is(a, b); } -noInline(is9); -function is10(a, b) { return Object.is(a, b); } -noInline(is10); -function is11(a, b) { return Object.is(a, b); } -noInline(is11); -function is12(a, b) { return Object.is(a, b); } -noInline(is12); -function is13(a, b) { return Object.is(a, b); } -noInline(is13); -function is14(a, b) { return Object.is(a, b); } -noInline(is14); -function is15(a, b) { return Object.is(a, b); } -noInline(is15); - -for (var i = 0; i < 1e5; ++i) { - shouldBe(Object.is(NaN, NaN), true); - shouldBe(Object.is(null, null), true); - shouldBe(Object.is(null), false); - shouldBe(Object.is(undefined, undefined), true); - shouldBe(Object.is(true, true), true); - shouldBe(Object.is(false, false), true); - shouldBe(Object.is('abc', 'abc'), true); - shouldBe(Object.is(Infinity, Infinity), true); - shouldBe(Object.is(0, 0), true); - shouldBe(Object.is(-0, -0), true); - shouldBe(Object.is(0, -0), false); - shouldBe(Object.is(-0, 0), false); - var obj = {}; - shouldBe(Object.is(obj, obj), true); - var arr = []; - shouldBe(Object.is(arr, arr), true); - var sym = Symbol(); - shouldBe(Object.is(sym, sym), true); - - shouldBe(is1(NaN, NaN), true); - shouldBe(is2(null, null), true); - shouldBe(is3(null), false); - shouldBe(is4(undefined, undefined), true); - shouldBe(is5(true, true), true); - shouldBe(is6(false, false), true); - shouldBe(is7('abc', 'abc'), true); - shouldBe(is8(Infinity, Infinity), true); - shouldBe(is9(0, 0), true); - shouldBe(is10(-0, -0), true); - shouldBe(is11(0, -0), false); - shouldBe(is12(-0, 0), false); - shouldBe(is13(obj, obj), true); - shouldBe(is14(arr, arr), true); - shouldBe(is15(sym, sym), true); -} diff --git a/implementation-contributed/javascriptcore/stress/object-iterate-symbols.js b/implementation-contributed/javascriptcore/stress/object-iterate-symbols.js deleted file mode 100644 index b384fd4031..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-iterate-symbols.js +++ /dev/null @@ -1,32 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var a = Symbol("a"); -var b = Symbol("b"); -var c = Symbol("c"); -var d = Symbol("d"); -var e = Symbol("e"); - -var obj = { - [a]: 1, - [b]: 2, - [c]: 3, - [d]: null, - [e]: 'e' -}; - -function test(src) { - var array = []; - var keys = Object.getOwnPropertySymbols(src); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - array.push(src[key]); - } - return array; -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) - shouldBe(JSON.stringify(test(obj)), `[1,2,3,null,"e"]`); diff --git a/implementation-contributed/javascriptcore/stress/object-iterate.js b/implementation-contributed/javascriptcore/stress/object-iterate.js deleted file mode 100644 index 87a1745fde..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-iterate.js +++ /dev/null @@ -1,26 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var obj = { - a: 1, - b: 2, - c: 3, - d: null, - e: 'e' -}; - -function test(src) { - var array = []; - var keys = Object.keys(src); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - array.push(src[key]); - } - return array; -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) - shouldBe(JSON.stringify(test(obj)), `[1,2,3,null,"e"]`); diff --git a/implementation-contributed/javascriptcore/stress/object-keys-perform-to-object.js b/implementation-contributed/javascriptcore/stress/object-keys-perform-to-object.js deleted file mode 100644 index d0e668f66b..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-keys-perform-to-object.js +++ /dev/null @@ -1,39 +0,0 @@ -var primitives = [ - ["string", ['0', '1', '2', '3', '4', '5']], - [42, []], - [Symbol("symbol"), []], - [true, []], - [false, []] -]; - -function compare(ax, bx) { - if (ax.length !== bx.length) - return false; - for (var i = 0, iz = ax.length; i < iz; ++i) { - if (ax[i] !== bx[i]) - return false; - } - return true; -} - -for (var [primitive, expected] of primitives) { - var ret = Object.keys(primitive); - if (!compare(ret, expected)) - throw new Error("bad value for " + String(primitive) + ": " + String(ret)); -} - -[ - [ null, "TypeError: null is not an object (evaluating 'Object.keys(value)')" ], - [ undefined, "TypeError: undefined is not an object (evaluating 'Object.keys(value)')" ] -].forEach(function ([value, message]) { - var error = null; - try { - Object.keys(value); - } catch (e) { - error = e; - } - if (!error) - throw new Error("error not thrown"); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -}); diff --git a/implementation-contributed/javascriptcore/stress/object-literal-methods.js b/implementation-contributed/javascriptcore/stress/object-literal-methods.js deleted file mode 100644 index ef5f1c467b..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-literal-methods.js +++ /dev/null @@ -1,105 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -{ - let name = 'prototype'; - let object = { - prototype() { }, - get [name]() { }, - }; - - shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, 'prototype')), `{"enumerable":true,"configurable":true}`); -} - -{ - let name = 'prototype'; - let object = { - get [name]() { }, - prototype() { }, - }; - - shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, 'prototype')), `{"writable":true,"enumerable":true,"configurable":true}`); -} - - -{ - let name = 'prototype'; - let object = { - [name]() { }, - get prototype() { }, - }; - - shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, 'prototype')), `{"enumerable":true,"configurable":true}`); -} - -{ - let name = 'prototype'; - let object = { - get prototype() { }, - [name]() { }, - }; - - shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, 'prototype')), `{"writable":true,"enumerable":true,"configurable":true}`); -} - -{ - let object = { - __proto__() { } - }; - shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, '__proto__')), `{"writable":true,"enumerable":true,"configurable":true}`); - shouldBe(Object.getPrototypeOf(object), Object.prototype); -} - -{ - let name = '__proto__'; - let object = { - [name]() { } - }; - shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, '__proto__')), `{"writable":true,"enumerable":true,"configurable":true}`); - shouldBe(Object.getPrototypeOf(object), Object.prototype); -} - -{ - let name = '42'; - let object = { - 42() { }, - get [name]() { }, - }; - - shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, '42')), `{"enumerable":true,"configurable":true}`); -} - -{ - let name = '42'; - let object = { - get [name]() { }, - 42() { }, - }; - - shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, '42')), `{"writable":true,"enumerable":true,"configurable":true}`); -} - - -{ - let name = '42'; - let object = { - [name]() { }, - get 42() { }, - }; - - shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, '42')), `{"enumerable":true,"configurable":true}`); -} - -{ - let name = '42'; - let object = { - get 42() { }, - [name]() { }, - }; - - shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, '42')), `{"writable":true,"enumerable":true,"configurable":true}`); -} - - diff --git a/implementation-contributed/javascriptcore/stress/object-lshift.js b/implementation-contributed/javascriptcore/stress/object-lshift.js deleted file mode 100644 index a30cd715df..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-lshift.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a << b; -} - -noInline(foo); - -var things = [{valueOf: function() { return 4; }}]; -var results = [8]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 1); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/object-mul.js b/implementation-contributed/javascriptcore/stress/object-mul.js deleted file mode 100644 index 23ec846310..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-mul.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a * b; -} - -noInline(foo); - -var things = [{valueOf: function() { return 4; }}]; -var results = [8]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 2); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/object-number-properties.js b/implementation-contributed/javascriptcore/stress/object-number-properties.js deleted file mode 100644 index 2c0daccd9c..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-number-properties.js +++ /dev/null @@ -1,148 +0,0 @@ -function assert(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var priceRanges = { - "1": 0.6, - "100": 0.45, - "250": 0.3, - "2000": 0.28 -}; - -assert(Object.keys(priceRanges).length, 4); -assert(Object.values(priceRanges).length, 4); -assert(priceRanges[1], 0.6); -assert(priceRanges[100], 0.45); -assert(priceRanges[250], 0.3); -assert(priceRanges[2000], 0.28); - -var ranges = { - "250" : 0.5, - "1000": 0.1 -}; - -assert(Object.keys(ranges).length, 2); -assert(Object.values(ranges).length, 2); -assert(ranges[250], 0.5); -assert(ranges[1000], 0.1); - -var r = {}; - -r[250] = 0.1; -r[1001] = 0.5; - -assert(Object.keys(r).length, 2); -assert(Object.values(ranges).length, 2); - -assert(r[250], 0.1); -assert(r[1001], 0.5); - -var foo = {}; - -foo[100] = NaN; -foo[250] = 0.1; -foo[260] = NaN; -foo[1000] = 0.5; - -assert(Object.keys(foo).length, 4); -assert(Object.values(foo).length, 4); -assert(isNaN(foo[100]), true); -assert(foo[250], 0.1); -assert(isNaN(foo[260]), true); -assert(foo[1000], 0.5); - -var boo = function () { - return { - "250": 0.2, - "1000": 0.1 - }; -}; - -for (var i = 0; i < 10000; i++) { - const b = boo(); - const keys = Object.keys(b); - const values = Object.values(b); - - assert(keys.length, 2); - assert(values.length, 2); - - assert(b[keys[0]], values[0]); - assert(b[keys[1]], values[1]); -} - -var baz = { - "250": "A", - "1001": "B" -}; - -assert(Object.keys(baz).length, 2); -assert(Object.values(baz).length, 2); -assert(baz[250], "A"); -assert(baz[1001], "B"); - -var bar = JSON.parse('{"0":97.1,"1000":96.5,"2000":96.1,"3000":97.4,"4000":90.4}'); - -assert(Object.keys(bar).length, 5); -assert(bar[0], 97.1); -assert(bar[1000], 96.5); -assert(bar[2000], 96.1); -assert(bar[3000], 97.4); -assert(bar[4000], 90.4); - -bar = JSON.parse('{"0":97.1, "250": 65.3, "1000":96.5,"2000":96.1,"3000":97.4,"4000":90.4}'); - -assert(Object.keys(bar).length, 6); - -assert(bar[0], 97.1); -assert(bar[250], 65.3); -assert(bar[1000], 96.5); -assert(bar[2000], 96.1); -assert(bar[3000], 97.4); -assert(bar[4000], 90.4); - -bar = JSON.parse('{"0":97.1, "250": null, "1000":96.5,"2000":96.1,"3000":97.4,"4000":90.4}'); - -assert(Object.keys(bar).length, 6); - -assert(bar[0], 97.1); -assert(bar[250], null); -assert(bar[1000], 96.5); -assert(bar[2000], 96.1); -assert(bar[3000], 97.4); -assert(bar[4000], 90.4); - - -bar = eval('(()=>({"0":97.1, "250": 65.3, "1000":96.5,"2000":96.1,"3000":97.4,"4000":90.4}))();'); - -assert(Object.keys(bar).length, 6); - -assert(bar[0], 97.1); -assert(bar[250], 65.3); -assert(bar[1000], 96.5); -assert(bar[2000], 96.1); -assert(bar[3000], 97.4); -assert(bar[4000], 90.4); - -bar = eval('(()=>({"0":97.1, "250": null, "1000":96.5,"2000":96.1,"3000":97.4,"4000":90.4}))();'); - -assert(Object.keys(bar).length, 6); - -assert(bar[0], 97.1); -assert(bar[250], null); -assert(bar[1000], 96.5); -assert(bar[2000], 96.1); -assert(bar[3000], 97.4); -assert(bar[4000], 90.4); - - -bar = eval('(()=>({"0":97.1, "250": NaN, "1000":96.5,"2000":96.1,"3000":97.4,"4000":90.4}))();'); - -assert(Object.keys(bar).length, 6); - -assert(bar[0], 97.1); -assert(isNaN(bar[250]), true); -assert(bar[1000], 96.5); -assert(bar[2000], 96.1); -assert(bar[3000], 97.4); -assert(bar[4000], 90.4); diff --git a/implementation-contributed/javascriptcore/stress/object-own-property-keys.js b/implementation-contributed/javascriptcore/stress/object-own-property-keys.js deleted file mode 100644 index 0d36426842..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-own-property-keys.js +++ /dev/null @@ -1,45 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -Object.defineProperty(Array.prototype, '0', { - get() { - throw new Error('out'); - }, - set(value) { - throw new Error('out'); - } -}); - -{ - let object = { - a: 42, - b: 42, - c: 42 - }; - { - let result = Object.keys(object); - shouldBe(JSON.stringify(result), `["a","b","c"]`); - } - { - let result = Object.values(object); - shouldBe(JSON.stringify(result), `[42,42,42]`); - } -} -{ - let object = { - [Symbol.iterator]: 42, - b: 42, - c: 42 - }; - { - let result = Object.getOwnPropertyNames(object); - shouldBe(JSON.stringify(result), `["b","c"]`); - } - { - let result = Object.getOwnPropertySymbols(object); - shouldBe(result.length, 1); - shouldBe(result[0], Symbol.iterator); - } -} diff --git a/implementation-contributed/javascriptcore/stress/object-prevent-extensions-accept-non-object.js b/implementation-contributed/javascriptcore/stress/object-prevent-extensions-accept-non-object.js deleted file mode 100644 index 564febb794..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-prevent-extensions-accept-non-object.js +++ /dev/null @@ -1,15 +0,0 @@ -var primitives = [ - "string", - 42, - null, - undefined, - Symbol("symbol"), - true, - false -]; - -for (var primitive of primitives) { - var ret = Object.preventExtensions(primitive); - if (ret !== primitive) - throw new Error("bad value: " + String(ret)); -} diff --git a/implementation-contributed/javascriptcore/stress/object-proto-getter-filtered.js b/implementation-contributed/javascriptcore/stress/object-proto-getter-filtered.js deleted file mode 100644 index 33fb527c56..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-proto-getter-filtered.js +++ /dev/null @@ -1,62 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -(function () { - function target(object) - { - return object.__proto__; - } - noInline(target); - - for (var i = 0; i < 1e4; ++i) { - var object = {}; - object[`Cocoa${i}`] = `Cocoa`; - shouldBe(target(object), Object.prototype); - } -}()); - -(function () { - function target(object) - { - return object.__proto__; - } - noInline(target); - - for (var i = 0; i < 1e4; ++i) { - var array = []; - array[`Cocoa${i}`] = `Cocoa`; - shouldBe(target(array), Array.prototype); - } -}()); - -(function () { - function target(object) - { - return object.__proto__; - } - noInline(target); - - for (var i = 0; i < 1e4; ++i) { - function Cocoa() { } - Cocoa[`Cocoa${i}`] = `Cocoa`; - shouldBe(target(Cocoa), Function.prototype); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/object-proto-getter-poly-mono-proto.js b/implementation-contributed/javascriptcore/stress/object-proto-getter-poly-mono-proto.js deleted file mode 100644 index 1cc77e58ac..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-proto-getter-poly-mono-proto.js +++ /dev/null @@ -1,34 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function makePolyProtoObject() { - function foo() { - class C { - constructor() { - this._field = 42; - } - }; - return new C; - } - for (let i = 0; i < 15; ++i) - foo(); - return foo(); -} - -function target(object) -{ - return object.__proto__; -} -noInline(target); - -var polyProtoObject = makePolyProtoObject(); -var prototype = Reflect.getPrototypeOf(polyProtoObject); -var object = { - __proto__: prototype -}; -for (var i = 0; i < 1e5; ++i) { - shouldBe(target(polyProtoObject), prototype); - shouldBe(target(object), prototype); -} diff --git a/implementation-contributed/javascriptcore/stress/object-proto-getter-poly-proto.js b/implementation-contributed/javascriptcore/stress/object-proto-getter-poly-proto.js deleted file mode 100644 index 9b8efd9155..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-proto-getter-poly-proto.js +++ /dev/null @@ -1,29 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function makePolyProtoObject() { - function foo() { - class C { - constructor() { - this._field = 42; - } - }; - return new C; - } - for (let i = 0; i < 15; ++i) - foo(); - return foo(); -} - -function target(object) -{ - return object.__proto__; -} -noInline(target); - -var polyProtoObject = makePolyProtoObject(); -var prototype = Reflect.getPrototypeOf(polyProtoObject); -for (var i = 0; i < 1e5; ++i) - shouldBe(target(polyProtoObject), prototype); diff --git a/implementation-contributed/javascriptcore/stress/object-prototype-proto-accessors-should-throw-on-undefined-this.js b/implementation-contributed/javascriptcore/stress/object-prototype-proto-accessors-should-throw-on-undefined-this.js deleted file mode 100644 index 5d4505b778..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-prototype-proto-accessors-should-throw-on-undefined-this.js +++ /dev/null @@ -1,38 +0,0 @@ -//@ runFTLNoCJIT - -function shouldEqual(testId, actual, expected) { - if (actual != expected) { - throw testId + ": ERROR: expect " + expected + ", actual " + actual; - } -} - -let numberOfIterations = 10000; - -function testInvokeGetter() { - var getter = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").get; - return (function() { return getter(); })(); -} -noInline(testInvokeGetter); - -function testInvokeSetter() { - var setter = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set; - return (function() { return setter({}); })(); -} -noInline(testInvokeSetter); - -function runTest(testId, test, expectedResult, expectedException) { - for (var i = 0; i < numberOfIterations; i++) { - var exception; - var result; - try { - result = test({}); - } catch (e) { - exception = "" + e; - } - shouldEqual(testId, result, expectedResult); - shouldEqual(testId, exception, expectedException); - } -} - -runTest(10000, testInvokeGetter, undefined, "TypeError: undefined is not an object (evaluating 'getter()')"); -runTest(10100, testInvokeSetter, undefined, "TypeError: Object.prototype.__proto__ called on null or undefined"); diff --git a/implementation-contributed/javascriptcore/stress/object-rest-deconstruct.js b/implementation-contributed/javascriptcore/stress/object-rest-deconstruct.js deleted file mode 100644 index c984e7140b..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-rest-deconstruct.js +++ /dev/null @@ -1,216 +0,0 @@ -let assert = (e) => { - if (!e) - throw Error("Bad assertion!"); -} - -let assertPropDescriptor = (restObj, prop) => { - let desc = Object.getOwnPropertyDescriptor(restObj, prop); - assert(desc.enumerable); - assert(desc.writable); - assert(desc.configurable); -} - -// Base Case -(() => { - let obj = {x: 1, y: 2, a: 5, b: 3} - - let {a, b, ...rest} = obj; - - assert(a === 5); - assert(b === 3); - - assert(rest.x === 1); - assert(rest.y === 2); - - assertPropDescriptor(rest, 'x'); - assertPropDescriptor(rest, 'y'); -})(); - -// Empty Object -(() => { - let obj = {} - - let {a, b, ...rest} = obj; - - assert(a === undefined); - assert(b === undefined); - - assert(typeof rest === "object"); -})(); - -// Number case -(() => { - let obj = 3; - - let {...rest} = obj; - - assert(typeof rest === "object"); -})(); - -// String case -(() => { - let obj = "foo"; - - let {...rest} = obj; - - assert(typeof rest === "object"); -})(); - -// Symbol case -(() => { - let obj = Symbol("foo"); - - let {...rest} = obj; - - assert(typeof rest === "object"); -})(); - -// null case -(() => { - let obj = null; - - try { - let {...rest} = obj; - assert(false); - } catch (e) { - assert(e.message == "Right side of assignment cannot be destructured"); - } - -})(); - -// undefined case -(() => { - let obj = undefined; - - try { - let {...rest} = obj; - assert(false); - } catch (e) { - assert(e.message == "Right side of assignment cannot be destructured"); - } - -})(); - -// getter case -(() => { - let obj = {a: 3, b: 4}; - Object.defineProperty(obj, "x", { get: () => 3, enumerable: true }); - - let {a, b, ...rest} = obj; - - assert(a === 3); - assert(b === 4); - - assert(rest.x === 3); - assertPropDescriptor(rest, 'x'); -})(); - -// Skip non-enumerable case -(() => { - let obj = {a: 3, b: 4}; - Object.defineProperty(obj, "x", { value: 4, enumerable: false }); - - let {...rest} = obj; - - assert(rest.a === 3); - assert(rest.b === 4); - assert(rest.x === undefined); -})(); - -// Don't copy descriptor case -(() => { - let obj = {}; - Object.defineProperty(obj, "a", { value: 3, configurable: false, enumerable: true }); - Object.defineProperty(obj, "b", { value: 4, writable: false, enumerable: true }); - - let {...rest} = obj; - - assert(rest.a === 3); - assert(rest.b === 4); - - assertPropDescriptor(rest, 'a'); - assertPropDescriptor(rest, 'b'); -})(); - -// Destructuring function parameter - -(() => { - - var o = { x: 1, y: 2, w: 3, z: 4 }; - - function foo({ x, y, ...rest }) { - assert(x === 1); - assert(y === 2); - assert(rest.w === 3); - assert(rest.z === 4); - } - foo(o); -})(); - -// Destructuring arrow function parameter - -(() => { - - var o = { x: 1, y: 2, w: 3, z: 4 }; - - (({ x, y, ...rest }) => { - assert(x === 1); - assert(y === 2); - assert(rest.w === 3); - assert(rest.z === 4); - })(o); -})(); - -// Destructuring to a property -(() => { - - var o = { x: 1, y: 2}; - - let settedValue; - let src = {}; - ({...src.y} = o); - assert(src.y.x === 1); - assert(src.y.y === 2); -})(); - -// Destructuring with setter -(() => { - - var o = { x: 1, y: 2}; - - let settedValue; - let src = { - get y() { throw Error("The property should not be accessed"); }, - set y(v) { - settedValue = v; - } - } - src.y = undefined; - ({...src.y} = o); - assert(settedValue.x === 1); - assert(settedValue.y === 2); -})(); - -// Destructuring computed property -(() => { - - var a = "foo"; - - var {[a]: b, ...r} = {foo: 1, bar: 2, baz: 3}; - assert(b === 1); - assert(r.bar === 2); - assert(r.baz === 3); -})(); - -// Catch case - -(() => { - try { - throw {foo: 1, bar: 2, baz: 3}; - } catch({foo, ...rest}) { - assert(foo === 1); - assert(rest.bar === 2); - assert(rest.baz === 3); - } -})(); - diff --git a/implementation-contributed/javascriptcore/stress/object-rshift.js b/implementation-contributed/javascriptcore/stress/object-rshift.js deleted file mode 100644 index 7aa56b5617..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-rshift.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a >> b; -} - -noInline(foo); - -var things = [{valueOf: function() { return -4; }}]; -var results = [-2]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 1); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/object-seal-accept-non-object.js b/implementation-contributed/javascriptcore/stress/object-seal-accept-non-object.js deleted file mode 100644 index 5c3d23d803..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-seal-accept-non-object.js +++ /dev/null @@ -1,15 +0,0 @@ -var primitives = [ - "string", - 42, - null, - undefined, - Symbol("symbol"), - true, - false -]; - -for (var primitive of primitives) { - var ret = Object.seal(primitive); - if (ret !== primitive) - throw new Error("bad value: " + String(ret)); -} diff --git a/implementation-contributed/javascriptcore/stress/object-seal-with-proxy-preventExtensions.js b/implementation-contributed/javascriptcore/stress/object-seal-with-proxy-preventExtensions.js deleted file mode 100644 index 6da1db8acd..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-seal-with-proxy-preventExtensions.js +++ /dev/null @@ -1,29 +0,0 @@ -// See https://tc39.github.io/ecma262/#sec-object.seal -// See https://tc39.github.io/ecma262/#sec-setintegritylevel - -var x = [10]; -var visited = []; - -var proxy = new Proxy(x, { - preventExtensions() { - visited.push("proxy_preventExtensions"); - return false; - } -}); - -var exception; -try { - visited.push("before_seal"); - Object.seal(proxy); - visited.push("after_seal"); -} catch (e) { - visited.push("catch"); - exception = e; -} - -var exceptionStr = "" + exception; -if (!exceptionStr.startsWith("TypeError:")) - throw "Did not throw expected TypeError"; - -if (visited != "before_seal,proxy_preventExtensions,catch") - throw "ERROR: visited = " + visited; diff --git a/implementation-contributed/javascriptcore/stress/object-spread.js b/implementation-contributed/javascriptcore/stress/object-spread.js deleted file mode 100644 index abf8f4c0ff..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-spread.js +++ /dev/null @@ -1,313 +0,0 @@ -let assert = (a) => { - if (!a) - throw new Error("Bad Assertion"); -} - -assert.sameValue = (a, b) => { - assert(a === b); -} - -function validatePropertyDescriptor(o, p) { - let desc = Object.getOwnPropertyDescriptor(o, p); - - assert(desc.enumerable); - assert(desc.configurable); - assert(desc.writable); -} - -// Base cases - -(() => { - let obj = {a: 1, b: 2, ...{c: 3, d: 4}}; - - assert.sameValue(obj.a, 1); - assert(obj.b, 2); - assert(obj.c, 3); - assert(obj.d, 4); - validatePropertyDescriptor(obj, "c"); - validatePropertyDescriptor(obj, "d"); - assert(Object.keys(obj), 2); -})(); - -(() => { - let o = {c: 3, d: 4}; - let obj = {a: 1, b: 2, ...o}; - - assert.sameValue(obj.a, 1); - assert.sameValue(obj.b, 2); - assert.sameValue(obj.c, 3); - assert.sameValue(obj.d, 4); - assert.sameValue(Object.keys(obj).length, 4); - - validatePropertyDescriptor(obj, "a"); - validatePropertyDescriptor(obj, "b"); - validatePropertyDescriptor(obj, "c"); - validatePropertyDescriptor(obj, "d"); -})(); - -(() => { - let o = {a: 2, b: 3}; - let o2 = {c: 4, d: 5}; - - let obj = {...o, ...o2}; - - assert.sameValue(obj.a, 2); - assert.sameValue(obj.b, 3); - assert.sameValue(obj.c, 4); - assert.sameValue(obj.d, 5); - assert.sameValue(Object.keys(obj).length, 4); -})(); - -// Empty case - -(() => { - let obj = {a: 1, b: 2, ...{}}; - - assert.sameValue(obj.a, 1); - assert.sameValue(obj.b, 2); - assert.sameValue(Object.keys(obj).length, 2); -})(); - -// Ignoring cases - -(() => { - let obj = {a: 1, ...null, b: 2, ...undefined, c: 3, ...{}, ...{...{}}, d: 4}; - - assert.sameValue(obj.a, 1); - assert.sameValue(obj.b, 2); - assert.sameValue(obj.c, 3); - assert.sameValue(obj.d, 4); - - let keys = Object.keys(obj); - assert.sameValue(keys[0], "a"); - assert.sameValue(keys[1], "b"); - assert.sameValue(keys[2], "c"); - assert.sameValue(keys[3], "d"); -})(); - -// Null case - -(() => { - let obj = {a: 1, b: 2, ...null}; - - assert.sameValue(obj.a, 1); - assert.sameValue(obj.b, 2); - assert.sameValue(Object.keys(obj).length, 2); -})(); - -(() => { - let obj = {...null}; - - assert.sameValue(Object.keys(obj).length, 0); -})(); - -// Undefined case - -(() => { - let obj = {a: 1, b: 2, ...undefined}; - - assert.sameValue(obj.a, 1); - assert.sameValue(obj.b, 2); - assert.sameValue(Object.keys(obj).length, 2); -})(); - -(() => { - let obj = {...undefined}; - - assert.sameValue(Object.keys(obj).length, 0); -})(); - -// Getter case - -(() => { - let o = { - get a() { - return 42; - } - }; - - let obj = {...o, c: 4, d: 5}; - - assert.sameValue(Object.getOwnPropertyDescriptor(obj, "a").value, 42); - assert.sameValue(obj.c, 4); - assert.sameValue(obj.d, 5); - assert.sameValue(Object.keys(obj).length, 3); - - validatePropertyDescriptor(obj, "a"); -})(); - -(() => { - let o = {a: 2, b: 3} - let executedGetter = false; - - let obj = {...o, get c() { executedGetter = true; }}; - - assert.sameValue(obj.a, 2); - assert.sameValue(obj.b, 3); - assert.sameValue(executedGetter, false) - assert.sameValue(Object.keys(obj).length, 3); -})(); - -(() => { - let getterCallCount = 0; - let o = { - get a() { - return ++getterCallCount; - } - }; - - let obj = {...o, c: 4, d: 5, a: 42, ...o}; - - assert.sameValue(obj.a, 2); - assert.sameValue(obj.c, 4); - assert.sameValue(obj.d, 5); - assert.sameValue(Object.keys(obj).length, 3); -})(); - -// Manipulate Object case - -(() => { - var o = { a: 0, b: 1 }; - var cthulhu = { get x() { - delete o.a; - o.b = 42; - o.c = "ni"; - }}; - - let obj = {...cthulhu, ...o}; - - assert.sameValue(obj.hasOwnProperty("a"), false); - assert.sameValue(obj.b, 42); - assert.sameValue(obj.c, "ni"); - assert(obj.hasOwnProperty("x")); - assert.sameValue(Object.keys(obj).length, 3); -})(); - -// Override - -(() => { - let o = {a: 2, b: 3}; - - let obj = {a: 1, b: 7, ...o}; - - assert.sameValue(obj.a, 2); - assert.sameValue(obj.b, 3); - assert.sameValue(Object.keys(obj).length, 2); - assert.sameValue(o.a, 2); - assert.sameValue(o.b, 3); -})(); - -(() => { - let o = {a: 2, b: 3, c: 4, e: undefined, f: null, g: false}; - - let obj = {...o, a: 1, b: 7, d: 5, h: -0, i: Symbol("foo"), j: o}; - - assert.sameValue(obj.a, 1); - assert.sameValue(obj.b, 7); - assert.sameValue(obj.c, 4); - assert.sameValue(obj.d, 5); - assert(obj.hasOwnProperty("e")); - assert.sameValue(obj.f, null); - assert.sameValue(obj.g, false); - assert.sameValue(obj.h, -0); - assert.sameValue(obj.i.toString(), "Symbol(foo)"); - assert(Object.is(obj.j, o)); - assert.sameValue(Object.keys(obj).length, 10); -})(); - -// Override Immutable - -(() => { - let o = {b: 2}; - Object.defineProperty(o, "a", {value: 1, enumerable: true, writable: false, configurable: true}); - - let obj = {...o, a: 3}; - - assert.sameValue(obj.a, 3) - assert.sameValue(obj.b, 2); - validatePropertyDescriptor(obj, "a"); - validatePropertyDescriptor(obj, "b"); -})(); - -// Setter - -(() => { - let executedSetter = false; - - let obj = {set c(v) { executedSetter = true; }, ...{c: 1}}; - - assert.sameValue(obj.c, 1); - assert.sameValue(executedSetter, false); - assert.sameValue(Object.keys(obj).length, 1); -})(); - -// Skip non-enumerble - -(() => { - let o = {}; - Object.defineProperty(o, "b", {value: 3, enumerable: false}); - - let obj = {...o}; - - assert.sameValue(obj.hasOwnProperty("b"), false) - assert.sameValue(Object.keys(obj).length, 0); -})(); - -// Spread order - -(() => { - var calls = [] - var o = { get z() { calls.push('z') }, get a() { calls.push('a') } }; - Object.defineProperty(o, 1, { get: () => { calls.push(1) }, enumerable: true }); - Object.defineProperty(o, Symbol('foo'), { get: () => { calls.push("Symbol(foo)") }, enumerable: true }); - - let obj = {...o}; - - assert.sameValue(calls[0], 1); - assert.sameValue(calls[1], "z"); - assert.sameValue(calls[2], "a"); - assert.sameValue(calls[3], "Symbol(foo)"); - assert.sameValue(Object.keys(obj).length, 3); -})(); - -// Symbol property -(() => { - let symbol = Symbol('foo'); - let o = {}; - o[symbol] = 1; - - let obj = {...o, c: 4, d: 5}; - - assert.sameValue(obj[symbol], 1); - assert.sameValue(obj.c, 4); - assert.sameValue(obj.d, 5); - assert.sameValue(Object.keys(obj).length, 2); -})(); - -// Getter throw - -(() => { - try { - let obj = {...{ get foo() { throw new Error("Getter Exception"); } }}; - assert(false); - } catch(e) { - assert.sameValue(e.message, "Getter Exception"); - } -})(); - -// Spread overrides properties - -(() => { - var calls = [] - var o = { a: 1, b: 2 }; - - let executedGetter = false; - let executedSetter = false - let obj = {get a() {executedGetter = true; return this_a;}, ...o, set a(v) { executedSetter = true; this._a = v}}; - - obj.a = 3 - assert.sameValue(obj.a, undefined); - assert(!executedGetter); - assert(executedSetter); -})(); - diff --git a/implementation-contributed/javascriptcore/stress/object-sub.js b/implementation-contributed/javascriptcore/stress/object-sub.js deleted file mode 100644 index 69a14ad30b..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-sub.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a - b; -} - -noInline(foo); - -var things = [{valueOf: function() { return 4; }}]; -var results = [3]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 1); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/object-urshift.js b/implementation-contributed/javascriptcore/stress/object-urshift.js deleted file mode 100644 index 8517cc15f8..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-urshift.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a >>> b; -} - -noInline(foo); - -var things = [{valueOf: function() { return -4; }}]; -var results = [2147483646]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 1); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/object-values-changing-properties.js b/implementation-contributed/javascriptcore/stress/object-values-changing-properties.js deleted file mode 100644 index 8697efd8da..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-values-changing-properties.js +++ /dev/null @@ -1,96 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -{ - let source = { - get x() { - delete this.y; - return 42; - }, - y: 42 - }; - let result = Object.values(source); - shouldBe(result.length, 1); - shouldBe(result[0], 42); -} - -{ - let source = Object.defineProperties({}, { - nonEnumerable: { - enumerable: false, - value: 42 - } - }); - - let result = Object.values(source); - shouldBe(result.length, 0); -} - -{ - let order = []; - let target = {x: 20, y:42}; - let handler = { - getOwnPropertyDescriptor(theTarget, propName) - { - order.push(`getOwnPropertyDescriptor ${propName}`); - return { - enumerable: true, - configurable: true, - value: 42 - }; - }, - get(theTarget, propName, receiver) - { - order.push(`get ${propName}`); - return 20; - } - }; - - let proxy = new Proxy(target, handler); - let result = Object.values(proxy); - shouldBe(result.length, 2); - shouldBe(result[0], 20); - shouldBe(result[1], 20); - shouldBe(order.join(','), `getOwnPropertyDescriptor x,get x,getOwnPropertyDescriptor y,get y`); -} - -{ - let order = []; - let target = Object.defineProperties({}, { - x: { - enumerable: false, - configurable: true, - value: 20 - }, - y: { - enumerable: false, - configurable: true, - value: 42 - } - }); - - let handler = { - getOwnPropertyDescriptor(theTarget, propName) - { - order.push(`getOwnPropertyDescriptor ${propName}`); - return { - enumerable: false, - configurable: true, - value: 42 - }; - }, - get(theTarget, propName, receiver) - { - order.push(`get ${propName}`); - return 42; - } - }; - - let proxy = new Proxy(target, handler); - let result = Object.values(proxy); - shouldBe(result.length, 0); - shouldBe(order.join(','), `getOwnPropertyDescriptor x,getOwnPropertyDescriptor y`); -} diff --git a/implementation-contributed/javascriptcore/stress/object-values.js b/implementation-contributed/javascriptcore/stress/object-values.js deleted file mode 100644 index 0515d069c0..0000000000 --- a/implementation-contributed/javascriptcore/stress/object-values.js +++ /dev/null @@ -1,113 +0,0 @@ -var obj = Object.create({ a: "qux", d: "qux" }); -obj.a = "foo"; obj.b = "bar"; obj.c = "baz"; -var values = Object.values(obj); -var passed = Array.isArray(values) && String(values) === "foo,bar,baz"; - -if (!passed) - throw new Error("Object.values return wrong result."); - -var complexObject = { - obj : { - a: 'x', - b: 'y' - }, - primitive : 'z' -}; - -passed = false; -values = Object.values(complexObject); - -passed = values.length === 2 && values[0].a === 'x' && values[0].b === 'y' && values[1] === 'z'; - -if (!passed) - throw new Error("Object.values return wrong result."); - -values = Object.values({ a: 'abcdef' }); - -passed = values.length === 1 && values[0] === 'abcdef'; - -if (!passed) - throw new Error("Object.values return wrong result."); - -var primitives = [ - ["string", ['s', 't', 'r', 'i', 'n', 'g']], - [42, []], - [Symbol("symbol"), []], - [true, []], - [false, []] -]; - -function compare(ax, bx) { - if (ax.length !== bx.length) - return false; - for (var i = 0, iz = ax.length; i < iz; ++i) { - if (ax[i] !== bx[i]) - return false; - } - return true; -} - -for (var [primitive, expected] of primitives) { - var ret = Object.values(primitive); - if (!compare(ret, expected)) - throw new Error("bad value for " + String(primitive) + ": " + String(ret)); -} - -[ - [ null, "TypeError: Object.values requires that input parameter not be null or undefined" ], - [ undefined, "TypeError: Object.values requires that input parameter not be null or undefined" ] -].forEach(function ([value, message]) { - var error = null; - try { - Object.values(value); - } catch (e) { - error = e; - } - if (!error) - throw new Error("error not thrown"); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -}); - -const getInvokedFunctions = (obj) => { - let arr = [] - let p = new Proxy(obj, { - ownKeys: function(...args) { - arr.push("ownKeys"); - return Reflect.ownKeys(...args); - }, - getOwnPropertyDescriptor: function(...args) { - arr.push("getOwnPropertyDescriptor"); - return Reflect.getOwnPropertyDescriptor(...args); - } - }); - - Object.values(p); - return arr; -}; - -const arr1 = getInvokedFunctions({}); -passed = arr1.length === 1 && arr1[0] === "ownKeys"; - -if (!passed) - throw new Error("Object.values should invoke ownkeys."); - -const arr2 = getInvokedFunctions({a:'foo', b:'boo'}); -passed = arr2.length === 3 && arr2[0] === "ownKeys"; - -if (!passed) - throw new Error("Object.values should invoke ownkeys."); - -passed = arr2[1] === "getOwnPropertyDescriptor"; - -if (!passed) - throw new Error("Object.values should get property descriptor."); - -Array.prototype.push = function () { throw new Error("Array.prototype.push should not be used during invoking of Object.values.")}; -Object.getOwnPropertyDescriptor = function () { throw new Error("Array.prototype.getOwnPropertyDescriptor should not be used during invoking of Object.values.")}; - -values = Object.values({a:'1-2', b:'3-4'}); -passed = Array.isArray(values) && String(values) === "1-2,3-4"; - -if (!passed) - throw new Error("Object.values return wrong result."); \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/obscure-error-message-dont-crash.js b/implementation-contributed/javascriptcore/stress/obscure-error-message-dont-crash.js deleted file mode 100644 index 84a4cd24d8..0000000000 --- a/implementation-contributed/javascriptcore/stress/obscure-error-message-dont-crash.js +++ /dev/null @@ -1,13 +0,0 @@ -//@ runNoFTL - -let success = false; -try { - eval(`or ([[{break //comment - [[{aFY sga= - [[{a=Yth FunctionRY&=Ylet 'a'}V a`) -} catch(e) { - success = e.toString() === "SyntaxError: Unexpected token '//'. Expected a ':' following the property name 'break'."; -} - -if (!success) - throw new Error("Bad result") diff --git a/implementation-contributed/javascriptcore/stress/obviously-elidable-new-object-then-exit.js b/implementation-contributed/javascriptcore/stress/obviously-elidable-new-object-then-exit.js deleted file mode 100644 index faa5449ceb..0000000000 --- a/implementation-contributed/javascriptcore/stress/obviously-elidable-new-object-then-exit.js +++ /dev/null @@ -1,23 +0,0 @@ -function sumOfArithSeries(limit) { - return limit * (limit + 1) / 2; -} - -var n = 10000000; - -var array = [1, "hello"]; - -function foo() { - var result = 0; - var q; - for (var i = 0; i < n; ++i) { - var o = {f: i}; - var p = {f: i + 1}; - q = array[(i >= n - 100) | 0] + 1; - result += o.f + p.f; - } - return q + result; -} - -var result = foo(); -if (result != "hello" + 1 + (sumOfArithSeries(n - 1) + sumOfArithSeries(n))) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/op-add-exceptions.js b/implementation-contributed/javascriptcore/stress/op-add-exceptions.js deleted file mode 100644 index fc1ccd6c69..0000000000 --- a/implementation-contributed/javascriptcore/stress/op-add-exceptions.js +++ /dev/null @@ -1,79 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad!"); -} -noInline(assert); - -function f1() { return "f1"; } -noInline(f1); -function f2() { return "f2"; } -noInline(f2); -function f3() { return "f3"; } -noInline(f3); - -let oException = { - valueOf() { throw new Error(""); } -}; - -function foo(arg1, arg2) { - let a = f1(); - let b = f2(); - let c = f3(); - try { - arg1 + arg2; - } catch(e) { - assert(arg1 === oException); - assert(arg2 === oException); - } - assert(a === "f1"); - assert(b === "f2"); - assert(c === "f3"); -} -noInline(foo); - -for (let i = 0; i < 1000; i++) { - foo(i, {}); - foo({}, i); -} -foo(oException, oException); -for (let i = 0; i < 10000; i++) { - foo(i, {}); - foo({}, i); -} -foo(oException, oException); - - -function ident(x) { return x; } -noInline(ident); - -function bar(arg1, arg2) { - let a = f1(); - let b = f2(); - let c = f3(); - let x = ident(arg1); - let y = ident(arg2); - - try { - arg1 + arg2; - } catch(e) { - assert(arg1 === oException); - assert(arg2 === oException); - assert(x === oException); - assert(y === oException); - } - assert(a === "f1"); - assert(b === "f2"); - assert(c === "f3"); -} -noInline(bar); - -for (let i = 0; i < 1000; i++) { - bar(i, {}); - bar({}, i); -} -bar(oException, oException); -for (let i = 0; i < 10000; i++) { - bar(i, {}); - bar({}, i); -} -bar(oException, oException); diff --git a/implementation-contributed/javascriptcore/stress/op-negate-inline-cache.js b/implementation-contributed/javascriptcore/stress/op-negate-inline-cache.js deleted file mode 100644 index 7c54058dec..0000000000 --- a/implementation-contributed/javascriptcore/stress/op-negate-inline-cache.js +++ /dev/null @@ -1,300 +0,0 @@ -"use strict" - - -function opaqueIdentity(arg) { - return arg; -} -noInline(opaqueIdentity) -function negateWithDoubleSub(arg) { - // Implement integer negate as a double sub operation. - return opaqueIdentity(6.4 - arg) - 6.4; -} -noInline(negateWithDoubleSub) - -function opaqueNonZeroIntegerNegate(arg) -{ - return -arg; -} -noInline(opaqueNonZeroIntegerNegate); - -function testNonZeroInteger() -{ - for (let i = 1; i < 1e4; ++i) { - if (opaqueNonZeroIntegerNegate(i) !== negateWithDoubleSub(i)) { - throw "Failed testNonZeroInteger() at i = " + i; - } - } -} -testNonZeroInteger(); - - -function opaqueDoubleNegate(arg) -{ - return -arg; -} -noInline(opaqueDoubleNegate); - -function testDouble() -{ - for (let i = 0; i < 1e4; ++i) { - if ((opaqueDoubleNegate(i + 0.5)) + 0.5 + i !== 0) { - throw "Failed testDouble() at i = " + i; - } - } -} -testDouble(); - - -function opaqueObjectNegate(arg) -{ - return -arg; -} -noInline(opaqueObjectNegate); - -function testObject() -{ - for (let i = 0; i < 1e4; ++i) { - if ((opaqueObjectNegate({ valueOf: ()=>{ return i + 0.5 }})) + 0.5 + i !== 0) { - throw "Failed testObject() at i = " + i; - } - } -} -testObject(); - - -function opaqueIntegerAndDoubleNegate(arg) -{ - return -arg; -} -noInline(opaqueIntegerAndDoubleNegate); - -function testIntegerAndDouble() -{ - for (let i = 1; i < 1e4; ++i) { - if ((opaqueIntegerAndDoubleNegate(i)) + i !== 0) { - throw "Failed testIntegerAndDouble() on integers at i = " + i; - } - if ((opaqueIntegerAndDoubleNegate(i + 0.5)) + 0.5 + i !== 0) { - throw "Failed testIntegerAndDouble() on double at i = " + i; - } - } -} -testIntegerAndDouble(); - - -function opaqueIntegerThenDoubleNegate(arg) -{ - return -arg; -} -noInline(opaqueIntegerThenDoubleNegate); - -function testIntegerThenDouble() -{ - for (let i = 1; i < 1e4; ++i) { - if ((opaqueIntegerThenDoubleNegate(i)) + i !== 0) { - throw "Failed testIntegerThenDouble() on integers at i = " + i; - } - } - for (let i = 1; i < 1e4; ++i) { - if ((opaqueIntegerThenDoubleNegate(i + 0.5)) + 0.5 + i !== 0) { - throw "Failed testIntegerThenDouble() on double at i = " + i; - } - } -} -testIntegerThenDouble(); - - -function opaqueDoubleThenIntegerNegate(arg) -{ - return -arg; -} -noInline(opaqueDoubleThenIntegerNegate); - -function testDoubleThenInteger() -{ - for (let i = 1; i < 1e4; ++i) { - if ((opaqueDoubleThenIntegerNegate(i + 0.5)) + 0.5 + i !== 0) { - throw "Failed testDoubleThenInteger() on double at i = " + i; - } - } - for (let i = 1; i < 1e4; ++i) { - if ((opaqueDoubleThenIntegerNegate(i)) + i !== 0) { - throw "Failed testDoubleThenInteger() on integers at i = " + i; - } - } -} -testDoubleThenInteger(); - - -function opaqueIntegerAndObjectNegate(arg) -{ - return -arg; -} -noInline(opaqueIntegerAndObjectNegate); - -function testIntegerAndObject() -{ - for (let i = 1; i < 1e4; ++i) { - if ((opaqueIntegerAndObjectNegate(i)) + i !== 0) { - throw "Failed testIntegerAndObject() on integers at i = " + i; - } - if ((opaqueIntegerAndObjectNegate({ valueOf: ()=>{ return i + 0.5 }})) + 0.5 + i !== 0) { - throw "Failed testIntegerAndObject() on double at i = " + i; - } - } -} -testIntegerAndObject(); - - -function opaqueDoubleAndObjectNegate(arg) -{ - return -arg; -} -noInline(opaqueDoubleAndObjectNegate); - -function testDoubleAndObject() -{ - for (let i = 1; i < 1e4; ++i) { - if ((opaqueDoubleAndObjectNegate(i + 0.5)) + i + 0.5 !== 0) { - throw "Failed testDoubleAndObject() on integers at i = " + i; - } - if ((opaqueDoubleAndObjectNegate({ valueOf: ()=>{ return i }})) + i !== 0) { - throw "Failed testDoubleAndObject() on double at i = " + i; - } - } -} -testDoubleAndObject(); - - -function opaqueIntegerThenObjectNegate(arg) -{ - return -arg; -} -noInline(opaqueIntegerThenObjectNegate); - -function testIntegerThenObject() -{ - for (let i = 1; i < 1e4; ++i) { - if ((opaqueIntegerThenObjectNegate(i)) + i !== 0) { - throw "Failed testIntegerThenObject() on integers at i = " + i; - } - } - for (let i = 1; i < 1e4; ++i) { - if ((opaqueIntegerThenObjectNegate({ valueOf: ()=>{ return i + 0.5 }})) + 0.5 + i !== 0) { - throw "Failed testIntegerThenObject() on double at i = " + i; - } - } -} -testIntegerThenObject(); - - -function opaqueDoubleThenObjectNegate(arg) -{ - return -arg; -} -noInline(opaqueDoubleThenObjectNegate); - -function testDoubleThenObject() -{ - for (let i = 1; i < 1e4; ++i) { - if ((opaqueDoubleThenObjectNegate(i + 0.5)) + i + 0.5 !== 0) { - throw "Failed testDoubleThenObject() on integers at i = " + i; - } - } - for (let i = 1; i < 1e4; ++i) { - if ((opaqueDoubleThenObjectNegate(i + 0.5)) + i + 0.5 !== 0) { - throw "Failed testDoubleThenObject() on integers at i = " + i; - } - } -} -testDoubleThenObject(); - - -function opaqueIntegerAndDoubleAndObjectNegate(arg) -{ - return -arg; -} -noInline(opaqueIntegerAndDoubleAndObjectNegate); - -function testIntegerAndDoubleAndObject() -{ - for (let i = 1; i < 1e4; ++i) { - if ((opaqueIntegerAndDoubleAndObjectNegate(i)) + i !== 0) { - throw "Failed testIntegerAndDoubleAndObject() on integers at i = " + i; - } - if ((opaqueIntegerAndDoubleAndObjectNegate(i + 0.5)) + i + 0.5 !== 0) { - throw "Failed testIntegerAndDoubleAndObject() on integers at i = " + i; - } - if ((opaqueIntegerAndDoubleAndObjectNegate({ valueOf: ()=>{ return i }})) + i !== 0) { - throw "Failed testIntegerAndDoubleAndObject() on double at i = " + i; - } - } -} -testIntegerAndDoubleAndObject(); - - -function opaqueIntegerNegateOverflow(arg) -{ - return -arg; -} -noInline(opaqueIntegerNegateOverflow); - -function testIntegerNegateOverflow() -{ - for (let i = 1; i < 1e4; ++i) { - if (opaqueIntegerNegateOverflow(0x80000000|0) !== 2147483648) { - throw "Failed opaqueIntegerNegateOverflow() at i = " + i; - } - } -} -testIntegerNegateOverflow(); - - -function opaqueIntegerNegateZero(arg) -{ - return -arg; -} -noInline(opaqueIntegerNegateZero); - -function testIntegerNegateZero() -{ - for (let i = 1; i < 1e4; ++i) { - if (1 / opaqueIntegerNegateZero(0) !== -Infinity) { - throw "Failed testIntegerNegateZero() at i = " + i; - } - } -} -testIntegerNegateZero(); - - -function gatedNegate(selector, arg) -{ - if (selector === 0) { - return -arg; - } - if (selector == 42) { - return -arg; - } - return arg; -} -noInline(gatedNegate); - -function testUnusedNegate() -{ - for (let i = 1; i < 1e2; ++i) { - if (gatedNegate(Math.PI, i) !== i) { - throw "Failed first phase of testUnusedNegate"; - } - } - for (let i = 1; i < 1e4; ++i) { - if (gatedNegate(0, i) + i !== 0) { - throw "Failed second phase of testUnusedNegate"; - } - } - for (let i = 1; i < 1e4; ++i) { - if (gatedNegate(42, i + 0.5) + 0.5 + i !== 0) { - throw "Failed third phase of testUnusedNegate"; - } - } -} -testUnusedNegate(); diff --git a/implementation-contributed/javascriptcore/stress/op-push-name-scope-crashes-profiler.js b/implementation-contributed/javascriptcore/stress/op-push-name-scope-crashes-profiler.js deleted file mode 100644 index a7a8e1d195..0000000000 --- a/implementation-contributed/javascriptcore/stress/op-push-name-scope-crashes-profiler.js +++ /dev/null @@ -1,17 +0,0 @@ -//@ runProfiler -function test() { - (function functionName() { - ++counter; - if (!arguments[0]) - return; - eval("functionName(arguments[0] - 1, functionName, '' + functionName);"); - })(arguments[0]); -} - -for (var i = 0; i < 1000; ++i) { - counter = 0; - test(100); - if (counter !== 101) { - throw "Oops, test(100) = " + test(100) + ", expected 101."; - } -} diff --git a/implementation-contributed/javascriptcore/stress/op_add.js b/implementation-contributed/javascriptcore/stress/op_add.js deleted file mode 100644 index 6b613fb666..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_add.js +++ /dev/null @@ -1,63 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "add"; -var op = "+"; - -var o1 = { - valueOf: function() { return 10; } -}; - -var posInfinity = 1 / 0; -var negInfinity = -1 / 0; - -var values = [ - 'o1', - 'null', - 'undefined', - 'true', - 'false', - - 'NaN', - 'posInfinity', - 'negInfinity', - '100.2', // Some random small double value. - '-100.2', - '54294967296.2923', // Some random large double value. - '-54294967296.2923', - - '0', - '-0', - '1', - '-1', - '0x3fff', - '-0x3fff', - '0x7fff', - '-0x7fff', - '0x10000', - '-0x10000', - '0x7ffffff', - '-0x7ffffff', - '0x100000000', - '-0x100000000', - - '"abc"', - '"0"', - '"-0"', - '"1"', - '"-1"', -]; - -tests = []; -generateBinaryTests(tests, opName, op, "VarVar", values, values); -generateBinaryTests(tests, opName, op, "VarConst", values, values); -generateBinaryTests(tests, opName, op, "ConstVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_bitand.js b/implementation-contributed/javascriptcore/stress/op_bitand.js deleted file mode 100644 index b8d93e96d8..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_bitand.js +++ /dev/null @@ -1,69 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "bitand"; -var op = "&"; - -var o1 = { - valueOf: function() { return 10; } -}; - -var posInfinity = 1 / 0; -var negInfinity = -1 / 0; - -var values = [ - 'o1', - 'null', - 'undefined', - 'true', - 'false', - - 'NaN', - 'posInfinity', - 'negInfinity', - '100.2', // Some random small double value. - '-100.2', - '54294967296.2923', // Some random large double value. - '-54294967296.2923', - - '0', - '-0', - '1', - '-1', - '0x3fff', - '-0x3fff', - '0x7fff', - '-0x7fff', - '0x10000', - '-0x10000', - '0x7fffffff', - '-0x7fffffff', - '0xa5a5a5a5', - '0x100000000', - '-0x100000000', - - '"abc"', - '"0"', - '"-0"', - '"1"', - '"-1"', - '"0x7fffffff"', - '"-0x7fffffff"', - '"0xa5a5a5a5"', - '"0x100000000"', - '"-0x100000000"', -]; - -tests = []; -generateBinaryTests(tests, opName, op, "VarVar", values, values); -generateBinaryTests(tests, opName, op, "VarConst", values, values); -generateBinaryTests(tests, opName, op, "ConstVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_bitor.js b/implementation-contributed/javascriptcore/stress/op_bitor.js deleted file mode 100644 index 6ddcad8b70..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_bitor.js +++ /dev/null @@ -1,69 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "bitor"; -var op = "|"; - -var o1 = { - valueOf: function() { return 10; } -}; - -var posInfinity = 1 / 0; -var negInfinity = -1 / 0; - -var values = [ - 'o1', - 'null', - 'undefined', - 'true', - 'false', - - 'NaN', - 'posInfinity', - 'negInfinity', - '100.2', // Some random small double value. - '-100.2', - '54294967296.2923', // Some random large double value. - '-54294967296.2923', - - '0', - '-0', - '1', - '-1', - '0x3fff', - '-0x3fff', - '0x7fff', - '-0x7fff', - '0x10000', - '-0x10000', - '0x7fffffff', - '-0x7fffffff', - '0xa5a5a5a5', - '0x100000000', - '-0x100000000', - - '"abc"', - '"0"', - '"-0"', - '"1"', - '"-1"', - '"0x7fffffff"', - '"-0x7fffffff"', - '"0xa5a5a5a5"', - '"0x100000000"', - '"-0x100000000"', -]; - -tests = []; -generateBinaryTests(tests, opName, op, "VarVar", values, values); -generateBinaryTests(tests, opName, op, "VarConst", values, values); -generateBinaryTests(tests, opName, op, "ConstVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_bitxor.js b/implementation-contributed/javascriptcore/stress/op_bitxor.js deleted file mode 100644 index a6285bc7ba..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_bitxor.js +++ /dev/null @@ -1,69 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "bitxor"; -var op = "^"; - -var o1 = { - valueOf: function() { return 10; } -}; - -var posInfinity = 1 / 0; -var negInfinity = -1 / 0; - -var values = [ - 'o1', - 'null', - 'undefined', - 'true', - 'false', - - 'NaN', - 'posInfinity', - 'negInfinity', - '100.2', // Some random small double value. - '-100.2', - '54294967296.2923', // Some random large double value. - '-54294967296.2923', - - '0', - '-0', - '1', - '-1', - '0x3fff', - '-0x3fff', - '0x7fff', - '-0x7fff', - '0x10000', - '-0x10000', - '0x7fffffff', - '-0x7fffffff', - '0xa5a5a5a5', - '0x100000000', - '-0x100000000', - - '"abc"', - '"0"', - '"-0"', - '"1"', - '"-1"', - '"0x7fffffff"', - '"-0x7fffffff"', - '"0xa5a5a5a5"', - '"0x100000000"', - '"-0x100000000"', -]; - -tests = []; -generateBinaryTests(tests, opName, op, "VarVar", values, values); -generateBinaryTests(tests, opName, op, "VarConst", values, values); -generateBinaryTests(tests, opName, op, "ConstVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_div-ConstVar.js b/implementation-contributed/javascriptcore/stress/op_div-ConstVar.js deleted file mode 100644 index 7dc565cb13..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_div-ConstVar.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT("--timeoutMultiplier=2.0") - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "div"; -var op = "/"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "ConstVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_div-VarConst.js b/implementation-contributed/javascriptcore/stress/op_div-VarConst.js deleted file mode 100644 index 72eb2b5237..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_div-VarConst.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT("--timeoutMultiplier=2.0") - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "div"; -var op = "/"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "VarConst", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_div-VarVar.js b/implementation-contributed/javascriptcore/stress/op_div-VarVar.js deleted file mode 100644 index 05fd85f071..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_div-VarVar.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT("--timeoutMultiplier=2.0") - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "div"; -var op = "/"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "VarVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_lshift-ConstVar.js b/implementation-contributed/javascriptcore/stress/op_lshift-ConstVar.js deleted file mode 100644 index c0b3994c59..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_lshift-ConstVar.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "lshift"; -var op = "<<"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "ConstVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_lshift-VarConst.js b/implementation-contributed/javascriptcore/stress/op_lshift-VarConst.js deleted file mode 100644 index 0e32ba692f..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_lshift-VarConst.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "lshift"; -var op = "<<"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "VarConst", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_lshift-VarVar.js b/implementation-contributed/javascriptcore/stress/op_lshift-VarVar.js deleted file mode 100644 index 87349b8fe4..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_lshift-VarVar.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "lshift"; -var op = "<<"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "VarVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_mod-ConstVar.js b/implementation-contributed/javascriptcore/stress/op_mod-ConstVar.js deleted file mode 100644 index 489188ced1..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_mod-ConstVar.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT("--timeoutMultiplier=1.5") - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "mod"; -var op = "%"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "ConstVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_mod-VarConst.js b/implementation-contributed/javascriptcore/stress/op_mod-VarConst.js deleted file mode 100644 index f03a4d404a..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_mod-VarConst.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT("--timeoutMultiplier=1.5") - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "mod"; -var op = "%"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "VarConst", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_mod-VarVar.js b/implementation-contributed/javascriptcore/stress/op_mod-VarVar.js deleted file mode 100644 index 13436a97e2..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_mod-VarVar.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT("--timeoutMultiplier=1.5") - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "mod"; -var op = "%"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "VarVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_mul-ConstVar.js b/implementation-contributed/javascriptcore/stress/op_mul-ConstVar.js deleted file mode 100644 index c7fc287496..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_mul-ConstVar.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "mul"; -var op = "*"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "ConstVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_mul-VarConst.js b/implementation-contributed/javascriptcore/stress/op_mul-VarConst.js deleted file mode 100644 index 74b10e7799..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_mul-VarConst.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "mul"; -var op = "*"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "VarConst", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_mul-VarVar.js b/implementation-contributed/javascriptcore/stress/op_mul-VarVar.js deleted file mode 100644 index 27bfcdaf5a..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_mul-VarVar.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "mul"; -var op = "*"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "VarVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_negate.js b/implementation-contributed/javascriptcore/stress/op_negate.js deleted file mode 100644 index d98f04dbc7..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_negate.js +++ /dev/null @@ -1,75 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See unary-op-test.js for debugging options if needed. - -load("./resources/unary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "negate"; -var op = "-"; -var operatorType = "Prefix"; - -var o1 = { - valueOf: function() { return 10; } -}; - -var posInfinity = 1 / 0; -var negInfinity = -1 / 0; - -var values = [ - 'o1', - 'null', - 'undefined', - 'true', - 'false', - - 'NaN', - 'posInfinity', - 'negInfinity', - '100.2', // Some random small double value. - '-100.2', - '54294967296.2923', // Some random large double value. - '-54294967296.2923', - - '0', - '-0', - '1', - '-1', - '0x3fff', - '-0x3fff', - '0x7fff', - '-0x7fff', - '0x10000', - '-0x10000', - '0x7ffffff', - '-0x7ffffff', - '0x80000000', - '-0x80000000', - '0x100000000', - '-0x100000000', - - '"abc"', - '"0"', - '"-0"', - '"1"', - '"-1"', - '"0x3fff"', - '"-0x3fff"', - '"0x7fff"', - '"-0x7fff"', - '"0x10000"', - '"-0x10000"', - '"0x7ffffff"', - '"-0x7ffffff"', - '"0x100000000"', - '"-0x100000000"', -]; - -tests = []; -generateBinaryTests(tests, opName, operatorType, "ImmediateResult", op, values); -generateBinaryTests(tests, opName, operatorType, "PostResult", op, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_postdec.js b/implementation-contributed/javascriptcore/stress/op_postdec.js deleted file mode 100644 index b2e1fa7297..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_postdec.js +++ /dev/null @@ -1,75 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See unary-op-test.js for debugging options if needed. - -load("./resources/unary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "postdec"; -var op = "--"; -var operatorType = "Postfix"; - -var o1 = { - valueOf: function() { return 10; } -}; - -var posInfinity = 1 / 0; -var negInfinity = -1 / 0; - -var values = [ - 'o1', - 'null', - 'undefined', - 'true', - 'false', - - 'NaN', - 'posInfinity', - 'negInfinity', - '100.2', // Some random small double value. - '-100.2', - '54294967296.2923', // Some random large double value. - '-54294967296.2923', - - '0', - '-0', - '1', - '-1', - '0x3fff', - '-0x3fff', - '0x7fff', - '-0x7fff', - '0x10000', - '-0x10000', - '0x7ffffff', - '-0x7ffffff', - '0x80000000', - '-0x80000000', - '0x100000000', - '-0x100000000', - - '"abc"', - '"0"', - '"-0"', - '"1"', - '"-1"', - '"0x3fff"', - '"-0x3fff"', - '"0x7fff"', - '"-0x7fff"', - '"0x10000"', - '"-0x10000"', - '"0x7ffffff"', - '"-0x7ffffff"', - '"0x100000000"', - '"-0x100000000"', -]; - -tests = []; -generateBinaryTests(tests, opName, operatorType, "ImmediateResult", op, values); -generateBinaryTests(tests, opName, operatorType, "PostResult", op, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_postinc.js b/implementation-contributed/javascriptcore/stress/op_postinc.js deleted file mode 100644 index 08aa35d9d0..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_postinc.js +++ /dev/null @@ -1,75 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See unary-op-test.js for debugging options if needed. - -load("./resources/unary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "postinc"; -var op = "++"; -var operatorType = "Postfix"; - -var o1 = { - valueOf: function() { return 10; } -}; - -var posInfinity = 1 / 0; -var negInfinity = -1 / 0; - -var values = [ - 'o1', - 'null', - 'undefined', - 'true', - 'false', - - 'NaN', - 'posInfinity', - 'negInfinity', - '100.2', // Some random small double value. - '-100.2', - '54294967296.2923', // Some random large double value. - '-54294967296.2923', - - '0', - '-0', - '1', - '-1', - '0x3fff', - '-0x3fff', - '0x7fff', - '-0x7fff', - '0x10000', - '-0x10000', - '0x7ffffff', - '-0x7ffffff', - '0x80000000', - '-0x80000000', - '0x100000000', - '-0x100000000', - - '"abc"', - '"0"', - '"-0"', - '"1"', - '"-1"', - '"0x3fff"', - '"-0x3fff"', - '"0x7fff"', - '"-0x7fff"', - '"0x10000"', - '"-0x10000"', - '"0x7ffffff"', - '"-0x7ffffff"', - '"0x100000000"', - '"-0x100000000"', -]; - -tests = []; -generateBinaryTests(tests, opName, operatorType, "ImmediateResult", op, values); -generateBinaryTests(tests, opName, operatorType, "PostResult", op, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_predec.js b/implementation-contributed/javascriptcore/stress/op_predec.js deleted file mode 100644 index b8c65627eb..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_predec.js +++ /dev/null @@ -1,75 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See unary-op-test.js for debugging options if needed. - -load("./resources/unary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "predec"; -var op = "--"; -var operatorType = "Prefix"; - -var o1 = { - valueOf: function() { return 10; } -}; - -var posInfinity = 1 / 0; -var negInfinity = -1 / 0; - -var values = [ - 'o1', - 'null', - 'undefined', - 'true', - 'false', - - 'NaN', - 'posInfinity', - 'negInfinity', - '100.2', // Some random small double value. - '-100.2', - '54294967296.2923', // Some random large double value. - '-54294967296.2923', - - '0', - '-0', - '1', - '-1', - '0x3fff', - '-0x3fff', - '0x7fff', - '-0x7fff', - '0x10000', - '-0x10000', - '0x7ffffff', - '-0x7ffffff', - '0x80000000', - '-0x80000000', - '0x100000000', - '-0x100000000', - - '"abc"', - '"0"', - '"-0"', - '"1"', - '"-1"', - '"0x3fff"', - '"-0x3fff"', - '"0x7fff"', - '"-0x7fff"', - '"0x10000"', - '"-0x10000"', - '"0x7ffffff"', - '"-0x7ffffff"', - '"0x100000000"', - '"-0x100000000"', -]; - -tests = []; -generateBinaryTests(tests, opName, operatorType, "ImmediateResult", op, values); -generateBinaryTests(tests, opName, operatorType, "PostResult", op, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_preinc.js b/implementation-contributed/javascriptcore/stress/op_preinc.js deleted file mode 100644 index 22fb6ee618..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_preinc.js +++ /dev/null @@ -1,75 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See unary-op-test.js for debugging options if needed. - -load("./resources/unary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "preinc"; -var op = "++"; -var operatorType = "Prefix"; - -var o1 = { - valueOf: function() { return 10; } -}; - -var posInfinity = 1 / 0; -var negInfinity = -1 / 0; - -var values = [ - 'o1', - 'null', - 'undefined', - 'true', - 'false', - - 'NaN', - 'posInfinity', - 'negInfinity', - '100.2', // Some random small double value. - '-100.2', - '54294967296.2923', // Some random large double value. - '-54294967296.2923', - - '0', - '-0', - '1', - '-1', - '0x3fff', - '-0x3fff', - '0x7fff', - '-0x7fff', - '0x10000', - '-0x10000', - '0x7ffffff', - '-0x7ffffff', - '0x80000000', - '-0x80000000', - '0x100000000', - '-0x100000000', - - '"abc"', - '"0"', - '"-0"', - '"1"', - '"-1"', - '"0x3fff"', - '"-0x3fff"', - '"0x7fff"', - '"-0x7fff"', - '"0x10000"', - '"-0x10000"', - '"0x7ffffff"', - '"-0x7ffffff"', - '"0x100000000"', - '"-0x100000000"', -]; - -tests = []; -generateBinaryTests(tests, opName, operatorType, "ImmediateResult", op, values); -generateBinaryTests(tests, opName, operatorType, "PostResult", op, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_rshift-ConstVar.js b/implementation-contributed/javascriptcore/stress/op_rshift-ConstVar.js deleted file mode 100644 index f05993149b..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_rshift-ConstVar.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "rshift"; -var op = ">>"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "ConstVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_rshift-VarConst.js b/implementation-contributed/javascriptcore/stress/op_rshift-VarConst.js deleted file mode 100644 index 100cd9bad5..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_rshift-VarConst.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "rshift"; -var op = ">>"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "VarConst", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_rshift-VarVar.js b/implementation-contributed/javascriptcore/stress/op_rshift-VarVar.js deleted file mode 100644 index 116660d581..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_rshift-VarVar.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "rshift"; -var op = ">>"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "VarVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_sub-ConstVar.js b/implementation-contributed/javascriptcore/stress/op_sub-ConstVar.js deleted file mode 100644 index 75bbd5be82..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_sub-ConstVar.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "sub"; -var op = "-"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "ConstVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_sub-VarConst.js b/implementation-contributed/javascriptcore/stress/op_sub-VarConst.js deleted file mode 100644 index a61190a79f..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_sub-VarConst.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "sub"; -var op = "-"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "VarConst", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_sub-VarVar.js b/implementation-contributed/javascriptcore/stress/op_sub-VarVar.js deleted file mode 100644 index 629e80bbf1..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_sub-VarVar.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "sub"; -var op = "-"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "VarVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_urshift-ConstVar.js b/implementation-contributed/javascriptcore/stress/op_urshift-ConstVar.js deleted file mode 100644 index fdee0be6e9..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_urshift-ConstVar.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "urshift"; -var op = ">>>"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "ConstVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_urshift-VarConst.js b/implementation-contributed/javascriptcore/stress/op_urshift-VarConst.js deleted file mode 100644 index 8b4acedabb..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_urshift-VarConst.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "urshift"; -var op = ">>>"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "VarConst", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/op_urshift-VarVar.js b/implementation-contributed/javascriptcore/stress/op_urshift-VarVar.js deleted file mode 100644 index cb14aedf5f..0000000000 --- a/implementation-contributed/javascriptcore/stress/op_urshift-VarVar.js +++ /dev/null @@ -1,19 +0,0 @@ -//@ runFTLNoCJIT - -// If all goes well, this test module will terminate silently. If not, it will print -// errors. See binary-op-test.js for debugging options if needed. - -load("./resources/binary-op-test.js"); - -//============================================================================ -// Test configuration data: - -var opName = "urshift"; -var op = ">>>"; - -load("./resources/binary-op-values.js"); - -tests = []; -generateBinaryTests(tests, opName, op, "VarVar", values, values); - -run(); diff --git a/implementation-contributed/javascriptcore/stress/operation-get-by-val-default-should-not-called-for-already-optimized-site.js b/implementation-contributed/javascriptcore/stress/operation-get-by-val-default-should-not-called-for-already-optimized-site.js deleted file mode 100644 index d9e24c36df..0000000000 --- a/implementation-contributed/javascriptcore/stress/operation-get-by-val-default-should-not-called-for-already-optimized-site.js +++ /dev/null @@ -1,12 +0,0 @@ -function hello(object, name) -{ - return object[name]; -} -noInline(hello); -for (var i = 0; i < 100; ++i) - hello([0,1,2,3], 1); -hello([0.1,0.2,0.3,0.4], 1); -hello('string', 1); -hello('string', 1); -hello([true, false, true, false], 1); -hello([true, false, true, false], 1); diff --git a/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-array-storage.js b/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-array-storage.js deleted file mode 100644 index 986b922f2c..0000000000 --- a/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-array-storage.js +++ /dev/null @@ -1,19 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var k = -1; -var o1 = [20]; -o1[k] = 42; -ensureArrayStorage(o1); - -function test1(o) -{ - return k in o; -} -noInline(test1); - -for (var i = 0; i < 1e6; ++i) - shouldBe(test1(o1), true); diff --git a/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-contiguous-array.js b/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-contiguous-array.js deleted file mode 100644 index e574ba7fcc..0000000000 --- a/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-contiguous-array.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var k = -1; -var o1 = ["Cocoa"]; -o1[k] = 42; - -function test1(o) -{ - return k in o; -} -noInline(test1); - -for (var i = 0; i < 1e6; ++i) - shouldBe(test1(o1), true); diff --git a/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-double-array.js b/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-double-array.js deleted file mode 100644 index 130141876a..0000000000 --- a/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-double-array.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var k = -1; -var o1 = [42.5]; -o1[k] = 300.2; - -function test1(o) -{ - return k in o; -} -noInline(test1); - -for (var i = 0; i < 1e6; ++i) - shouldBe(test1(o1), true); diff --git a/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-generic-array.js b/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-generic-array.js deleted file mode 100644 index 75fb26304d..0000000000 --- a/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-generic-array.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var k = -1; -var o1 = []; -o1[k] = 42; - -function test1(o) -{ - return k in o; -} -noInline(test1); - -for (var i = 0; i < 1e6; ++i) - shouldBe(test1(o1), true); diff --git a/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-int32-array.js b/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-int32-array.js deleted file mode 100644 index 52d6da98d7..0000000000 --- a/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32-int32-array.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var k = -1; -var o1 = [20]; -o1[k] = 42; - -function test1(o) -{ - return k in o; -} -noInline(test1); - -for (var i = 0; i < 1e6; ++i) - shouldBe(test1(o1), true); diff --git a/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32.js b/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32.js deleted file mode 100644 index f54b2ee232..0000000000 --- a/implementation-contributed/javascriptcore/stress/operation-in-may-have-negative-int32.js +++ /dev/null @@ -1,32 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var k = -1; -var o1 = {}; -o1[k] = true; -var o2 = {}; - -function test1(o) -{ - return k in o; -} -noInline(test1); - -function test2(o) -{ - return k in o; -} -noInline(test2); - -for (var i = 0; i < 1e6; ++i) - shouldBe(test1(o1), true); -for (var i = 0; i < 1e6; ++i) - shouldBe(test1(o2), false); - -for (var i = 0; i < 1e6; ++i) - shouldBe(test2(o2), false); -for (var i = 0; i < 1e6; ++i) - shouldBe(test2(o1), true); diff --git a/implementation-contributed/javascriptcore/stress/operation-in-negative-int32-cast.js b/implementation-contributed/javascriptcore/stress/operation-in-negative-int32-cast.js deleted file mode 100644 index 685245c415..0000000000 --- a/implementation-contributed/javascriptcore/stress/operation-in-negative-int32-cast.js +++ /dev/null @@ -1,20 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var INT32_MIN = -2147483648; -var INT32_MIN_IN_UINT32 = 0x80000000; -var o1 = []; -o1[INT32_MIN_IN_UINT32] = true; -ensureArrayStorage(o1); - -function test1(o, key) -{ - return key in o; -} -noInline(test1); - -for (var i = 0; i < 1e6; ++i) - shouldBe(test1(o1, INT32_MIN), false); diff --git a/implementation-contributed/javascriptcore/stress/operation-in-throw-error.js b/implementation-contributed/javascriptcore/stress/operation-in-throw-error.js deleted file mode 100644 index 63a3d024ef..0000000000 --- a/implementation-contributed/javascriptcore/stress/operation-in-throw-error.js +++ /dev/null @@ -1,28 +0,0 @@ -(function testCase() { - var target = {}; - var handler = { - has: function (target, name) { - if (name === 'ng') - throw new Error('ng'); - return false; - } - }; - var proxy = new Proxy(target, handler); - var base = { - __proto__: proxy - }; - (function a() { - var thrown; - for (var i = 0; i < 1e4; ++i) { - thrown = null; - try { - 'ng' in base; - } catch (e) { - thrown = e; - } - - if (thrown === null) - throw new Error(`not thrown ${i}`); - } - }()); -}()); diff --git a/implementation-contributed/javascriptcore/stress/optional-catch-binding-syntax.js b/implementation-contributed/javascriptcore/stress/optional-catch-binding-syntax.js deleted file mode 100644 index f4b9854062..0000000000 --- a/implementation-contributed/javascriptcore/stress/optional-catch-binding-syntax.js +++ /dev/null @@ -1,30 +0,0 @@ -function testSyntax(script) { - try { - eval(script); - } catch (error) { - if (error instanceof SyntaxError) - throw new Error("Bad error: " + String(error)); - } -} - -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -testSyntax(`try { } catch { }`); -testSyntax(`try { } catch { } finally { }`); -testSyntaxError(`try { } catch { { }`, `SyntaxError: Unexpected end of script`); -testSyntaxError(`try { } catch () { }`, `SyntaxError: Unexpected token ')'. Expected a parameter pattern or a ')' in parameter list.`); -testSyntaxError(`try { } catch }`, `SyntaxError: Unexpected token '}'. Expected '(' to start a 'catch' target.`); -testSyntaxError(`try { } catch {`, `SyntaxError: Unexpected end of script`); -testSyntaxError(`try { } catch {`, `SyntaxError: Unexpected end of script`); diff --git a/implementation-contributed/javascriptcore/stress/optional-catch-binding.js b/implementation-contributed/javascriptcore/stress/optional-catch-binding.js deleted file mode 100644 index 34197530b5..0000000000 --- a/implementation-contributed/javascriptcore/stress/optional-catch-binding.js +++ /dev/null @@ -1,50 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function throwException() { - throw new Error(`Cocoa`); -} - -shouldBe(function () { - try { - throwException(); - } catch { - return true; - } - return false; -}(), true); - -shouldBe(function () { - var ok = false; - try { - throwException(); - } catch { - ok = true; - return false; - } finally { - return ok; - } - return false; -}(), true); - -shouldBe(function () { - let value = 'Cocoa'; - try { - throwException(); - } catch { - let value = 'Cappuccino'; - return value; - } -}(), 'Cappuccino'); - -shouldBe(function () { - var value = 'Cocoa'; - try { - throwException(); - } catch { - let value = 'Cappuccino'; - } - return value; -}(), 'Cocoa'); diff --git a/implementation-contributed/javascriptcore/stress/ordinary-set-exceptions.js b/implementation-contributed/javascriptcore/stress/ordinary-set-exceptions.js deleted file mode 100644 index 1221b864d0..0000000000 --- a/implementation-contributed/javascriptcore/stress/ordinary-set-exceptions.js +++ /dev/null @@ -1,100 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -// 9.1.9.1 4-a -shouldThrow(function () { - 'use strict'; - var target = {}; - var handler = {}; - var proxy = new Proxy(target, handler); - shouldBe(Reflect.defineProperty(target, 'cocoa', { - writable: false, - value: 42, - }), true); - proxy.cocoa = 'NG'; -}, `TypeError: Attempted to assign to readonly property.`); - -// 9.1.9.1 4-b -(function () { - 'use strict'; - var target = {}; - var handler = {}; - var proxy = new Proxy(target, handler); - shouldBe(Reflect.defineProperty(target, 'cocoa', { - writable: false, - value: 42, - }), true); - shouldBe(Reflect.set(proxy, 'cocoa', 'NG', 'Cocoa'), false); -}()); - -// 9.1.9.1 4-d-i -shouldThrow(function () { - 'use strict'; - var target = {}; - var proxy = new Proxy(target, { - get set() - { - shouldBe(Reflect.defineProperty(receiver, 'cocoa', { - set() { } - }), true); - return undefined; - } - }); - var receiver = { __proto__: proxy }; - shouldBe(Reflect.defineProperty(target, 'cocoa', { - writable: true, - value: 42, - }), true); - receiver.cocoa = 'NG'; -}, `TypeError: Attempted to assign to readonly property.`); - -// 9.1.9.1 4-d-ii -shouldThrow(function () { - 'use strict'; - var target = {}; - var proxy = new Proxy(target, { - get set() - { - shouldBe(Reflect.defineProperty(receiver, 'cocoa', { - value: 'hello', - writable: false - }), true); - return undefined; - } - }); - var receiver = { __proto__: proxy }; - shouldBe(Reflect.defineProperty(target, 'cocoa', { - writable: true, - value: 42, - }), true); - receiver.cocoa = 'NG'; -}, `TypeError: Attempted to assign to readonly property.`); - -// 9.1.9.1 7 -shouldThrow(function () { - 'use strict'; - var target = {}; - var proxy = new Proxy(target, {}); - var receiver = { __proto__: proxy }; - shouldBe(Reflect.defineProperty(target, 'cocoa', { - get() { } - }), true); - receiver.cocoa = 'NG'; -}, `TypeError: Attempted to assign to readonly property.`); diff --git a/implementation-contributed/javascriptcore/stress/osr-enter-to-catch-with-set-local-type-check-failure.js b/implementation-contributed/javascriptcore/stress/osr-enter-to-catch-with-set-local-type-check-failure.js deleted file mode 100644 index e357a2da45..0000000000 --- a/implementation-contributed/javascriptcore/stress/osr-enter-to-catch-with-set-local-type-check-failure.js +++ /dev/null @@ -1,38 +0,0 @@ -let flag = true; -function foo() { - if (flag) - return 20; - return {}; -} -noInline(foo); - -let state = 0; -function e() { - if ((++state) % 25 === 0) - throw new Error(); -} -noInline(e); - -function baz() { } -noInline(baz); - -function bar() { - let x = foo(); - try { - e(); - baz(++x); - } catch(e) { - baz(++x); - } finally { - baz(x); - } -} -noInline(bar); - -for (let i = 0; i < 2000; ++i) { - bar(); -} - -flag = false; -for (let i = 0; i < 1000; ++i) - bar(); diff --git a/implementation-contributed/javascriptcore/stress/osr-exit-on-op-negate-should-no-fail-assertions.js b/implementation-contributed/javascriptcore/stress/osr-exit-on-op-negate-should-no-fail-assertions.js deleted file mode 100644 index 708de6375d..0000000000 --- a/implementation-contributed/javascriptcore/stress/osr-exit-on-op-negate-should-no-fail-assertions.js +++ /dev/null @@ -1,22 +0,0 @@ -//@ runFTLNoCJIT -// This test passes if it does not crash or fail any assertions. - -function inlineable(x) { - return -x; -} - -function test(y) { - var results = []; - for (var j = 0; j < 300; j++) { - var k = j % y.length; - try { - results.push(inlineable(y[k])); - } catch (e) { - } - } -} -noInline(test); - -for (var i = 0; i < 1000; i++) { - test([false, -Infinity, Infinity, 0x50505050, undefined]); -} diff --git a/implementation-contributed/javascriptcore/stress/other-is-object-or-null.js b/implementation-contributed/javascriptcore/stress/other-is-object-or-null.js deleted file mode 100644 index 81c0b0ae96..0000000000 --- a/implementation-contributed/javascriptcore/stress/other-is-object-or-null.js +++ /dev/null @@ -1,13 +0,0 @@ -function foo(p) { - var x = p ? null : void 0; - return (typeof x) == "object"; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var p = !!(i & 1); - var result = foo(p); - if (result !== p) - throw "Error: bad result for p = " + p + ": " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/override-map-constructor.js b/implementation-contributed/javascriptcore/stress/override-map-constructor.js deleted file mode 100644 index a5c9b4b092..0000000000 --- a/implementation-contributed/javascriptcore/stress/override-map-constructor.js +++ /dev/null @@ -1,4 +0,0 @@ -// This used to crash because overriding Map as a variable, not property, would trigger a bug in getOwnPropertySlot. - -function Map() { -} diff --git a/implementation-contributed/javascriptcore/stress/pad-start-calls-repeat-character-with-double.js b/implementation-contributed/javascriptcore/stress/pad-start-calls-repeat-character-with-double.js deleted file mode 100644 index b583859ec1..0000000000 --- a/implementation-contributed/javascriptcore/stress/pad-start-calls-repeat-character-with-double.js +++ /dev/null @@ -1,43 +0,0 @@ -function logLinesWithContext(n, context) { - let start = n - context; - let end = n + context; - for (let x = start; x <= end; ++x) { - let number = x.toString().padStart(3); - if (parseInt(number) !== x) - throw new Error("Bad result from pad start: " + number); - } -} -noInline(logLinesWithContext); - -let numbers = [ - 19,19,19,19,19,19,19,20,20,20,20,20,20,20,11,11,11,11,11,11,11,20,20,20,20, - 20,20,20,15,15,15,15,15,15,15,21,21,21,21,21,21,21,19,19,19,19,19,19,19,20, - 20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,24,24,24,24,24, - 24,24,25,25,25,25,25,25,25,11,11,11,11,11,11,11,25,25,25,25,25,25,25,15,15, - 15,15,15,15,15,25,25,25,25,25,25,25,7,7,7,7,7,7,7,26,26,26,26,26,26,26,24, - 24,24,24,24,24,24,25,25,25,25,25,25,25,11,11,11,11,11,11,11,25,25,25,25,25, - 25,25,26,26,26,26,26,26,26,24,24,24,24,24,24,24,25,25,25,25,25,25,25,11,11, - 11,11,11,11,11,12,12,12,12,12,12,12,25,25,25,25,25,25,25,15,15,15,15,15,15, - 15,16,16,16,16,16,16,16,25,25,25,25,25,25,25,7,7,7,7,7,7,7,8,8,8,8,8,8,8, - 26,26,26,26,26,26,26,24,24,24,24,24,24,24,25,25,25,25,25,25,25,11,11,11,11, - 11,11,11,12,12,12,12,12,12,12,25,25,25,25,25,25,25,15,15,15,15,15,15,15,16, - 16,16,16,16,16,16,25,25,25,25,25,25,25,7,7,7,7,7,7,7,8,8,8,8,8,8,8,26,26, - 26,26,26,26,26,29,29,29,29,29,29,29,30,30,30,30,30,30,30,35,35,35,35,35,35, - 35,29,29,29,29,29,29,29,30,30,30,30,30,30,30,11,11,11,11,11,11,11,33,33,33, - 33,33,33,33,35,35,35,35,35,35,35,39,39,39,39,39,39,39,40,40,40,40,40,40,40, - 11,11,11,11,11,11,11,40,40,40,40,40,40,40,40,40,40,40,40,40,40,15,15,15,15, - 15,15,15,41,41,41,41,41,41,41,39,39,39,39,39,39,39,40,40,40,40,40,40,40,40, - 45,45,46,46,46,46,46,46,46,11,11,11,11,11,11,11,46,46,46,46,46,46,46,15,15, - 45,45,46,46,46,46,46,46,46,11,11,11,11,11,11,11,46,46,46,46,46,46,46,15,15, - 45,45,46,46,46,46,46,46,46,11,11,11,11,11,11,11,46,46,46,46,46,46,46,15,15, - 45,45,46,46,46,46,46,46,46,11,11,11,11,11,11,11,46,46,46,46,46,46,46,15,15, - 45,45,46,46,46,46,46,46,46,11,11,11,11,11,11,11,46,46,46,46,46,46,46,15,15, - 45,45,46,46,46,46,46,46,46,11,11,11,11,11,11,11,46,46,46,46,46,46,46,15,15, - 45,45,46,46,46,46,46,46,46,11,11,11,11,11,11,11,46,46,46,46,46,46,46,15,15, - 45,45,46,46,46,46,46,46,46,11,11,11,11,11,11,11,46,46,46,46,46,46,46,15,15, - 45,45,46,46,46,46,46,46,46,11,11,11,11,11,11,11,46,46,46,46,46,46,46,15,15, - 45,45,46,46,46,46,46,46,46,11,11,11,11,11,11,11,46,46,46,46,46,46,46,15,15, -]; - -for (let n of numbers) - logLinesWithContext(n, 3); diff --git a/implementation-contributed/javascriptcore/stress/parameter-scoping.js b/implementation-contributed/javascriptcore/stress/parameter-scoping.js deleted file mode 100644 index 0fb5deb3bf..0000000000 --- a/implementation-contributed/javascriptcore/stress/parameter-scoping.js +++ /dev/null @@ -1,236 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("bad"); -} - -function test(f) { - for (let i = 0; i < 1000; i++) - f(); -} - -test(function() { - function foo(a, b) { - assert(arguments[0] === a); - assert(arguments[1] === b); - assert(arguments.length === 2); - arguments[0] = "hello"; - arguments[1] = "world"; - assert(a === "hello"); - assert(b === "world"); - } - foo(null, null); -}); - -test(function() { - function foo(a, b) { - assert(arguments[0] === a); - assert(arguments[1] === b); - assert(arguments.length === 2); - a = "hello"; - b = "world"; - assert(arguments[0] === "hello"); - assert(arguments[1] === "world"); - } - foo(null, null); -}); - -test(function() { - function foo(a, b, ...rest) { - assert(arguments[0] === a); - assert(arguments[1] === b); - assert(arguments.length === 2); - arguments[0] = "hello"; - arguments[1] = "world"; - assert(a === null); - assert(b === null); - } - foo(null, null); -}); - -test(function() { - function foo(a, b, ...rest) { - assert(arguments[0] === a); - assert(arguments[1] === b); - assert(arguments.length === 2); - a = "hello"; - b = "world"; - assert(arguments[0] === null); - assert(arguments[1] === null); - } - foo(null, null); -}); - -test(function() { - function foo(a, b, {destructure}) { - assert(arguments[0] === a); - assert(arguments[1] === b); - assert(arguments.length === 3); - arguments[0] = "hello"; - arguments[1] = "world"; - assert(a === null); - assert(b === null); - } - foo(null, null, {}); -}); - -test(function() { - function foo(a, b, {destructure}) { - assert(arguments[0] === a); - assert(arguments[1] === b); - assert(arguments.length === 3); - a = "hello"; - b = "world"; - assert(arguments[0] === null); - assert(arguments[1] === null); - } - foo(null, null, {}); -}); - -test(function() { - function foo(a, b, defaultParam = 20) { - assert(arguments[0] === a); - assert(arguments[1] === b); - assert(arguments.length === 3); - arguments[0] = "hello"; - arguments[1] = "world"; - assert(a === null); - assert(b === null); - } - foo(null, null, {}); -}); - -test(function() { - function foo(a, b, defaultParam = 20) { - assert(arguments[0] === a); - assert(arguments[1] === b); - assert(arguments.length === 3); - a = "hello"; - b = "world"; - assert(arguments[0] === null); - assert(arguments[1] === null); - } - foo(null, null, {}); -}); - -test(function() { - let obj = {} - function foo(a, b, {foo = b}) { - assert(foo === b); - assert(foo === obj); - } - foo(null, obj, {}); -}); - -test(function() { - let obj = {} - function foo(a, b, {foo = b}) { - assert(foo === b); - assert(foo === obj); - function capB() { return b; } - } - foo(null, obj, {}); -}); - -test(function() { - let obj = {} - function foo(a, b, {foo = b}) { - assert(foo === 25); - } - foo(null, obj, {foo: 25}); -}); - -test(function() { - let obj = {} - function foo(a, b, {foo = function() { return b; }}) { - assert(foo() === b); - assert(foo() === obj); - return foo; - } - let result = foo(null, obj, {}); - assert(result() === obj); -}); - -test(function() { - let obj = {} - function foo(a, b, [foo = function() { return b; }]) { - assert(foo() === b); - assert(foo() === obj); - return foo; - } - let result = foo(null, obj, [undefined]); - assert(result() === obj); -}); - -test(function() { - let obj = {} - function foo(a, b, [foo = function() { return e; }], {d = foo()}, e) { } - foo(null, obj, [], {d:null}, 20); -}); - -test(function() { - let obj = {} - function foo(a, b, [foo = function() { return e; }], {d = foo()}, e) { } - try { - foo(null, obj, [], {}, 20); - } catch(e) { - assert(e.toString() === "ReferenceError: Cannot access uninitialized variable."); - } -}); - -test(function() { - let obj = {} - function foo(a, b, [foo = function() { return e; }], e, {d = foo()}) { - return d; - } - assert(foo(null, obj, [], 20, {}) === 20); -}); - -test(function() { - let obj = {} - function foo(a, b, [foo = function() { return e; }], e, {d = foo()}) { - var d; - assert(d === 20); - return d; - } - assert(foo(null, obj, [], 20, {}) === 20); -}); - -test(function() { - function foo(b, {a = function() { return b; }}) { - var b = 25; - assert(b === 25); - assert(a() === 20); - } - foo(20, {}); -}); - -test(function() { - function foo(b, {a = function() { return typeof inner; }}) { - let inner = 25; - assert(inner === 25); - assert(a() === "undefined"); - } - foo(20, {}); -}); - -test(function() { - let obj = {}; - let inner = obj; - function foo(b, {a = function() { return inner; }}) { - let inner = 25; - assert(inner === 25); - assert(a() === obj); - } - foo(20, {}); -}); - -test(function() { - let obj = {}; - let inner = obj; - let foo = (b, {a = function() { return inner; }}) => { - let inner = 25; - assert(inner === 25); - assert(a() === obj); - } - foo(20, {}); -}); diff --git a/implementation-contributed/javascriptcore/stress/parse-int-intrinsic-dfg-backend-flush.js b/implementation-contributed/javascriptcore/stress/parse-int-intrinsic-dfg-backend-flush.js deleted file mode 100644 index b66057c164..0000000000 --- a/implementation-contributed/javascriptcore/stress/parse-int-intrinsic-dfg-backend-flush.js +++ /dev/null @@ -1,14 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad") -} - -function foo(x) { - return x === parseInt(x, 10); -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - assert(!foo(`${i}`)); - assert(foo(i)); -} diff --git a/implementation-contributed/javascriptcore/stress/parse-int-intrinsic.js b/implementation-contributed/javascriptcore/stress/parse-int-intrinsic.js deleted file mode 100644 index 9be1a4dda4..0000000000 --- a/implementation-contributed/javascriptcore/stress/parse-int-intrinsic.js +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; - -function assert(b) { - if (!b) - throw new Error("Bad") -} - -function testIntrinsic(radix) { - let s = ` - { - function foo(n) { - n = n|0; - return parseInt(n, ${radix}); - } - noInline(foo); - for (let i = 0; i < 10000; i++) - assert(foo(i) === i); - assert(foo("20") === 20); - } - `; - - eval(s); -} - -testIntrinsic(10); -testIntrinsic(0); - -function testIntrinsic2() { - function baz(n) { - n = n | 0; - return parseInt(n, 16); - } - noInline(baz); - - for (let i = 0; i < 100000; i++) - assert(baz(i) === parseInt("0x" + i)); -} -noDFG(testIntrinsic2); -testIntrinsic2(); - -function testIntrinsic3() { - function foo(s) { - return parseInt(s) + 1; - } - noInline(foo); - - for (let i = 0; i < 100000; i++) - assert(foo(i + "") === i + 1); -} -noDFG(testIntrinsic3); -testIntrinsic3(); - -function testIntrinsic4() { - function foo(s) { - return parseInt(s, 0) + 1; - } - noInline(foo); - - for (let i = 0; i < 100000; i++) - assert(foo(i + "") === i + 1); -} -testIntrinsic4(); - -function testIntrinsic5() { - function foo(s) { - return parseInt(s, 10) + 1; - } - noInline(foo); - - for (let i = 0; i < 100000; i++) - assert(foo(i + "") === i + 1); -} -testIntrinsic5(); - -function testIntrinsic6() { - function foo(s) { - return parseInt(s, 16) + 1; - } - noInline(foo); - - for (let i = 0; i < 100000; i++) - assert(foo(i + "") === (parseInt("0x" + i) + 1)); -} -noDFG(testIntrinsic6); -testIntrinsic6(); - -function testIntrinsic7() { - function foo(s) { - return parseInt(s, 16) + parseInt(s, 16); - } - noInline(foo); - - for (let i = 0; i < 100000; i++) - assert(foo(i + "") === (parseInt("0x" + i) * 2)); -} -noDFG(testIntrinsic7); -testIntrinsic7(); diff --git a/implementation-contributed/javascriptcore/stress/parse-regexp-as-token.js b/implementation-contributed/javascriptcore/stress/parse-regexp-as-token.js deleted file mode 100644 index ebbfaeb88e..0000000000 --- a/implementation-contributed/javascriptcore/stress/parse-regexp-as-token.js +++ /dev/null @@ -1,7 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -var arrow = () => /Cocoa/; -shouldBe(arrow.toString(), `() => /Cocoa/`); diff --git a/implementation-contributed/javascriptcore/stress/path-sensitive-known-cell-crash.js b/implementation-contributed/javascriptcore/stress/path-sensitive-known-cell-crash.js deleted file mode 100644 index cc655f4c21..0000000000 --- a/implementation-contributed/javascriptcore/stress/path-sensitive-known-cell-crash.js +++ /dev/null @@ -1,21 +0,0 @@ -function bar(o) { - if (o.f) - return o.f; - else - return {e:41, f:42}; -} - -function foo(o) { - var c = bar(o); - return c.f; -} - -noInline(foo); - -// Warm up foo with some different object types. -for (var i = 0; i < 10000; ++i) { - foo({f:{k:0, f:1}}); - foo({g:1, f:{l: -1, f:2, g:3}}); - foo({h:2, f:null}); -} - diff --git a/implementation-contributed/javascriptcore/stress/pathname-resolve.js b/implementation-contributed/javascriptcore/stress/pathname-resolve.js deleted file mode 100644 index 5a2ca6b36c..0000000000 --- a/implementation-contributed/javascriptcore/stress/pathname-resolve.js +++ /dev/null @@ -1,64 +0,0 @@ -//@ skip -// To execute this test, need to specify the JSC_exposeInternalModuleLoader environment variable and execute it on non Windows platform. -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function shouldResolve(name, referrer, expected) -{ - var promise = Loader.resolve(name, referrer); - return promise.then(function (actual) { - shouldBe(actual, expected); - }); -} - -function shouldThrow(name, referrer, errorMessage) -{ - var notThrown = false; - return Loader.resolve(name, referrer).then(function (error) { - notThrown = true; - }).catch(function (error) { - shouldBe(String(error), errorMessage); - }).then(function () { - if (notThrown) - throw new Error("not thrown"); - }); -} - -var error = null; - -// On windows platform, all "/" becomes "\". -Promise.all([ - shouldResolve('tmp.js', '/home/WebKit/', '/home/WebKit/tmp.js'), - shouldResolve('tmp.js', '/home/', '/home/tmp.js'), - shouldResolve('/tmp.js', '/home/WebKit/', '/tmp.js'), - shouldResolve('///tmp.js', '/home/WebKit/', '/tmp.js'), - shouldResolve('.///tmp.js', '/home/WebKit/', '/home/WebKit/tmp.js'), - shouldResolve('./../tmp.js', '/home/WebKit/', '/home/tmp.js'), - shouldResolve('./../../tmp.js', '/home/WebKit/', '/tmp.js'), - shouldResolve('./../../../tmp.js', '/home/WebKit/', '/tmp.js'), - shouldResolve('./../../home/../tmp.js', '/home/WebKit/', '/tmp.js'), - shouldResolve('./../../../home/WebKit/../tmp.js', '/home/WebKit/', '/home/tmp.js'), - shouldResolve('../home/WebKit/tmp.js', '/home/WebKit/', '/home/home/WebKit/tmp.js'), - shouldResolve('../home/WebKit/../tmp.js', '/home/WebKit/', '/home/home/tmp.js'), - shouldResolve('./tmp.js', '/home/WebKit/hello.js', '/home/WebKit/tmp.js'), - - shouldResolve('./tmp.js', 'C:/', 'C:/tmp.js'), - shouldResolve('./tmp.js', 'C:/home/', 'C:/home/tmp.js'), - shouldResolve('../tmp.js', 'C:/home/', 'C:/tmp.js'), - shouldResolve('../../tmp.js', 'C:/home/', 'C:/tmp.js'), - shouldResolve('./hello/tmp.js', 'C:/home/', 'C:/home/hello/tmp.js'), - shouldResolve('/tmp.js', 'C:/home/', 'C:/tmp.js'), - - shouldThrow('/tmp.js', '', `Error: Could not resolve the referrer name ''.`), - shouldThrow('/tmp.js', 'hello', `Error: Could not resolve the referrer name 'hello'.`), - shouldThrow('tmp.js', 'hello', `Error: Could not resolve the referrer name 'hello'.`), -]).catch(function (e) { - error = e; -}); - -// Force to run all pending tasks. -drainMicrotasks(); -if (error) - throw error; diff --git a/implementation-contributed/javascriptcore/stress/phantom-arguments-set-local-then-exit-in-same-block.js b/implementation-contributed/javascriptcore/stress/phantom-arguments-set-local-then-exit-in-same-block.js deleted file mode 100644 index fe64414bf5..0000000000 --- a/implementation-contributed/javascriptcore/stress/phantom-arguments-set-local-then-exit-in-same-block.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo(o) { - var a = arguments; - var result = o.f; - for (var i = 1; i < a.length; ++i) - result += a[i]; - return result; -} - -noInline(foo); - -for (var i = 0; i < 100; ++i) - foo({f:42}, 1, 2, 3); - -var result = foo({g:40, f:41}, 1, 2.5, 3); -if (result != 47.5) - throw "Bad result: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/phantom-direct-arguments-clobber-argument-count.js b/implementation-contributed/javascriptcore/stress/phantom-direct-arguments-clobber-argument-count.js deleted file mode 100644 index eb504772f5..0000000000 --- a/implementation-contributed/javascriptcore/stress/phantom-direct-arguments-clobber-argument-count.js +++ /dev/null @@ -1,20 +0,0 @@ -function foo() { - return effectful42.apply(this, arguments); -} - -function bar(a, b) { - var result = foo.apply(this, b); - return [a, a, a, a, a, a, a, a, result + a]; -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var result = "" + bar(1, []); - if (result != "1,1,1,1,1,1,1,1,43") - throw "Error: bad result: " + result; -} - -var result = "" + bar(2147483647, []); -if (result != "2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483689") - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/phantom-direct-arguments-clobber-callee.js b/implementation-contributed/javascriptcore/stress/phantom-direct-arguments-clobber-callee.js deleted file mode 100644 index 70588f8d69..0000000000 --- a/implementation-contributed/javascriptcore/stress/phantom-direct-arguments-clobber-callee.js +++ /dev/null @@ -1,21 +0,0 @@ -function foo() { - return function() { return effectful42.apply(this, arguments) }; -} -noInline(foo); - -function bar(a) { - var result = foo()(); - return [result, result, result, result, result, result, result, result, result + a]; -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var result = "" + bar(1); - if (result != "42,42,42,42,42,42,42,42,43") - throw "Error: bad result: " + result; -} - -var result = "" + bar(2147483647); -if (result != "42,42,42,42,42,42,42,42,2147483689") - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/phantom-inadequacy.js b/implementation-contributed/javascriptcore/stress/phantom-inadequacy.js deleted file mode 100644 index bb72e22d34..0000000000 --- a/implementation-contributed/javascriptcore/stress/phantom-inadequacy.js +++ /dev/null @@ -1,33 +0,0 @@ -function bar() { - return 42.5; -} -noInline(bar); - -function baz(value) { - if (value != 42.5) - throw "Error: bad value: " + value; -} -noInline(baz); - -var True = true; -function foo(a) { - var x = bar(); - var tmp = 0; - if (True) { - var tmp2 = x; - tmp = a + 1; - baz(tmp2); - } - return x + 1 + tmp; -} -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(1); - if (result != 42.5 + 1 + 1 + 1) - throw "Error: bad result: " + result; -} - -var result = foo(2147483647); -if (result != 42.5 + 1 + 2147483647 + 1) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/phantom-local-captured-but-not-flushed-to-ssa.js b/implementation-contributed/javascriptcore/stress/phantom-local-captured-but-not-flushed-to-ssa.js deleted file mode 100644 index 19699af6d6..0000000000 --- a/implementation-contributed/javascriptcore/stress/phantom-local-captured-but-not-flushed-to-ssa.js +++ /dev/null @@ -1,21 +0,0 @@ -function foo(x, y) { - if (y) { - if (x < 10) - x = 15; - } - if (false) - arguments[0] = 42; - return x; -} - -function bar(x) { - return foo(10, x); -} - -noInline(bar); - -for (var i = 0; i < 100000; ++i) { - var result = bar(true); - if (result != 10) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/phantom-new-array-buffer-forward-varargs.js b/implementation-contributed/javascriptcore/stress/phantom-new-array-buffer-forward-varargs.js deleted file mode 100644 index 4e08665ff3..0000000000 --- a/implementation-contributed/javascriptcore/stress/phantom-new-array-buffer-forward-varargs.js +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; - -function assert(b, m="") { - if (!b) - throw new Error("Bad assertion: " + m); -} -noInline(assert); - -function test1() { - function bar(a, b, c, d) { - return [a, b, c, d]; - } - function foo() { - return bar(...[0, 1, 2, 3]); - } - noInline(foo); - - for (let i = 0; i < 10000; i++) { - let [a, b, c, d] = foo(); - assert(a === 0); - assert(b === 1); - assert(c === 2); - assert(d === 3) ; - } -} - -function test2() { - function bar(...args) { - return args; - } - function foo() { - let args = [1, 2, 3]; - return bar(...args, 0, ...args); - } - noInline(foo); - - for (let i = 0; i < 10000; i++) { - let r = foo(); - assert(r.length === 7); - let [a, b, c, d, e, f, g] = r; - assert(a === 1); - assert(b === 2); - assert(c === 3); - assert(d === 0); - assert(e === 1); - assert(f === 2); - assert(g === 3); - } -} - -function test3() { - function baz(...args) { - return args; - } - function bar(...args) { - return baz(...args); - } - function foo() { - let args = [3]; - return bar(...args, 0, ...args); - } - noInline(foo); - - for (let i = 0; i < 100000; i++) { - let r = foo(); - assert(r.length === 3); - let [a, b, c] = r; - assert(a === 3); - assert(b === 0); - assert(c === 3); - } -} - -function test4() { - function baz(...args) { - return args; - } - function bar(...args) { - return baz(...args); - } - function foo() { - let args = []; - return bar(...args, 0, ...args); - } - noInline(foo); - - for (let i = 0; i < 100000; i++) { - let r = foo(); - assert(r.length === 1); - assert(r[0] === 0); - } -} - -test1(); -test2(); -test3(); -test4(); diff --git a/implementation-contributed/javascriptcore/stress/phantom-new-array-buffer-forward-varargs2.js b/implementation-contributed/javascriptcore/stress/phantom-new-array-buffer-forward-varargs2.js deleted file mode 100644 index 5a1e306c5b..0000000000 --- a/implementation-contributed/javascriptcore/stress/phantom-new-array-buffer-forward-varargs2.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; - -function assert(b, m="") { - if (!b) - throw new Error("Bad assertion: " + m); -} -noInline(assert); - -function test() { - function baz(...args) { - return args; - } - function bar(...args) { - return baz(...args); - } - function foo(a, b, c, ...args) { - return bar(...args, a, ...[0, 1, 2]); - } - noInline(foo); - - for (let i = 0; i < 100000; i++) { - let r = foo(i, i+1, i+2, i+3); - assert(r.length === 5); - let [a, b, c, d, e] = r; - assert(a === i+3); - assert(b === i); - assert(c === 0); - assert(d === 1); - assert(e === 2); - } -} - -test(); diff --git a/implementation-contributed/javascriptcore/stress/phantom-new-array-buffer-osr-exit.js b/implementation-contributed/javascriptcore/stress/phantom-new-array-buffer-osr-exit.js deleted file mode 100644 index bc913b2a60..0000000000 --- a/implementation-contributed/javascriptcore/stress/phantom-new-array-buffer-osr-exit.js +++ /dev/null @@ -1,46 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion!"); -} -noInline(assert); - -let value = false; - -function baz(x) { - if (typeof x !== "number") { - value = true; - } - return x; -} -noInline(baz); - -function bar(...args) { - return args; -} - -let didEffects = false; -function effects() { didEffects = true; } -noInline(effects); - -function foo(a) { - let args = [1]; - let theArgs = [...args, a, ...args]; - baz(a); - if (value) { - effects(); - } - let r = bar.apply(null, theArgs); - return r; -} -noInline(foo); - -for (let i = 0; i < 100000; i++) { - foo(i); - assert(!didEffects); -} -let o = {}; -let [a, b, c] = foo(o); -assert(a === 1); -assert(b === o); -assert(c === 1); -assert(didEffects); diff --git a/implementation-contributed/javascriptcore/stress/phantom-new-array-with-spread-osr-exit.js b/implementation-contributed/javascriptcore/stress/phantom-new-array-with-spread-osr-exit.js deleted file mode 100644 index 5109ab007b..0000000000 --- a/implementation-contributed/javascriptcore/stress/phantom-new-array-with-spread-osr-exit.js +++ /dev/null @@ -1,45 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion!"); -} -noInline(assert); - -let value = false; - -function baz(x) { - if (typeof x !== "number") { - value = true; - } - return x; -} -noInline(baz); - -function bar(...args) { - return args; -} - -let didEffects = false; -function effects() { didEffects = true; } -noInline(effects); - -function foo(a, ...args) { - let theArgs = [...args, a, ...args]; - baz(a); - if (value) { - effects(); - } - let r = bar.apply(null, theArgs); - return r; -} -noInline(foo); - -for (let i = 0; i < 100000; i++) { - foo(i, i+1); - assert(!didEffects); -} -let o = {}; -let [a, b, c] = foo(o, 20); -assert(a === 20); -assert(b === o); -assert(c === 20); -assert(didEffects); diff --git a/implementation-contributed/javascriptcore/stress/phantom-regexp-regexp-exec.js b/implementation-contributed/javascriptcore/stress/phantom-regexp-regexp-exec.js deleted file mode 100644 index c37782b56e..0000000000 --- a/implementation-contributed/javascriptcore/stress/phantom-regexp-regexp-exec.js +++ /dev/null @@ -1,26 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(string, flag) -{ - var regexp = /oa/; - var result = regexp.exec(string); - if (flag) - return regexp; - return result; -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - if (i & 1) { - var result = test("Cocoa", true); - shouldBe(result instanceof RegExp, true); - } else { - var result = test("Cocoa", false); - shouldBe(result.input, "Cocoa"); - shouldBe(result[0], "oa"); - } -} diff --git a/implementation-contributed/javascriptcore/stress/phantom-regexp-string-match.js b/implementation-contributed/javascriptcore/stress/phantom-regexp-string-match.js deleted file mode 100644 index 345089fbe2..0000000000 --- a/implementation-contributed/javascriptcore/stress/phantom-regexp-string-match.js +++ /dev/null @@ -1,26 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(string, flag) -{ - var regexp = /oa/; - var result = string.match(regexp); - if (flag) - return regexp; - return result; -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - if (i & 1) { - var result = test("Cocoa", true); - shouldBe(result instanceof RegExp, true); - } else { - var result = test("Cocoa", false); - shouldBe(result.input, "Cocoa"); - shouldBe(result[0], "oa"); - } -} diff --git a/implementation-contributed/javascriptcore/stress/phantom-spread-forward-varargs.js b/implementation-contributed/javascriptcore/stress/phantom-spread-forward-varargs.js deleted file mode 100644 index f9a22e2d2e..0000000000 --- a/implementation-contributed/javascriptcore/stress/phantom-spread-forward-varargs.js +++ /dev/null @@ -1,117 +0,0 @@ -"use strict"; - -function assert(b, m="") { - if (!b) - throw new Error("Bad assertion: " + m); -} -noInline(assert); - -function test1() { - function bar(a, b, c, d) { - return [a, b, c, d]; - } - function foo(...args) { - return bar(...args); - } - noInline(foo); - - for (let i = 0; i < 10000; i++) { - let [a, b, c, d] = foo(i, i+1, i+2, i+3); - assert(a === i); - assert(b === i+1); - assert(c === i+2); - assert(d === i+3) ; - } -} - -function test2() { - function bar(...args) { - return args; - } - function foo(a, ...args) { - return bar(...args, a, ...args); - } - noInline(foo); - - for (let i = 0; i < 10000; i++) { - let r = foo(i, i+1, i+2, i+3); - assert(r.length === 7); - let [a, b, c, d, e, f, g] = r; - assert(a === i+1); - assert(b === i+2); - assert(c === i+3); - assert(d === i); - assert(e === i+1); - assert(f === i+2); - assert(g === i+3); - } -} - -function test3() { - function baz(...args) { - return args; - } - function bar(...args) { - return baz(...args); - } - function foo(a, b, c, ...args) { - return bar(...args, a, ...args); - } - noInline(foo); - - for (let i = 0; i < 100000; i++) { - let r = foo(i, i+1, i+2, i+3); - assert(r.length === 3); - let [a, b, c] = r; - assert(a === i+3); - assert(b === i); - assert(c === i+3); - } -} - -function test4() { - function baz(...args) { - return args; - } - function bar(...args) { - return baz(...args); - } - function foo(a, b, c, d, ...args) { - return bar(...args, a, ...args); - } - noInline(foo); - - for (let i = 0; i < 100000; i++) { - let r = foo(i, i+1, i+2, i+3); - assert(r.length === 1); - assert(r[0] === i); - } -} - -function test5() { - function baz(a, b, c) { - return [a, b, c]; - } - function bar(...args) { - return baz(...args); - } - function foo(a, b, c, d, ...args) { - return bar(...args, a, ...args); - } - noInline(foo); - - for (let i = 0; i < 100000; i++) { - let r = foo(i, i+1, i+2, i+3); - assert(r.length === 3); - let [a, b, c] = r; - assert(a === i); - assert(b === undefined); - assert(c === undefined); - } -} - -test1(); -test2(); -test3(); -test4(); -test5(); diff --git a/implementation-contributed/javascriptcore/stress/phantom-spread-osr-exit.js b/implementation-contributed/javascriptcore/stress/phantom-spread-osr-exit.js deleted file mode 100644 index c9189f95cf..0000000000 --- a/implementation-contributed/javascriptcore/stress/phantom-spread-osr-exit.js +++ /dev/null @@ -1,43 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion!"); -} -noInline(assert); - -let value = false; - -function baz(x) { - if (typeof x !== "number") { - value = true; - } - return x; -} -noInline(baz); - -function bar(...args) { - return args; -} - -let didEffects = false; -function effects() { didEffects = true; } -noInline(effects); - -function foo(a, ...args) { - let r = bar(...args, baz(a), ...args); - if (value) { - effects(); - } - return r; -} -noInline(foo); - -for (let i = 0; i < 100000; i++) { - foo(i, i+1); - assert(!didEffects); -} -let o = {}; -let [a, b, c] = foo(o, 20); -assert(a === 20); -assert(b === o); -assert(c === 20); -assert(didEffects); diff --git a/implementation-contributed/javascriptcore/stress/plus-boolean-exit.js b/implementation-contributed/javascriptcore/stress/plus-boolean-exit.js deleted file mode 100644 index e02141d589..0000000000 --- a/implementation-contributed/javascriptcore/stress/plus-boolean-exit.js +++ /dev/null @@ -1,22 +0,0 @@ -function foo(a, b) { - return a.f + b.f; -} - -noInline(foo); - -function test(a, b, c) { - var result = foo({f:a}, {f:b}); - if (result != c) - throw "Error: expected " + c + " but got: " + result; -} - -for (var i = 0; i < 100000; ++i) - test(true, 42, 43); - -// Now try some unexpected things, in descending order of possible badness. -test(true, 2147483647, 2147483648); -test(false, 42, 42); -test(1, 2, 3); -test(true, true, 2); -test(1.5, 1.5, 3); - diff --git a/implementation-contributed/javascriptcore/stress/plus-boolean-or-double.js b/implementation-contributed/javascriptcore/stress/plus-boolean-or-double.js deleted file mode 100644 index 4caa2f08b5..0000000000 --- a/implementation-contributed/javascriptcore/stress/plus-boolean-or-double.js +++ /dev/null @@ -1,24 +0,0 @@ -function foo(a, b) { - return a.f + b.f; -} - -noInline(foo); - -function test(a, b, c) { - var result = foo({f:a}, {f:b}); - if (result != c) - throw "Error: expected " + c + " but got: " + result; -} - -for (var i = 0; i < 100000; ++i) { - test(true, 42, 43); - test(42.5, 10, 52.5); -} - -// Now try some unexpected things, in descending order of possible badness. -test(true, 2147483647, 2147483648); -test(false, 42, 42); -test(1, 2, 3); -test(true, true, 2); -test(1.5, 1.5, 3); - diff --git a/implementation-contributed/javascriptcore/stress/plus-boolean-or-int.js b/implementation-contributed/javascriptcore/stress/plus-boolean-or-int.js deleted file mode 100644 index a1d3d5cba4..0000000000 --- a/implementation-contributed/javascriptcore/stress/plus-boolean-or-int.js +++ /dev/null @@ -1,24 +0,0 @@ -function foo(a, b) { - return a.f + b.f; -} - -noInline(foo); - -function test(a, b, c) { - var result = foo({f:a}, {f:b}); - if (result != c) - throw "Error: expected " + c + " but got: " + result; -} - -for (var i = 0; i < 100000; ++i) { - test(true, 42, 43); - test(42, 10, 52); -} - -// Now try some unexpected things, in descending order of possible badness. -test(true, 2147483647, 2147483648); -test(false, 42, 42); -test(1, 2, 3); -test(true, true, 2); -test(1.5, 1.5, 3); - diff --git a/implementation-contributed/javascriptcore/stress/poly-call-exit-this.js b/implementation-contributed/javascriptcore/stress/poly-call-exit-this.js deleted file mode 100644 index 596af3e33e..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-call-exit-this.js +++ /dev/null @@ -1,29 +0,0 @@ -(function() { - function foo(x) { return 1 + this.f; } - function bar(x) { return x + this.f; } - function baz(x) { return x + 1 + this.f; } - - var n = 1000000; - - var result = (function(o) { - var f = {fun:foo, f:1}; - var g = {fun:bar, f:2}; - var h = {fun:baz, f:3}; - - var result = 0; - for (var i = 0; i < n; ++i) { - if (i == n - 1) - f = h; - result += f.fun(o.f); - - var tmp = f; - f = g; - g = tmp; - } - - return result; - })({f:42}); - - if (result != ((n / 2 - 1) * (42 + 2)) + (n / 2 * (1 + 1) + (42 + 1 + 3))) - throw "Error: bad result: " + result; -})(); diff --git a/implementation-contributed/javascriptcore/stress/poly-call-exit.js b/implementation-contributed/javascriptcore/stress/poly-call-exit.js deleted file mode 100644 index eadd16ac4c..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-call-exit.js +++ /dev/null @@ -1,29 +0,0 @@ -(function() { - function foo(x) { return 1; } - function bar(x) { return x; } - function baz(x) { return x + 1; } - - var n = 1000000; - - var result = (function(o) { - var f = foo; - var g = bar; - var h = baz; - - var result = 0; - for (var i = 0; i < n; ++i) { - if (i == n - 1) - f = h; - result += f(o.f); - - var tmp = f; - f = g; - g = tmp; - } - - return result; - })({f:42}); - - if (result != ((n / 2 - 1) * 42) + (n / 2 * 1) + (42 + 1)) - throw "Error: bad result: " + result; -})(); diff --git a/implementation-contributed/javascriptcore/stress/poly-call-stub-in-getter-stub.js b/implementation-contributed/javascriptcore/stress/poly-call-stub-in-getter-stub.js deleted file mode 100644 index d774796cfc..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-call-stub-in-getter-stub.js +++ /dev/null @@ -1,37 +0,0 @@ -function foo(o) { - return o.f; -} - -noInline(foo); - -var p = {f:42}; - -var doBadThings = false; -function makeGetter() { - return function() { - if (doBadThings) { - delete p.f; - fullGC(); - return 43; - } - return 42; - }; -} - -for (var i = 0; i < 10000; ++i) { - var o = Object.create(p); - if (i & 1) { - o.__defineGetter__("f", makeGetter()); - } - - var result = foo(o); - if (result != 42) - throw "Error: bad result: " + result; -} - -var o = Object.create(p); -o.__defineGetter__("f", makeGetter()); -doBadThings = true; -var result = foo(o); -if (result != 43) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/poly-chain-getter.js b/implementation-contributed/javascriptcore/stress/poly-chain-getter.js deleted file mode 100644 index 1f617a285f..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-chain-getter.js +++ /dev/null @@ -1,30 +0,0 @@ -function Cons() { -} -Cons.prototype.__defineGetter__("f", function() { - counter++; - return 84; -}); - -function foo(o) { - return o.f; -} - -noInline(foo); - -var counter = 0; - -function test(o, expected, expectedCount) { - var result = foo(o); - if (result != expected) - throw new Error("Bad result: " + result); - if (counter != expectedCount) - throw new Error("Bad counter value: " + counter); -} - -for (var i = 0; i < 100000; ++i) { - test(new Cons(), 84, counter + 1); - - var o = new Cons(); - o.g = 54; - test(o, 84, counter + 1); -} diff --git a/implementation-contributed/javascriptcore/stress/poly-chain-setter.js b/implementation-contributed/javascriptcore/stress/poly-chain-setter.js deleted file mode 100644 index 491fe5f946..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-chain-setter.js +++ /dev/null @@ -1,32 +0,0 @@ -function Cons() { -} -Cons.prototype.__defineSetter__("f", function(value) { - counter++; - this._f = value; -}); -Cons.prototype.__defineGetter__("f", function() { return this._f; }); - -function foo(o, v) { - o.f = v; - return o.f; -} - -noInline(foo); - -var counter = 0; - -function test(o, value, expectedCount) { - var result = foo(o, value); - if (result != value) - throw new Error("Bad result: " + result); - if (counter != expectedCount) - throw new Error("Bad counter value: " + counter); -} - -for (var i = 0; i < 100000; ++i) { - test(new Cons(), i, counter + 1); - - var o = new Cons(); - o.g = 54; - test(o, i, counter + 1); -} diff --git a/implementation-contributed/javascriptcore/stress/poly-chain-then-getter.js b/implementation-contributed/javascriptcore/stress/poly-chain-then-getter.js deleted file mode 100644 index ecb89bd50a..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-chain-then-getter.js +++ /dev/null @@ -1,31 +0,0 @@ -function Cons1() { -} -Cons1.prototype.f = 42; - -function Cons2() { -} -Cons2.prototype.__defineGetter__("f", function() { - counter++; - return 84; -}); - -function foo(o) { - return o.f; -} - -noInline(foo); - -var counter = 0; - -function test(o, expected, expectedCount) { - var result = foo(o); - if (result != expected) - throw new Error("Bad result: " + result); - if (counter != expectedCount) - throw new Error("Bad counter value: " + counter); -} - -for (var i = 0; i < 100000; ++i) { - test(new Cons1(), 42, counter); - test(new Cons2(), 84, counter + 1); -} diff --git a/implementation-contributed/javascriptcore/stress/poly-chain-then-setter.js b/implementation-contributed/javascriptcore/stress/poly-chain-then-setter.js deleted file mode 100644 index cc363b9f30..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-chain-then-setter.js +++ /dev/null @@ -1,33 +0,0 @@ -function Cons1() { -} -Cons1.prototype.f = 42; - -function Cons2() { -} -Cons2.prototype.__defineSetter__("f", function(value) { - counter++; - this._f = value; -}); -Cons2.prototype.__defineGetter__("f", function() { return this._f; }); - -function foo(o, value) { - o.f = value; - return o.f; -} - -noInline(foo); - -var counter = 0; - -function test(o, value, expectedCount) { - var result = foo(o, value); - if (result != value) - throw new Error("Bad result: " + result); - if (counter != expectedCount) - throw new Error("Bad counter value: " + counter); -} - -for (var i = 0; i < 100000; ++i) { - test(new Cons1(), i, counter); - test(new Cons2(), i, counter + 1); -} diff --git a/implementation-contributed/javascriptcore/stress/poly-getter-combo.js b/implementation-contributed/javascriptcore/stress/poly-getter-combo.js deleted file mode 100644 index cdeeee58d0..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-getter-combo.js +++ /dev/null @@ -1,40 +0,0 @@ -function Cons1() { -} -Cons1.prototype.f = 42; - -function Cons2() { -} -Cons2.prototype.__defineGetter__("f", function() { - counter++; - return 84; -}); - -function foo(o) { - return o.f; -} - -noInline(foo); - -var counter = 0; - -function test(o, expected, expectedCount) { - var result = foo(o); - if (result != expected) - throw new Error("Bad result: " + result); - if (counter != expectedCount) - throw new Error("Bad counter value: " + counter); -} - -for (var i = 0; i < 100000; ++i) { - test(new Cons1(), 42, counter); - test(new Cons2(), 84, counter + 1); - - var o = {}; - o.__defineGetter__("f", function() { - counter++; - return 84; - }); - test(o, 84, counter + 1); - - test({f: 42}, 42, counter); -} diff --git a/implementation-contributed/javascriptcore/stress/poly-getter-then-chain.js b/implementation-contributed/javascriptcore/stress/poly-getter-then-chain.js deleted file mode 100644 index 8db9310776..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-getter-then-chain.js +++ /dev/null @@ -1,31 +0,0 @@ -function Cons1() { -} -Cons1.prototype.f = 42; - -function Cons2() { -} -Cons2.prototype.__defineGetter__("f", function() { - counter++; - return 84; -}); - -function foo(o) { - return o.f; -} - -noInline(foo); - -var counter = 0; - -function test(o, expected, expectedCount) { - var result = foo(o); - if (result != expected) - throw new Error("Bad result: " + result); - if (counter != expectedCount) - throw new Error("Bad counter value: " + counter); -} - -for (var i = 0; i < 100000; ++i) { - test(new Cons2(), 84, counter + 1); - test(new Cons1(), 42, counter); -} diff --git a/implementation-contributed/javascriptcore/stress/poly-getter-then-self.js b/implementation-contributed/javascriptcore/stress/poly-getter-then-self.js deleted file mode 100644 index d90fb10203..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-getter-then-self.js +++ /dev/null @@ -1,26 +0,0 @@ -function foo(o) { - return o.f; -} - -noInline(foo); - -var counter = 0; - -function test(o, expected, expectedCount) { - var result = foo(o); - if (result != expected) - throw new Error("Bad result: " + result); - if (counter != expectedCount) - throw new Error("Bad counter value: " + counter); -} - -for (var i = 0; i < 100000; ++i) { - var o = {}; - o.__defineGetter__("f", function() { - counter++; - return 84; - }); - test(o, 84, counter + 1); - - test({f: 42}, 42, counter); -} diff --git a/implementation-contributed/javascriptcore/stress/poly-proto-clear-stub.js b/implementation-contributed/javascriptcore/stress/poly-proto-clear-stub.js deleted file mode 100644 index 5b3b307df9..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-proto-clear-stub.js +++ /dev/null @@ -1,101 +0,0 @@ -function assert(b, m) { - if (!b) - throw new Error("Bad:" + m); -} - -function foo() { - class C { - constructor() { - this.p0 = 0 - this.p1 = 1 - this.p2 = 2 - this.p3 = 3 - this.p4 = 4 - this.p5 = 5 - this.p6 = 6 - this.p7 = 7 - this.p8 = 8 - this.p9 = 9 - this.p10 = 10 - this.p11 = 11 - this.p12 = 12 - this.p13 = 13 - this.p14 = 14 - this.p15 = 15 - this.p16 = 16 - this.p17 = 17 - this.p18 = 18 - this.p19 = 19 - this.p20 = 20 - this.p21 = 21 - this.p22 = 22 - this.p23 = 23 - this.p24 = 24 - this.p25 = 25 - this.p26 = 26 - this.p27 = 27 - this.p28 = 28 - this.p29 = 29 - this.p30 = 30 - this.p31 = 31 - this.p32 = 32 - this.p33 = 33 - this.p34 = 34 - this.p35 = 35 - this.p36 = 36 - this.p37 = 37 - this.p38 = 38 - this.p39 = 39 - } - }; - - let item = new C; - for (let i = 0; i < 20; ++i) { - assert(item.p0 === 0) - assert(item.p1 === 1) - assert(item.p2 === 2) - assert(item.p3 === 3) - assert(item.p4 === 4) - assert(item.p5 === 5) - assert(item.p6 === 6) - assert(item.p7 === 7) - assert(item.p8 === 8) - assert(item.p9 === 9) - assert(item.p10 === 10) - assert(item.p11 === 11) - assert(item.p12 === 12) - assert(item.p13 === 13) - assert(item.p14 === 14) - assert(item.p15 === 15) - assert(item.p16 === 16) - assert(item.p17 === 17) - assert(item.p18 === 18) - assert(item.p19 === 19) - assert(item.p20 === 20) - assert(item.p21 === 21) - assert(item.p22 === 22) - assert(item.p23 === 23) - assert(item.p24 === 24) - assert(item.p25 === 25) - assert(item.p26 === 26) - assert(item.p27 === 27) - assert(item.p28 === 28) - assert(item.p29 === 29) - assert(item.p30 === 30) - assert(item.p31 === 31) - assert(item.p32 === 32) - assert(item.p33 === 33) - assert(item.p34 === 34) - assert(item.p35 === 35) - assert(item.p36 === 36) - assert(item.p37 === 37) - assert(item.p38 === 38) - assert(item.p39 === 39) - } -} - -let start = Date.now(); -for (let i = 0; i < 1000; ++i) - foo(); -if (false) - print(Date.now() - start); diff --git a/implementation-contributed/javascriptcore/stress/poly-proto-intrinsic-getter-correctness.js b/implementation-contributed/javascriptcore/stress/poly-proto-intrinsic-getter-correctness.js deleted file mode 100644 index 7cf4bb78bf..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-proto-intrinsic-getter-correctness.js +++ /dev/null @@ -1,37 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad!"); -} - -function makePolyProtoObject() { - function foo() { - class C { - constructor() { - this._field = 42; - } - }; - return new C; - } - for (let i = 0; i < 15; ++i) - foo(); - return foo(); -} - -let x = new Uint32Array(10); -let p = x.__proto__.__proto__; -let obj = makePolyProtoObject(); -obj.__proto__ = p; -x.__proto__ = obj; - -function foo(x) { - return x.byteLength; -} -noInline(foo); - -for (let i = 0; i < 1000; ++i) { - assert(foo(x) === 10 * 4); -}; - -obj.__proto__ = {}; - -assert(foo(x) === undefined); diff --git a/implementation-contributed/javascriptcore/stress/poly-proto-miss.js b/implementation-contributed/javascriptcore/stress/poly-proto-miss.js deleted file mode 100644 index 4210460f86..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-proto-miss.js +++ /dev/null @@ -1,51 +0,0 @@ -function makePolyProtoInstanceWithNullPrototype() { - function foo() { - class C { - constructor() { this.x = 20; } - }; - C.prototype.y = 42; - let result = new C; - return result; - } - - for (let i = 0; i < 5; ++i) - foo(); - let result = foo(); - result.__proto__ = null; - return result; -} - -function assert(b) { - if (!b) - throw new Error("Bad asssertion") -} - -let instances = [ - makePolyProtoInstanceWithNullPrototype(), - makePolyProtoInstanceWithNullPrototype(), - makePolyProtoInstanceWithNullPrototype(), - makePolyProtoInstanceWithNullPrototype(), - makePolyProtoInstanceWithNullPrototype(), - makePolyProtoInstanceWithNullPrototype(), - makePolyProtoInstanceWithNullPrototype(), - makePolyProtoInstanceWithNullPrototype(), - makePolyProtoInstanceWithNullPrototype(), - makePolyProtoInstanceWithNullPrototype(), - makePolyProtoInstanceWithNullPrototype(), - makePolyProtoInstanceWithNullPrototype(), -]; - -let p = undefined; -function validate(x) { - assert(x.x === 20); - assert(x.p === undefined); -} -noInline(validate); - -let start = Date.now(); -for (let i = 0; i < 100000; ++i) { - for (let i = 0; i < instances.length; ++i) - validate(instances[i]); -} -if (false) - print(Date.now() - start); diff --git a/implementation-contributed/javascriptcore/stress/poly-proto-op-in-caching.js b/implementation-contributed/javascriptcore/stress/poly-proto-op-in-caching.js deleted file mode 100644 index 5367019f11..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-proto-op-in-caching.js +++ /dev/null @@ -1,64 +0,0 @@ -function assert(b, m) { - if (!b) - throw new Error("Bad:" + m); -} - -function makePolyProtoObject() { - function foo() { - class C { - constructor() { - this.field = 42; - } - }; - return new C; - } - for (let i = 0; i < 15; ++i) { - assert(foo().field === 42); - } - return foo(); -} - -function validate(o, b) { - assert("x" in o === b); -} -noInline(validate); - -let start = Date.now(); - -let objs = []; -for (let i = 0; i < 10; ++i) - objs.push(makePolyProtoObject()); - -objs.forEach(obj => Reflect.setPrototypeOf(obj, {x:20})); - -for (let i = 0; i < 10000; ++i) { - for (let obj of objs) - validate(obj, true); -} - -objs.forEach(obj => Reflect.setPrototypeOf(obj, {})); -for (let i = 0; i < 10000; ++i) { - for (let obj of objs) - validate(obj, false); -} - - -function validate2(o, b) { - assert("x" in o === b); -} -noInline(validate2); - -objs.forEach(obj => Reflect.setPrototypeOf(obj, null)); -for (let i = 0; i < 10000; ++i) { - for (let obj of objs) - validate2(obj, false); -} - -objs.forEach(obj => Reflect.setPrototypeOf(obj, {x:25})); -for (let i = 0; i < 10000; ++i) { - for (let obj of objs) - validate2(obj, true); -} - -if (false) - print(Date.now() - start); diff --git a/implementation-contributed/javascriptcore/stress/poly-proto-prototype-map-having-a-bad-time.js b/implementation-contributed/javascriptcore/stress/poly-proto-prototype-map-having-a-bad-time.js deleted file mode 100644 index 767f77b623..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-proto-prototype-map-having-a-bad-time.js +++ /dev/null @@ -1,30 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion"); -} - -function foo() { - class C { - constructor() { - this.x = 20; - } - }; - let item = new C; - item[0] = 42; - return [item, C.prototype]; -} - -for (let i = 0; i < 50; ++i) - foo(); - -let [item, proto] = foo(); -let called = false; -Object.defineProperty(proto, "1", { - set(x) { - called = true; - } -}); - -assert(!called); -item[1] = 42; -assert(called); diff --git a/implementation-contributed/javascriptcore/stress/poly-proto-put-transition.js b/implementation-contributed/javascriptcore/stress/poly-proto-put-transition.js deleted file mode 100644 index 345f3e58ca..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-proto-put-transition.js +++ /dev/null @@ -1,52 +0,0 @@ -function assert(b, m) { - if (!b) - throw new Error("Bad:" + m); -} - -function makePolyProtoObject() { - function foo() { - class C { - constructor() { - this._field = 42; - } - }; - return new C; - } - for (let i = 0; i < 15; ++i) - foo(); - return foo(); -} - -let global; - -function performSet(o) { - o.p = 20; -} - -let start = Date.now(); -for (let i = 0; i < 1000; ++i) { - let obj = makePolyProtoObject(); - obj.__proto__ = null; - performSet(obj); - assert(Object.hasOwnProperty.call(obj, "p")); - assert(obj.p === 20); - -} - -for (let i = 0; i < 1000; ++i) { - let obj = makePolyProtoObject(); - obj.__proto__ = { set p(x) { global = x; } }; - performSet(obj); - assert(!obj.hasOwnProperty("p")); - assert(global === 20); - global = null; -} - -for (let i = 0; i < 1000; ++i) { - let obj = makePolyProtoObject(); - performSet(obj); - assert(obj.hasOwnProperty("p")); - assert(obj.p === 20); -} -if (false) - print(Date.now() - start); diff --git a/implementation-contributed/javascriptcore/stress/poly-proto-set-prototype.js b/implementation-contributed/javascriptcore/stress/poly-proto-set-prototype.js deleted file mode 100644 index 6cac7e4b02..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-proto-set-prototype.js +++ /dev/null @@ -1,65 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("bad"); -} - -let alternateProto = { - get x() { - return null; - } -}; - -let alternateProto2 = { - get y() { return 22; }, - get x() { - return null; - } -}; - -Object.defineProperty(Object.prototype, "x", { - get: function() { return this._x; } -}); - -function foo() { - class C { - constructor() { - this._x = 42; - } - }; - return new C; -} - -function validate(o, p) { - assert(o.x === p); -} -noInline(validate); - -let arr = []; -foo(); -for (let i = 0; i < 25; ++i) - arr.push(foo()); - -for (let i = 0; i < 100; ++i) { - for (let a of arr) - validate(a, 42); -} - -for (let a of arr) { - a.__proto__ = alternateProto; -} -for (let i = 0; i < 100; ++i) { - for (let a of arr) { - validate(a, null); - } -} - -for (let a of arr) { - a.__proto__ = alternateProto2; -} - -for (let i = 0; i < 100; ++i) { - for (let a of arr) { - validate(a, null); - assert(a.y === 22); - } -} diff --git a/implementation-contributed/javascriptcore/stress/poly-proto-setter.js b/implementation-contributed/javascriptcore/stress/poly-proto-setter.js deleted file mode 100644 index 3faa06e0c2..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-proto-setter.js +++ /dev/null @@ -1,71 +0,0 @@ -function assert(b, m) { - if (!b) - throw new Error("Bad:" + m); -} - -let called = false; -function makePolyProtoObject() { - function foo() { - class C { - constructor() - { - this._p = null; - } - - set p(x) - { - called = true; - this._p = x; - } - get p() - { - return this._p; - } - }; - return new C; - } - for (let i = 0; i < 15; ++i) { - assert(foo().p === null); - } - return foo(); -} - -function performSet(o) { - o.p = 20; -} - -let items = []; -for (let i = 0; i < 20; ++i) { - items.push(makePolyProtoObject()); -} - -function performSet(x, i) { - x.p = i; -} - -let start = Date.now(); -for (let i = 0; i < 100000; ++i) { - for (let i = 0; i < items.length; ++i) { - let o = items[i]; - performSet(o, i); - assert(o._p === i); - assert(called === true); - called = false; - } -} - -items.forEach(o => { - Reflect.setPrototypeOf(o, null); -}); - -for (let i = 0; i < 100000; ++i) { - for (let i = 0; i < items.length; ++i) { - let o = items[i]; - performSet(o, i); - assert(o.p === i); - assert(called === false); - } -} - -if (false) - print(Date.now() - start); diff --git a/implementation-contributed/javascriptcore/stress/poly-proto-using-inheritance.js b/implementation-contributed/javascriptcore/stress/poly-proto-using-inheritance.js deleted file mode 100644 index 30b1a1a4a5..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-proto-using-inheritance.js +++ /dev/null @@ -1,51 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad"); -} - -function foo() { - class C { - constructor() - { - this.y = 22; - } - get baz() { return this.x; } - } - C.prototype.field = 42; - new C; - return C; -} - -for (let i = 0; i < 5; ++i) - foo(); - -function bar(p) { - class C extends p { - constructor() { - super(); - this.x = 22; - } - }; - let result = new C; - return result; -} - -for (let i = 0; i < 5; ++i) - bar(foo()); - -let instances = []; -for (let i = 0; i < 40; ++i) - instances.push(bar(foo())); - -function validate(item) { - assert(item.x === 22); - assert(item.baz === 22); - assert(item.field === 42); -} - -let start = Date.now(); -for (let i = 0; i < 100000; ++i) { - instances.forEach((x) => validate(x)); -} -if (false) - print(Date.now() - start); diff --git a/implementation-contributed/javascriptcore/stress/poly-self-getter.js b/implementation-contributed/javascriptcore/stress/poly-self-getter.js deleted file mode 100644 index 72d7d3a897..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-self-getter.js +++ /dev/null @@ -1,31 +0,0 @@ -function foo(o) { - return o.f; -} - -noInline(foo); - -var counter = 0; - -function test(o, expected, expectedCount) { - var result = foo(o); - if (result != expected) - throw new Error("Bad result: " + result); - if (counter != expectedCount) - throw new Error("Bad counter value: " + counter); -} - -function getter() { - counter++; - return 84; -} - -for (var i = 0; i < 100000; ++i) { - var o = {}; - o.__defineGetter__("f", getter); - test(o, 84, counter + 1); - - var o = {}; - o.__defineGetter__("f", getter); - o.g = 54; - test(o, 84, counter + 1); -} diff --git a/implementation-contributed/javascriptcore/stress/poly-self-then-getter.js b/implementation-contributed/javascriptcore/stress/poly-self-then-getter.js deleted file mode 100644 index 24310ac9cf..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-self-then-getter.js +++ /dev/null @@ -1,26 +0,0 @@ -function foo(o) { - return o.f; -} - -noInline(foo); - -var counter = 0; - -function test(o, expected, expectedCount) { - var result = foo(o); - if (result != expected) - throw new Error("Bad result: " + result); - if (counter != expectedCount) - throw new Error("Bad counter value: " + counter); -} - -for (var i = 0; i < 100000; ++i) { - test({f: 42}, 42, counter); - - var o = {}; - o.__defineGetter__("f", function() { - counter++; - return 84; - }); - test(o, 84, counter + 1); -} diff --git a/implementation-contributed/javascriptcore/stress/poly-setter-combo.js b/implementation-contributed/javascriptcore/stress/poly-setter-combo.js deleted file mode 100644 index e3446a64ee..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-setter-combo.js +++ /dev/null @@ -1,77 +0,0 @@ -function Cons1() { -} -Cons1.prototype.f = 42; - -function Cons2() { - this._values = [] -} -Cons2.prototype.__defineSetter__("f", function(value) { - counter++; - this._f = value; - this._values[value] = 1; -}); -Cons2.prototype.__defineGetter__("f", function() { return this._f; }); - -function Cons3() { -} -Cons3.prototype.f = 42; -Cons3.prototype.g = 43; - -function Cons4() { - this._values = [] -} -Cons4.prototype.g = 16; -Cons4.prototype.__defineSetter__("f", function(value) { - counter++; - this._f = value; - this._values[value] = 1; -}); -Cons4.prototype.__defineGetter__("f", function() { return this._f; }); - -function foo(o, value) { - o.f = value; - return o.f; -} - -noInline(foo); - -var counter = 0; - -function test(o, value, expectedCount) { - var result = foo(o, value); - if (result != value) - throw new Error("Bad result: " + result); - if (counter != expectedCount) - throw new Error("Bad counter value: " + counter); -} - -function runTestWithConstructors(constructor1, constructor2) { - for (var i = 0; i < 5000; ++i) { - test(new constructor1(), i, counter); - test(new constructor2(), i, counter + 1); - - var o = {}; - o.__defineGetter__("f", function() { - counter++; - return 84; - }); - test(o, 84, counter + 1); - - var o = {}; - o.__defineSetter__("f", function(value) { - this._f = value; - counter++; - }); - o.__defineGetter__("f", function() { return this._f; }); - test(o, i, counter + 1); - - test({f: 42}, i, counter); - } -} - -for (var i = 0; i < 2; ++i) { - runTestWithConstructors(Cons1, Cons2); - runTestWithConstructors(Cons3, Cons2); - runTestWithConstructors(Cons1, Cons4); - runTestWithConstructors(Cons3, Cons4); -} diff --git a/implementation-contributed/javascriptcore/stress/poly-setter-then-self.js b/implementation-contributed/javascriptcore/stress/poly-setter-then-self.js deleted file mode 100644 index 3c35db7d9b..0000000000 --- a/implementation-contributed/javascriptcore/stress/poly-setter-then-self.js +++ /dev/null @@ -1,28 +0,0 @@ -function foo(o, value) { - o.f = value; - return o.f; -} - -noInline(foo); - -var counter = 0; - -function test(o, value, expectedCount) { - var result = foo(o, value); - if (result != value) - throw new Error("Bad result: " + result); - if (counter != expectedCount) - throw new Error("Bad counter value: " + counter); -} - -for (var i = 0; i < 100000; ++i) { - var o = {}; - o.__defineSetter__("f", function(value) { - counter++; - this._f = value; - }); - o.__defineGetter__("f", function() { return this._f; }); - test(o, i, counter + 1); - - test({f: 42}, i, counter); -} diff --git a/implementation-contributed/javascriptcore/stress/polymorphic-prototype-accesses.js b/implementation-contributed/javascriptcore/stress/polymorphic-prototype-accesses.js deleted file mode 100644 index f206551345..0000000000 --- a/implementation-contributed/javascriptcore/stress/polymorphic-prototype-accesses.js +++ /dev/null @@ -1,28 +0,0 @@ -function Foo() { -} -Foo.prototype.f = 42; -Foo.prototype.g = 43; -Foo.prototype.h = 44; -Foo.prototype.i = 45; -Foo.prototype.j = 46; -Foo.prototype.k = 47; - -function Bar() { -} -Bar.prototype.k = 23; -Bar.prototype.f = 24; - -function foo(o) { - return o.f + o.k; -} - -noInline(foo); - -for (var i = 0; i < 100; ++i) { - var result = foo(new Foo()); - if (result != 89) - throw "Error: bad result for Foo: " + result; - result = foo(new Bar()); - if (result != 47) - throw "Error: bad result for Bar: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/promise-cannot-be-called.js b/implementation-contributed/javascriptcore/stress/promise-cannot-be-called.js deleted file mode 100644 index 94629d4605..0000000000 --- a/implementation-contributed/javascriptcore/stress/promise-cannot-be-called.js +++ /dev/null @@ -1,44 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: {String(actual)}`); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -var executorCalled = false; -shouldThrow(() => { - Promise(function (resolve, reject) { executorCalled = true; }); -}, `TypeError: calling Promise constructor without new is invalid`); -shouldBe(executorCalled, false); - -// But should accept inheriting Promise. -class Deferred extends Promise { - constructor() - { - let resolve, reject; - super(function (aResolve, aReject) { - this.resolve = aResolve; - this.reject = aReject; - }); - } -} - -{ - let deferred = new Deferred(); - shouldBe(deferred.__proto__, Deferred.prototype); - shouldBe(deferred.__proto__.__proto__, Promise.prototype); - shouldBe(Deferred.__proto__, Promise); -} diff --git a/implementation-contributed/javascriptcore/stress/promise-finally.js b/implementation-contributed/javascriptcore/stress/promise-finally.js deleted file mode 100644 index 5de266ba69..0000000000 --- a/implementation-contributed/javascriptcore/stress/promise-finally.js +++ /dev/null @@ -1,387 +0,0 @@ -var assert = function (result, expected, message = "") { - if (result !== expected) { - throw new Error('Error in assert. Expected "' + expected + '" but was "' + result + '":' + message ); - } -}; - -const Logger = function () { - var log = []; - - this.logEvent = (type, value) => { - log.push({ type, value}); - }; - this.logFulfilledEvent = (value) => { - this.logEvent('fulfilled', value); - }; - this.logRejectEvent = error => { - this.logEvent('reject', error.toString()); - }; - this.logFinallyEvent = value => { - this.logEvent('finally', value === undefined ? 'undefined' : value.toString()); - }; - this.logCatchEvent = value => { - this.logEvent('catch', value.toString()); - }; - this.getLogger = () => log; - - this.clear = () => { - log = []; - } -}; - -var logger = new Logger(); - -const fulfillSpy = (logger => result => logger.logFulfilledEvent(result))(logger); -const rejectSpy = (logger => error => logger.logRejectEvent(error))(logger); -const catchSpy = (logger => error => logger.logCatchEvent(error))(logger); -const finallySpy = (logger => value => logger.logFinallyEvent(value))(logger); - -const assertLogger = function (loggerObject) { - const logger = loggerObject.getLogger(); - - var _assertLogger = function () { - let index = 0; - - const isNotOutOfLength = () => { - assert(index < logger.length, true, `Index is greater then log length`); - } - - this.fullfilled = function (expectedValue, message = 'on fulfill') { - isNotOutOfLength(); - - const msg = `step: ${index} - ${message}`; - let step = logger[index]; - - assert(step.type, 'fulfilled', msg); - assert(step.value, expectedValue, msg); - - index++; - return this; - }; - - this.rejected = function (error, message = 'on reject') { - isNotOutOfLength(); - - const msg = `step: ${index} - ${message}`; - let step = logger[index]; - - assert(step.type, 'reject', msg); - assert(step.value, error === undefined ? 'undefined' : error.toString(), msg); - - index++; - return this; - }; - - this.finally = function (value, message = 'on reject') { - isNotOutOfLength(); - - const msg = `step: ${index} - ${message}`; - let step = logger[index]; - - assert(step.type, 'finally', msg); - assert(step.value, value === undefined ? 'undefined' : value.toString(), msg); - index++; - return this; - }; - - this.catched = function (expectedError, message = 'on catch') { - isNotOutOfLength(); - - const msg = `step: ${index} - ${message}`; - let step = logger[index]; - - assert(step.type, 'catch', msg); - assert(step.value, expectedError === undefined ? 'undefined' : expectedError.toString(), msg); - - index++; - return this; - }; - - this.isFinal = function (message = '') { - assert(index, logger.length, `expected final step: ${message}`); - }; - }; - - return new _assertLogger(); -}; - -logger.clear(); -Promise.resolve(1).finally(finallySpy); -drainMicrotasks(); - -assertLogger(logger) - .finally() - .isFinal(); - - -logger.clear(); -Promise.reject(1).finally(finallySpy); - -drainMicrotasks(); - -assertLogger(logger) - .finally() - .isFinal(); - -logger.clear(); -Promise.resolve(1) - .then(VALUE => { fulfillSpy(VALUE); return 'some-value'}, rejectSpy) - .finally(finallySpy); - -drainMicrotasks(); - -assertLogger(logger) - .fullfilled(1) - .finally() - .isFinal(); - -logger.clear(); -Promise.resolve(1) - .then(VALUE => { fulfillSpy(VALUE); return 'some-value-1'}, rejectSpy) - .then(VALUE => { fulfillSpy(VALUE); return 'some-value-2'}, rejectSpy) - .finally(finallySpy); - -drainMicrotasks(); - -assertLogger(logger) - .fullfilled(1) - .fullfilled("some-value-1") - .finally() - .isFinal(); - -logger.clear(); -Promise.resolve(1) - .then(VALUE => { fulfillSpy(VALUE); throw new Error('error#'); return 'some-value-1'; }, rejectSpy) - .finally(finallySpy); - -drainMicrotasks(); - -assertLogger(logger) - .fullfilled(1) - .finally() - .isFinal(); - -logger.clear(); -Promise.resolve(1) - .then(VALUE => { fulfillSpy(VALUE); throw new Error('error#'); return 'some-value-1'; }, rejectSpy) - .then(VALUE => { fulfillSpy(VALUE); return 'some-value-2'; }, rejectSpy) - .finally(finallySpy); - -drainMicrotasks(); - -assertLogger(logger) - .fullfilled(1) - .rejected(new Error("error#")) - .finally() - .isFinal(); - -logger.clear(); -Promise.resolve(1) - .then(VALUE => { fulfillSpy(VALUE); throw new Error('error#'); return 'some-value-1'; }, rejectSpy) - .then(VALUE => { fulfillSpy(VALUE); return 'some-value-2'; }, rejectSpy) - .catch(catchSpy) - .finally(finallySpy); - -drainMicrotasks(); - -assertLogger(logger) - .fullfilled(1) - .rejected(new Error("error#")) - .finally() - .isFinal(); - -logger.clear(); - -Promise.resolve(1) - .then(VALUE => { fulfillSpy(VALUE); throw new Error('error#'); return 'some-value-1'; }, rejectSpy) - .catch(catchSpy) - .finally(finallySpy) - .then(fulfillSpy, rejectSpy); - -drainMicrotasks(); - -assertLogger(logger) - .fullfilled(1) - .catched(new Error('error#')) - .finally() - .fullfilled() - .isFinal(); - -logger.clear(); - -Promise.resolve(1) - .then(VALUE => { fulfillSpy(VALUE); throw new Error('error#'); return 'some-value-1'; }, rejectSpy) - .catch(catchSpy) - .finally(finallySpy) - .catch(catchSpy); - -drainMicrotasks(); - -assertLogger(logger) - .fullfilled(1) - .catched(new Error('error#')) - .finally() - .isFinal(); - -logger.clear(); - -Promise.resolve(1) - .then(VALUE => { fulfillSpy(VALUE); throw new Error('error#'); return 'some-value-1'; }, rejectSpy) - .catch(catchSpy) - .finally(finallySpy) - .then(fulfillSpy, rejectSpy) - .finally(finallySpy); - -drainMicrotasks(); - -assertLogger(logger) - .fullfilled(1) - .catched(new Error('error#')) - .finally() - .fullfilled() - .finally() - .isFinal(); - -logger.clear(); - -Promise.resolve(1) - .then(VALUE => { fulfillSpy(VALUE); throw new Error('error#1'); return 'some-value-1'; }, rejectSpy) - .catch(catchSpy) - .finally(() => { finallySpy(); throw new Error('error#2'); } ) - .then(fulfillSpy, rejectSpy) - .finally(finallySpy); - -drainMicrotasks(); - -assertLogger(logger) - .fullfilled(1) - .catched(new Error('error#1')) - .finally() - .rejected(new Error('error#2')) - .finally() - .isFinal(); - -logger.clear(); - -Promise.resolve(1) - .then(VALUE => { fulfillSpy(VALUE); throw new Error('error#1'); return 'some-value-1'; }, rejectSpy) - .catch(catchSpy) - .finally(() => { finallySpy(); throw new Error('error#2'); } ) - .catch(catchSpy) - .finally(); - -drainMicrotasks(); - -assertLogger(logger) - .fullfilled(1) - .catched(new Error('error#1')) - .finally() - .catched(new Error('error#2')) - .isFinal(); - -logger.clear(); - -Promise.resolve(1) - .then(VALUE => { fulfillSpy(VALUE); return 'some-value-1'; }) - .finally(VALUE => { finallySpy(VALUE); return 'value'; } ) - .then(fulfillSpy, rejectSpy) - .finally(finallySpy); - -drainMicrotasks(); - -assertLogger(logger) - .fullfilled(1) - .finally() - .fullfilled('some-value-1') - .finally() - .isFinal(); - -logger.clear(); - -Promise.resolve(1) - .then(VALUE => { fulfillSpy(VALUE); return 'some-value-1'; }) - .finally(VALUE => { finallySpy(VALUE); return 'value'; } ) - .then(fulfillSpy) - .finally(finallySpy); - -drainMicrotasks(); - -assertLogger(logger) - .fullfilled(1) - .finally() - .fullfilled('some-value-1') - .finally() - .isFinal(); - -logger.clear(); - -Promise.resolve(1) - .finally(VALUE => { finallySpy(VALUE); return 'value'; } ) - .then(fulfillSpy, rejectSpy) - .finally(finallySpy); - -drainMicrotasks(); - -assertLogger(logger) - .finally() - .fullfilled(1) - .finally() - .isFinal(); - -logger.clear(); - -Promise.reject(1) - .then(fulfillSpy, VALUE => { rejectSpy(VALUE); return 'some-value-1'; }) - .finally(VALUE => { finallySpy(VALUE); return 'value'; } ) - .then(fulfillSpy) - .finally(finallySpy); - -drainMicrotasks(); - -assertLogger(logger) - .rejected(1) - .finally() - .fullfilled('some-value-1') - .finally() - .isFinal(); - -logger.clear(); - -var obj = {}; - -var p = Promise.resolve(obj); - -p.finally(function () { - finallySpy(arguments.length); - return {}; -}).then(function (x) { - fulfillSpy(x === obj); -}); - -drainMicrotasks(); - -assertLogger(logger) - .finally(0) - .fullfilled(true) - .isFinal(); - - -logger.clear(); - -p = Promise.reject(obj); - -p.finally(function () { - finallySpy(arguments.length); - return {}; -}).then(function (x) { - fulfillSpy(x === obj); -}, function (x) { - rejectSpy(x === obj); -}); - -drainMicrotasks(); - -assertLogger(logger) - .finally(0) - .rejected(true) - .isFinal(); diff --git a/implementation-contributed/javascriptcore/stress/promise-infinite-recursion-should-not-crash.js b/implementation-contributed/javascriptcore/stress/promise-infinite-recursion-should-not-crash.js deleted file mode 100644 index cb261f9c5a..0000000000 --- a/implementation-contributed/javascriptcore/stress/promise-infinite-recursion-should-not-crash.js +++ /dev/null @@ -1,14 +0,0 @@ -//@ defaultNoSamplingProfilerRun - -// This should not crash -var boundFunc; - -function testPromise(func) { - var p1 = new Promise(func); -} -function promiseFunc(resolve, reject) { - boundFunc(); -} - -boundFunc = testPromise.bind(null, promiseFunc); -boundFunc(); diff --git a/implementation-contributed/javascriptcore/stress/promise-species-functions.js b/implementation-contributed/javascriptcore/stress/promise-species-functions.js deleted file mode 100644 index 86289300e9..0000000000 --- a/implementation-contributed/javascriptcore/stress/promise-species-functions.js +++ /dev/null @@ -1,72 +0,0 @@ -C = class extends Promise { } -N = class { } -N[Symbol.species] = function() { throw "this should never be called"; } - -function id(x) { return x; } - -testFunctions = [ - [Promise.prototype.then, [id]] -]; - -objProp = Object.defineProperty; - -function funcThrows(func, args) { - try { - func.call(...args) - return false; - } catch (e) { - return true; - } -} - -function makeC() { - return new C(function(resolve) { resolve(1); }); -} - -function test(testData) { - "use strict"; - let [protoFunction, args] = testData; - let foo = makeC() - let n = new N(); - - // Test promise defaults cases. - foo = makeC(); - - objProp(C, Symbol.species, { value: undefined, writable: true}); - let bar = protoFunction.call(foo, ...args); - if (!(bar instanceof Promise) || bar instanceof C) - throw Error(); - - C[Symbol.species] = null; - bar = protoFunction.call(foo, ...args); - if (!(bar instanceof Promise) || bar instanceof C) - throw Error(); - - // Test species is custom constructor. - let called = false; - function species() { - called = true; - return new C(...arguments); - } - - C[Symbol.species] = species; - bar = protoFunction.call(foo, ...args); - - if (!(bar instanceof Promise) || !(bar instanceof C) || !called) - throw Error("failed on " + protoFunction); - - function speciesThrows() { - throw Error(); - } - - C[Symbol.species] = speciesThrows; - if (!funcThrows(protoFunction, [foo, ...args])) - throw "didn't throw"; - - C[Symbol.species] = true; - if (!funcThrows(protoFunction, [foo, ...args])) - throw "didn't throw"; - -} - -testFunctions.forEach(test); diff --git a/implementation-contributed/javascriptcore/stress/prop-type-boolean-then-string.js b/implementation-contributed/javascriptcore/stress/prop-type-boolean-then-string.js deleted file mode 100644 index 2e0ca6ecef..0000000000 --- a/implementation-contributed/javascriptcore/stress/prop-type-boolean-then-string.js +++ /dev/null @@ -1,29 +0,0 @@ -function foo(o) { - return !!o.f; -} - -function bar(o, v) { - o.f = v; -} - -noInline(foo); -noInline(bar); - -var o = {}; -for (var i = 0; i < 5; ++i) - bar(o, true); - -for (var i = 0; i < 10000; ++i) { - var result = foo(o); - if (result !== true) - throw "Error: bad result: " + result; -} - -bar(o, "hello"); -var result = foo(o); -if (result !== true) - throw "Error: bad result at end (true): " + result; -bar(o, ""); -result = foo(o); -if (result !== false) - throw "Error: bad result at end (false): " + result; diff --git a/implementation-contributed/javascriptcore/stress/prop-type-int32-then-string.js b/implementation-contributed/javascriptcore/stress/prop-type-int32-then-string.js deleted file mode 100644 index ed0b71946f..0000000000 --- a/implementation-contributed/javascriptcore/stress/prop-type-int32-then-string.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(o) { - return o.f + 1; -} - -function bar(o, v) { - o.f = v; -} - -noInline(foo); -noInline(bar); - -var o = {}; -for (var i = 0; i < 5; ++i) - bar(o, 42); - -for (var i = 0; i < 10000; ++i) { - var result = foo(o); - if (result !== 43) - throw "Error: bad result: " + result; -} - -bar(o, "hello"); -var result = foo(o); -if (result !== "hello1") - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/prop-type-number-then-string.js b/implementation-contributed/javascriptcore/stress/prop-type-number-then-string.js deleted file mode 100644 index 65d96a2c8d..0000000000 --- a/implementation-contributed/javascriptcore/stress/prop-type-number-then-string.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(o) { - return o.f + 1; -} - -function bar(o, v) { - o.f = v; -} - -noInline(foo); -noInline(bar); - -var o = {}; -for (var i = 0; i < 5; ++i) - bar(o, 4.2); - -for (var i = 0; i < 10000; ++i) { - var result = foo(o); - if (result !== 5.2) - throw "Error: bad result: " + result; -} - -bar(o, "hello"); -var result = foo(o); -if (result !== "hello1") - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/prop-type-object-or-other-then-string.js b/implementation-contributed/javascriptcore/stress/prop-type-object-or-other-then-string.js deleted file mode 100644 index 016d6a0573..0000000000 --- a/implementation-contributed/javascriptcore/stress/prop-type-object-or-other-then-string.js +++ /dev/null @@ -1,33 +0,0 @@ -String.prototype.g = 44; - -function foo(o) { - return o.f == {toString:function() { return "hello"; }}; -} - -function bar(o, v) { - o.f = v; -} - -noInline(foo); -noInline(bar); - -var o = {}; -var p = {}; -for (var i = 0; i < 5; ++i) - bar(o, null); -for (var i = 0; i < 5; ++i) - bar(p, {g:43}); - -for (var i = 0; i < 10000; ++i) { - var result = foo(o); - if (result !== false) - throw "Error: bad result for o: " + result; - result = foo(p); - if (result !== false) - throw "Error: bad result for p: " + result; -} - -bar(o, "hello"); -var result = foo(o); -if (result !== true) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/prop-type-object-then-string.js b/implementation-contributed/javascriptcore/stress/prop-type-object-then-string.js deleted file mode 100644 index 2747405eb6..0000000000 --- a/implementation-contributed/javascriptcore/stress/prop-type-object-then-string.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(o) { - return o.f == {toString:function() { return "hello"; }}; -} - -function bar(o, v) { - o.f = v; -} - -noInline(foo); -noInline(bar); - -var o = {}; -for (var i = 0; i < 5; ++i) - bar(o, {}); - -for (var i = 0; i < 10000; ++i) { - var result = foo(o); - if (result !== false) - throw "Error: bad result: " + result; -} - -bar(o, "hello"); -var result = foo(o); -if (result !== true) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/prop-type-other-then-string.js b/implementation-contributed/javascriptcore/stress/prop-type-other-then-string.js deleted file mode 100644 index a1706a9a74..0000000000 --- a/implementation-contributed/javascriptcore/stress/prop-type-other-then-string.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(o) { - return o.f == "hello"; -} - -function bar(o, v) { - o.f = v; -} - -noInline(foo); -noInline(bar); - -var o = {}; -for (var i = 0; i < 5; ++i) - bar(o, null); - -for (var i = 0; i < 10000; ++i) { - var result = foo(o); - if (result !== false) - throw "Error: bad result: " + result; -} - -bar(o, "hello"); -var result = foo(o); -if (result !== true) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/prop-type-string-then-object.js b/implementation-contributed/javascriptcore/stress/prop-type-string-then-object.js deleted file mode 100644 index 8683614b88..0000000000 --- a/implementation-contributed/javascriptcore/stress/prop-type-string-then-object.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(o) { - return o.f + " world"; -} - -function bar(o, v) { - o.f = v; -} - -noInline(foo); -noInline(bar); - -var o = {}; -for (var i = 0; i < 5; ++i) - bar(o, "hello"); - -for (var i = 0; i < 10000; ++i) { - var result = foo(o); - if (result != "hello world") - throw "Error: bad result: " + result; -} - -bar(o, {toString: function() { return "hello"; }}); -var result = foo(o); -if (result != "hello world") - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/prop-type-struct-or-other-then-string.js b/implementation-contributed/javascriptcore/stress/prop-type-struct-or-other-then-string.js deleted file mode 100644 index 2b22b58dc6..0000000000 --- a/implementation-contributed/javascriptcore/stress/prop-type-struct-or-other-then-string.js +++ /dev/null @@ -1,36 +0,0 @@ -String.prototype.g = 44; - -function foo(o) { - var tmp = o.f; - if (tmp) - return tmp.g; - return 42; -} - -function bar(o, v) { - o.f = v; -} - -noInline(foo); -noInline(bar); - -var o = {}; -var p = {}; -for (var i = 0; i < 5; ++i) - bar(o, null); -for (var i = 0; i < 5; ++i) - bar(p, {g:43}); - -for (var i = 0; i < 10000; ++i) { - var result = foo(o); - if (result !== 42) - throw "Error: bad result for o: " + result; - result = foo(p); - if (result !== 43) - throw "Error: bad result for p: " + result; -} - -bar(o, "hello"); -var result = foo(o); -if (result !== 44) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/prop-type-struct-then-object-opt-fold.js b/implementation-contributed/javascriptcore/stress/prop-type-struct-then-object-opt-fold.js deleted file mode 100644 index 2c1d4570a4..0000000000 --- a/implementation-contributed/javascriptcore/stress/prop-type-struct-then-object-opt-fold.js +++ /dev/null @@ -1,34 +0,0 @@ -// This is like prop-type-struct-then-object.js, but it checks that the optimizing JITs emit the right type -// check above a hot put_by_id that starts polymorphic but is folded by AI. - -function foo(o) { - return o.f.g; -} - -function bar(o, p, v) { - if (isFinalTier() || o == p) { - var tmp = p.f; - o = p; - } - o.f = v; -} - -noInline(foo); -noInline(bar); - -var o = {f:{g:42}}; -for (var i = 0; i < 10000; ++i) { - bar(o, o, {g:42}); - bar({a:1, b:2}, o, {g:42}); -} - -for (var i = 0; i < 10000; ++i) { - var result = foo(o); - if (result !== 42) - throw "Error: bad result: " + result; -} - -bar(o, o, Object.create({g:43})); -var result = foo(o); -if (result !== 43) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/prop-type-struct-then-object-opt-multi.js b/implementation-contributed/javascriptcore/stress/prop-type-struct-then-object-opt-multi.js deleted file mode 100644 index 98d0a1fce6..0000000000 --- a/implementation-contributed/javascriptcore/stress/prop-type-struct-then-object-opt-multi.js +++ /dev/null @@ -1,30 +0,0 @@ -// This is like prop-type-struct-then-object.js, but it checks that the optimizing JITs emit the right type -// check above a hot polymorphic put_by_id that ends up being compiled as a MultiPutByOffset. - -function foo(o) { - return o.f.g; -} - -function bar(o, v) { - o.f = v; -} - -noInline(foo); -noInline(bar); - -var o = {f:{g:42}}; -for (var i = 0; i < 10000; ++i) { - bar(o, {g:42}); - bar({a:1, b:2}, 42); -} - -for (var i = 0; i < 10000; ++i) { - var result = foo(o); - if (result !== 42) - throw "Error: bad result: " + result; -} - -bar(o, Object.create({g:43})); -var result = foo(o); -if (result !== 43) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/prop-type-struct-then-object-opt.js b/implementation-contributed/javascriptcore/stress/prop-type-struct-then-object-opt.js deleted file mode 100644 index af7b91e20b..0000000000 --- a/implementation-contributed/javascriptcore/stress/prop-type-struct-then-object-opt.js +++ /dev/null @@ -1,28 +0,0 @@ -// This is like prop-type-struct-then-object.js, but it checks that the optimizing JITs emit the right type -// check above a hot put_by_id. - -function foo(o) { - return o.f.g; -} - -function bar(o, v) { - o.f = v; -} - -noInline(foo); -noInline(bar); - -var o = {f:{g:42}}; -for (var i = 0; i < 10000; ++i) - bar(o, {g:42}); - -for (var i = 0; i < 10000; ++i) { - var result = foo(o); - if (result !== 42) - throw "Error: bad result: " + result; -} - -bar(o, Object.create({g:43})); -var result = foo(o); -if (result !== 43) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/prop-type-struct-then-object.js b/implementation-contributed/javascriptcore/stress/prop-type-struct-then-object.js deleted file mode 100644 index cf4cc185a7..0000000000 --- a/implementation-contributed/javascriptcore/stress/prop-type-struct-then-object.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(o) { - return o.f.g; -} - -function bar(o, v) { - o.f = v; -} - -noInline(foo); -noInline(bar); - -var o = {}; -for (var i = 0; i < 5; ++i) - bar(o, {g:42}); - -for (var i = 0; i < 10000; ++i) { - var result = foo(o); - if (result !== 42) - throw "Error: bad result: " + result; -} - -bar(o, Object.create({g:43})); -var result = foo(o); -if (result !== 43) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/prop-type-symbol-then-object.js b/implementation-contributed/javascriptcore/stress/prop-type-symbol-then-object.js deleted file mode 100644 index d3c09efc1c..0000000000 --- a/implementation-contributed/javascriptcore/stress/prop-type-symbol-then-object.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(o) { - return typeof o.f; -} - -function bar(o, v) { - o.f = v; -} - -noInline(foo); -noInline(bar); - -var o = {}; -for (var i = 0; i < 5; ++i) - bar(o, Symbol("Cocoa")); - -for (var i = 0; i < 10000; ++i) { - var result = foo(o); - if (result != "symbol") - throw "Error: bad result: " + result; -} - -bar(o, {toString: function() { return "hello"; }}); -var result = foo(o); -if (result != "object") - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/prop-type-symbol-then-string.js b/implementation-contributed/javascriptcore/stress/prop-type-symbol-then-string.js deleted file mode 100644 index eef6c45e01..0000000000 --- a/implementation-contributed/javascriptcore/stress/prop-type-symbol-then-string.js +++ /dev/null @@ -1,26 +0,0 @@ -function foo(o) { - return typeof o.f === "symbol"; -} - -function bar(o, v) { - o.f = v; -} - -noInline(foo); -noInline(bar); - -var o = {}; -for (var i = 0; i < 5; ++i) - bar(o, Symbol("Cocoa")); - -for (var i = 0; i < 10000; ++i) { - var result = foo(o); - if (result !== true) - throw "Error: bad result: " + result; -} - -bar(o, "hello"); -var result = foo(o); -result = foo(o); -if (result !== false) - throw "Error: bad result at end (false): " + result; diff --git a/implementation-contributed/javascriptcore/stress/proper-flushing-when-we-insert-unreachable-after-force-exit-in-bytecode-parser.js b/implementation-contributed/javascriptcore/stress/proper-flushing-when-we-insert-unreachable-after-force-exit-in-bytecode-parser.js deleted file mode 100644 index 619461dc81..0000000000 --- a/implementation-contributed/javascriptcore/stress/proper-flushing-when-we-insert-unreachable-after-force-exit-in-bytecode-parser.js +++ /dev/null @@ -1,27 +0,0 @@ -function test(b, f) { - if (b) - return f(b); -} -noInline(test); - -function throwError(b) { - if (b) { - try { - throw new Error; - } catch(e) { } - } - return 2; -} -noInline(throwError); - -function makeFoo() { - return function foo(b) { - throwError(b); - OSRExit(); - } -} - -let foos = [makeFoo(), makeFoo()]; -for (let i = 0; i < 10000; ++i) { - test(!!(i%2), foos[((Math.random() * 100) | 0) % foos.length]); -} diff --git a/implementation-contributed/javascriptcore/stress/proper-property-store-with-prototype-property-that-is-not-writable.js b/implementation-contributed/javascriptcore/stress/proper-property-store-with-prototype-property-that-is-not-writable.js deleted file mode 100644 index 10485f73c4..0000000000 --- a/implementation-contributed/javascriptcore/stress/proper-property-store-with-prototype-property-that-is-not-writable.js +++ /dev/null @@ -1,13 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion."); -} - -let x = (new Set)[Symbol.iterator](); -assert(x[Symbol.toStringTag] === "Set Iterator"); - -let y = {__proto__: x}; -assert(y[Symbol.toStringTag] === "Set Iterator"); -y[Symbol.toStringTag] = 25; -assert(y[Symbol.toStringTag] === "Set Iterator"); -assert(x[Symbol.toStringTag] === "Set Iterator"); diff --git a/implementation-contributed/javascriptcore/stress/property-name-enumerator-should-not-look-into-indexed-values-when-it-is-a-dictionary.js b/implementation-contributed/javascriptcore/stress/property-name-enumerator-should-not-look-into-indexed-values-when-it-is-a-dictionary.js deleted file mode 100644 index abf8672354..0000000000 --- a/implementation-contributed/javascriptcore/stress/property-name-enumerator-should-not-look-into-indexed-values-when-it-is-a-dictionary.js +++ /dev/null @@ -1,38 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -(function() { - "use strict"; - var cols = {"col":{"title":" ","type":"sys","events":[],"name":0,"id":0,"_i":0}}; - var len = 0; - var remapcols = ['col']; - for (var i = 0; i < remapcols.length; i++) { - cols[cols[remapcols[i]].name] = cols[remapcols[i]]; - delete cols[remapcols[i]]; - } - var count = 0; - for (var col2 in cols) { - count++; - shouldBe(col2, '0'); - } - shouldBe(count, 1); -}()); - -(function() { - "use strict"; - var cols = {"col":{"title":" ","type":"sys","events":[],"name":0,"id":0,"_i":0}}; - var len = 0; - var remapcols = ['col']; - for (var i = 0; i < remapcols.length; i++) { - cols[cols[remapcols[i]].name] = cols[remapcols[i]]; - delete cols[remapcols[i]]; - } - var count = 0; - for (var col2 in cols) { - count++; - shouldBe(col2, '0'); - } - shouldBe(count, 1); -}()); diff --git a/implementation-contributed/javascriptcore/stress/property-setters-should-not-be-called-for-bound-arguments-list-entries.js b/implementation-contributed/javascriptcore/stress/property-setters-should-not-be-called-for-bound-arguments-list-entries.js deleted file mode 100644 index d67862ff32..0000000000 --- a/implementation-contributed/javascriptcore/stress/property-setters-should-not-be-called-for-bound-arguments-list-entries.js +++ /dev/null @@ -1,8 +0,0 @@ -Object.defineProperty(Array.prototype, "0", { - set: () => { - throw "ERROR: setter should not be called for bound arguments list"; - } -}); - -function dummy() { } -var f = dummy.bind({}, 1, 2, 3, 4); diff --git a/implementation-contributed/javascriptcore/stress/proto-setter.js b/implementation-contributed/javascriptcore/stress/proto-setter.js deleted file mode 100644 index 33b7afab82..0000000000 --- a/implementation-contributed/javascriptcore/stress/proto-setter.js +++ /dev/null @@ -1,8 +0,0 @@ -// RegExp.input is a handy setter - -var o = {}; - -for (var k = 0; k < 9; k++) { - o = {__proto__ : o }; -} - diff --git a/implementation-contributed/javascriptcore/stress/prototype-chain-has-dictionary-structure-for-in-caching.js b/implementation-contributed/javascriptcore/stress/prototype-chain-has-dictionary-structure-for-in-caching.js deleted file mode 100644 index 4f1a86f3c1..0000000000 --- a/implementation-contributed/javascriptcore/stress/prototype-chain-has-dictionary-structure-for-in-caching.js +++ /dev/null @@ -1,36 +0,0 @@ - -function assert(b) { - if (!b) - throw new Error("Bad") -} - -var Test = function(){}; - -let methodNumber = 0; -function addMethods() { - const methodCount = 65; - for (var i = 0; i < methodCount; i++){ - Test.prototype['myMethod' + i + methodNumber] = function(){}; - ++methodNumber; - } -} - -addMethods(); - -var test1 = new Test(); - -for (var k in test1) { } - -let test2 = new Test(); - -for (let i = 0; i < 100; ++i ) { - let propName = 'myAdditionalMethod' + i; - Test.prototype[propName] = function(){}; - let foundNewPrototypeProperty = false; - for (let k in test2) { - if (propName === k) - foundNewPrototypeProperty = true; - } - assert(foundNewPrototypeProperty); - addMethods(); -} diff --git a/implementation-contributed/javascriptcore/stress/prototype-for-async-generator.js b/implementation-contributed/javascriptcore/stress/prototype-for-async-generator.js deleted file mode 100644 index a3f5cdb4fd..0000000000 --- a/implementation-contributed/javascriptcore/stress/prototype-for-async-generator.js +++ /dev/null @@ -1,19 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -async function* asyncGenerator() { } - -var AsyncGeneratorPrototype = Object.getPrototypeOf(asyncGenerator).prototype; - -shouldBe(Object.getPrototypeOf(asyncGenerator.prototype), AsyncGeneratorPrototype); - -class A { - async *asyncGenerator() - { - } -} - -var a = new A; -shouldBe(Object.getPrototypeOf(a.asyncGenerator.prototype), AsyncGeneratorPrototype); diff --git a/implementation-contributed/javascriptcore/stress/prototype-getter.js b/implementation-contributed/javascriptcore/stress/prototype-getter.js deleted file mode 100644 index 07f516786d..0000000000 --- a/implementation-contributed/javascriptcore/stress/prototype-getter.js +++ /dev/null @@ -1,21 +0,0 @@ -function Foo(g) { - this.g_ = g; -} -Foo.prototype.__defineGetter__("f", function() { return this.g_ + 32; }); -Foo.prototype.__defineGetter__("g", function() { return this.g_ + 33; }); -Foo.prototype.__defineGetter__("h", function() { return this.g_ + 34; }); -Foo.prototype.__defineGetter__("i", function() { return this.g_ + 35; }); -Foo.prototype.__defineGetter__("j", function() { return this.g_ + 36; }); -Foo.prototype.__defineGetter__("k", function() { return this.g_ + 37; }); - -function foo(o) { - return o.f + o.k * 1000; -} - -noInline(foo); - -for (var i = 0; i < 100; ++i) { - var result = foo(new Foo(5)); - if (result != (32 + 5) + (37 + 5) * 1000) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/prototype-is-not-js-object.js b/implementation-contributed/javascriptcore/stress/prototype-is-not-js-object.js deleted file mode 100644 index 6ae2ca1e53..0000000000 --- a/implementation-contributed/javascriptcore/stress/prototype-is-not-js-object.js +++ /dev/null @@ -1,32 +0,0 @@ -function foo() { - function bar() { - this.x = 42; - } - bar.prototype = 50; - return new bar(); -} - -function assert(b) { - if (!b) - throw new Error("Bad"); -} - -let items = [ - foo(), - foo(), - foo(), - foo(), - foo(), - foo(), -]; - -function validate(item) { - assert(item.notThere === undefined); - assert(item.x === 42); - assert(item.__proto__ === Object.prototype); -} - -for (let i = 0; i < 10000; ++i) { - for (let item of items) - validate(item); -} diff --git a/implementation-contributed/javascriptcore/stress/prune-multi-put-by-offset-replace-or-transition-variant.js b/implementation-contributed/javascriptcore/stress/prune-multi-put-by-offset-replace-or-transition-variant.js deleted file mode 100644 index 8a5604c835..0000000000 --- a/implementation-contributed/javascriptcore/stress/prune-multi-put-by-offset-replace-or-transition-variant.js +++ /dev/null @@ -1,58 +0,0 @@ -function foo(o) { - o.f = 1; -} - -function fu(o) { - o.e = 2; -} - -function bar(f, o) { - f(o); -} - -function baz(f, o) { - f(o); -} - -for (var i = 0; i < 100; ++i) { - foo({f:1, e:2}); - foo({e:1, f:2}); - foo({e:1}); - foo({d:1, e:2, f:3}); - fu({f:1, e:2}); - fu({e:1, f:2}); - fu({e:1, f:2, g:3}); - fu({d:1, e:2, f:3, g:4}); -} - -for (var i = 0; i < 100; ++i) { - bar(foo, {f:1}); - bar(function() { }, null); - bar(function() { return 42; }, null); - baz(fu, {e:1}); - baz(function() { }, null); - baz(function() { return 42; }, null); -} - -(function(f, g, o, p) { - var result = 0; - var n = 1000000; - for (var i = 0; i < n; ++i) { - var q; - if (i == n - 1) - q = p; - else - q = o; - baz(g, q); - bar(f, q); - } - if (o.e != 2) - throw "Error: bad value in o.e: " + o.e; - if (o.f != 1) - throw "Error: bad value in o.f: " + o.f; - if (p.e != 2) - throw "Error: bad value in p.e: " + p.e; - if (p.f != 1) - throw "Error: bad value in p.f: " + p.f; -})(foo, fu, {e:42, f:2}, {e:12, f:13, g:14}); - diff --git a/implementation-contributed/javascriptcore/stress/put-by-id-build-list-order-recurse.js b/implementation-contributed/javascriptcore/stress/put-by-id-build-list-order-recurse.js deleted file mode 100644 index 09d0219920..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-id-build-list-order-recurse.js +++ /dev/null @@ -1,35 +0,0 @@ -var count = 0; - -function setter(value) { - Object.defineProperty( - this, "f", { - enumerable: true, - configurable: true, - writable: true, - value: 32 - }); - var o = Object.create(this); - var currentCount = count++; - var str = "for (var i = " + currentCount + "; i < " + (100 + currentCount) + "; ++i)\n" - + " o.f\n"; - eval(str); -} - -function foo(o) { - o.f = 42; -} - -noInline(foo); - -for (var i = 0; i < 1000; ++i) { - var o = {}; - o.__defineSetter__("f", setter); - - foo(o); - if (o.f != 32) - throw ("Error 1: "+o.f); - - foo(o); - if (o.f != 42) - throw ("Error 2: "+o.f); -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/put-by-id-direct-should-be-done-for-non-index-property.js b/implementation-contributed/javascriptcore/stress/put-by-id-direct-should-be-done-for-non-index-property.js deleted file mode 100644 index 015952271f..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-id-direct-should-be-done-for-non-index-property.js +++ /dev/null @@ -1,41 +0,0 @@ -(function () { - var object = { - 2: 2 - }; - - var result = object[2]; - if (result !== 2) - throw new Error('bad value:' + result); -}()); - - -(function () { - var object = { - get 2() { - return 1; - }, - set 2(value) { - throw new Error(2); - }, - }; - - var result = object[2]; - if (result !== 1) - throw new Error('bad value:' + result); -}()); - -(function () { - var object = { - get 2() { - return 1; - }, - set 2(value) { - throw new Error(2); - }, - 2: 2, // Do not throw new Error(2) - }; - - var result = object[2]; - if (result !== 2) - throw new Error('bad value:' + result); -}()); diff --git a/implementation-contributed/javascriptcore/stress/put-by-id-direct-strict-transition.js b/implementation-contributed/javascriptcore/stress/put-by-id-direct-strict-transition.js deleted file mode 100644 index 6951617188..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-id-direct-strict-transition.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict" - -let theglobal = 0; -for (theglobal = 0; theglobal < 100000; ++theglobal) - ; -const foo = (ignored, arg1) => { theglobal = arg1; }; -for (let j = 0; j < 10000; ++j) { - const obj = { - set hello(ignored) {}, - [theglobal]: 0 - }; - foo(obj, 'hello'); -} diff --git a/implementation-contributed/javascriptcore/stress/put-by-id-direct-transition.js b/implementation-contributed/javascriptcore/stress/put-by-id-direct-transition.js deleted file mode 100644 index 611f8ed266..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-id-direct-transition.js +++ /dev/null @@ -1,11 +0,0 @@ -let theglobal = 0; -for (theglobal = 0; theglobal < 100000; ++theglobal) - ; -const foo = (ignored, arg1) => { theglobal = arg1; }; -for (let j = 0; j < 10000; ++j) { - const obj = { - set hello(ignored) {}, - [theglobal]: 0 - }; - foo(obj, 'hello'); -} diff --git a/implementation-contributed/javascriptcore/stress/put-by-id-on-new-object-after-prototype-transition-non-strict.js b/implementation-contributed/javascriptcore/stress/put-by-id-on-new-object-after-prototype-transition-non-strict.js deleted file mode 100644 index 15cc9f99c9..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-id-on-new-object-after-prototype-transition-non-strict.js +++ /dev/null @@ -1,31 +0,0 @@ -function opaqueNewObject(prototype) -{ - return Object.create(prototype); -} -noInline(opaqueNewObject); - -function putValueOnNewObject(value, prototype) -{ - var object = opaqueNewObject(prototype); - object.myProperty = value; - return object; -} -noInline(putValueOnNewObject) - -for (var i = 0; i < 1e4; ++i) { - var initialPrototype = new Object; - for (var j = 0; j < 5; ++j) { - var object = putValueOnNewObject(j, initialPrototype); - if (object["myProperty"] !== j) { - throw "Ooops, we mess up before the prototype change at iteration i = " + i + " j = " + j; - } - } - - initialPrototype.foo = "bar"; - for (var j = 0; j < 5; ++j) { - var object = putValueOnNewObject(j, initialPrototype); - if (object["myProperty"] !== j) { - throw "Ooops, we mess up at iteration i = " + i + " j = " + j; - } - } -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/put-by-id-on-new-object-after-prototype-transition-strict.js b/implementation-contributed/javascriptcore/stress/put-by-id-on-new-object-after-prototype-transition-strict.js deleted file mode 100644 index 45422443cc..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-id-on-new-object-after-prototype-transition-strict.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict" - -function opaqueNewObject(prototype) -{ - return Object.create(prototype); -} -noInline(opaqueNewObject); - -function putValueOnNewObject(value, prototype) -{ - var object = opaqueNewObject(prototype); - object.myProperty = value; - return object; -} -noInline(putValueOnNewObject) - -for (var i = 0; i < 1e4; ++i) { - var initialPrototype = new Object; - for (var j = 0; j < 5; ++j) { - var object = putValueOnNewObject(j, initialPrototype); - if (object["myProperty"] !== j) { - throw "Ooops, we mess up before the prototype change at iteration i = " + i + " j = " + j; - } - } - - initialPrototype.foo = "bar"; - for (var j = 0; j < 5; ++j) { - var object = putValueOnNewObject(j, initialPrototype); - if (object["myProperty"] !== j) { - throw "Ooops, we mess up at iteration i = " + i + " j = " + j; - } - } -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/put-by-id-strict-build-list-order.js b/implementation-contributed/javascriptcore/stress/put-by-id-strict-build-list-order.js deleted file mode 100644 index baab8e53c4..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-id-strict-build-list-order.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(o) { - "use strict"; - o.f = 42; -} - -noInline(foo); - -var a = {}; -foo(a); -foo(a); -a = {f : 3}; -foo(a); - -var b = {}; -foo(b); -foo(b); diff --git a/implementation-contributed/javascriptcore/stress/put-by-id-throw-through-optimized-code.js b/implementation-contributed/javascriptcore/stress/put-by-id-throw-through-optimized-code.js deleted file mode 100644 index 07541ba963..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-id-throw-through-optimized-code.js +++ /dev/null @@ -1,33 +0,0 @@ -function foo(o) { - "use strict"; - o.f = 42; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var o = {}; - foo(o); - if (o.f != 42) - throw "Error: bad result: " + o.f; - o = {f:23}; - foo(o); - if (o.f != 42) - throw "Error: bad result: " + o.f; - o = {g:12}; - foo(o); - if (o.f != 42) - throw "Error: bad result: " + o.f; -} - -var didThrow; -try { - var o = {}; - Object.freeze(o); - foo(o); -} catch (e) { - didThrow = e; -} - -if (!didThrow || didThrow.toString().indexOf("TypeError:") != 0) - throw "Error: didn't throw or threw wrong exception: " + didThrow; diff --git a/implementation-contributed/javascriptcore/stress/put-by-id-transition-null-prototype.js b/implementation-contributed/javascriptcore/stress/put-by-id-transition-null-prototype.js deleted file mode 100644 index 9c7c69951f..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-id-transition-null-prototype.js +++ /dev/null @@ -1,13 +0,0 @@ -function foo(o) { - o.f = 42; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var o = Object.create(null); - foo(o); - if (o.f != 42) - throw "Error: bad result: " + o.f; -} - diff --git a/implementation-contributed/javascriptcore/stress/put-by-val-array-storage.js b/implementation-contributed/javascriptcore/stress/put-by-val-array-storage.js deleted file mode 100644 index c7d284f2c2..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-val-array-storage.js +++ /dev/null @@ -1,40 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testArrayStorageInBounds(array, index, value) -{ - array[index] = value; -} -noInline(testArrayStorageInBounds); - -for (var i = 0; i < 1e5; ++i) { - var array = [1, 2, 3, 4, 5]; - ensureArrayStorage(array); - shouldBe(array[0], 1); - testArrayStorageInBounds(array, 0, 42); - shouldBe(array[0], 42); -} -for (var i = 0; i < 1e5; ++i) { - var array = [, 2, 3, 4]; - ensureArrayStorage(array); - shouldBe(array[0], undefined); - shouldBe(array[1], 2); - testArrayStorageInBounds(array, 0, 42); - testArrayStorageInBounds(array, 1, 40); - shouldBe(array[0], 42); - shouldBe(array[1], 40); - shouldBe(array.length, 4); - testArrayStorageInBounds(array, 4, 42); - shouldBe(array[4], 42); - shouldBe(array.length, 5); -} -for (var i = 0; i < 1e5; ++i) { - var array = [, 2, 3, 4]; - ensureArrayStorage(array); - shouldBe(array[6], undefined); - testArrayStorageInBounds(array, 6, 42); - shouldBe(array.length, 7); - shouldBe(array[6], 42); -} diff --git a/implementation-contributed/javascriptcore/stress/put-by-val-out-of-bounds-basics.js b/implementation-contributed/javascriptcore/stress/put-by-val-out-of-bounds-basics.js deleted file mode 100644 index 186c9fbd52..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-val-out-of-bounds-basics.js +++ /dev/null @@ -1,87 +0,0 @@ -// Put early out-of-bound data. -function opaquePutByValOnInt32ArrayEarlyOutOfBounds(array, index, value) -{ - array[index] = value; -} -noInline(opaquePutByValOnInt32ArrayEarlyOutOfBounds); - -function testInt32ArrayEarlyOutOfBounds() -{ - // Warm up with an immediate out of bounds. - var int32Array = new Array(10); - for (var i = 0; i < 10; ++i) { - opaquePutByValOnInt32ArrayEarlyOutOfBounds(int32Array, i, i); - var value = int32Array[i]; - if (value !== i) - throw "Failed opaquePutByValOnInt32ArrayEarlyOutOfBounds(int32Array, i, i) warmup with i = " + i + " value = " + value; - } - opaquePutByValOnInt32ArrayEarlyOutOfBounds(int32Array, 1042, 1); - var value = int32Array[1042]; - if (value !== 1) - throw "Failed opaquePutByValOnInt32ArrayEarlyOutOfBounds(int32Array, 1042, 1) value = " + value; - - var length = int32Array.length; - if (int32Array.length !== 1043) - throw "Incorrect int32Array.length, length = " + length; - - - // We then do plenty of in-bounds accesses. - for (var i = 0; i < 1e4; ++i) { - for (var j = 0; j < 10; ++j) { - opaquePutByValOnInt32ArrayEarlyOutOfBounds(int32Array, j, i); - var value = int32Array[j]; - if (value !== i) - throw "Failed opaquePutByValOnInt32ArrayEarlyOutOfBounds(int32Array, j, i) in-bounds with i = " + i + " j = " + j + " value = " + value; - } - } -} -testInt32ArrayEarlyOutOfBounds(); - - -// Get out-of-bound data after a thousand run. -function opaquePutByValOnStringArrayHotOutOfBounds(array, index, value) -{ - array[index] = value; -} -noInline(opaquePutByValOnStringArrayHotOutOfBounds); - -function testStringArrayHotOutOfBounds() -{ - // Warm up with in bounds access. - var stringArray = new Array(10); - for (var i = 0; i < 1e2; ++i) { - for (var j = 0; j < 10; ++j) { - opaquePutByValOnStringArrayHotOutOfBounds(stringArray, j, "" + i); - var value = stringArray[j]; - if (value !== "" + i) - throw "Failed opaquePutByValOnStringArrayHotOutOfBounds(stringArray, j, i) in-bounds with i = " + i + " j = " + j + " value = " + value; - } - } - - // Do a single out of bounds after warmup. - opaquePutByValOnStringArrayHotOutOfBounds(stringArray, 513, 42); - var value = stringArray[513]; - if (value !== 42) - throw "Failed opaquePutByValOnStringArrayHotOutOfBounds(stringArray, 513, 42), value = " + value; - - // We then do plenty of in-bounds accesses. - for (var i = 0; i < 1e3; ++i) { - for (var j = 0; j < 10; ++j) { - opaquePutByValOnStringArrayHotOutOfBounds(stringArray, j, "" + i); - var value = stringArray[j]; - if (value !== "" + i) - throw "Failed opaquePutByValOnStringArrayHotOutOfBounds(stringArray, j, i) in-bounds with i = " + i + " j = " + j + " value = " + value; - } - } - - // Followed by plenty of out-of-bounds accesses. - for (var j = 514; j <= 1025; ++j) - opaquePutByValOnStringArrayHotOutOfBounds(stringArray, j, "" + j); - - for (var j = 514; j <= 1025; ++j) { - var value = stringArray[j]; - if (value !== "" + j) - throw "Failed opaquePutByValOnStringArrayHotOutOfBounds(stringArray, j, j) in-bounds with j = " + j + " value = " + value; - } -} -testStringArrayHotOutOfBounds(); diff --git a/implementation-contributed/javascriptcore/stress/put-by-val-slow-put-array-storage.js b/implementation-contributed/javascriptcore/stress/put-by-val-slow-put-array-storage.js deleted file mode 100644 index b910ff5a0c..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-val-slow-put-array-storage.js +++ /dev/null @@ -1,67 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testArrayStorageInBounds(array, index, value) -{ - array[index] = value; -} -noInline(testArrayStorageInBounds); - -for (var i = 0; i < 1e4; ++i) { - var array = [1, 2, 3, 4, 5]; - var object = { a: 10 }; - Object.defineProperties(object, { - "1": { - get: function() { return this.a; }, - set: function(x) { this.a = x; }, - }, - }); - array.__proto__ = object; - ensureArrayStorage(array); - shouldBe(array[0], 1); - testArrayStorageInBounds(array, 0, 42); - shouldBe(array[0], 42); -} -for (var i = 0; i < 1e4; ++i) { - var array = [, 2, 3, 4]; - var object = { a: 10 }; - Object.defineProperties(object, { - "1": { - get: function() { return this.a; }, - set: function(x) { this.a = x + 20; }, - }, - }); - array.__proto__ = object; - ensureArrayStorage(array); - shouldBe(array[0], undefined); - shouldBe(array[1], 2); - testArrayStorageInBounds(array, 0, 42); - testArrayStorageInBounds(array, 1, 40); - shouldBe(array[0], 42); - shouldBe(array[1], 40); - testArrayStorageInBounds(array, 4, 42); - shouldBe(array[4], 42); - shouldBe(array.length, 5); -} -for (var i = 0; i < 1e4; ++i) { - var array = [, , 3, 4]; - var object = { a: 10 }; - Object.defineProperties(object, { - "1": { - get: function() { return this.a; }, - set: function(x) { this.a = x + 20; }, - }, - }); - array.__proto__ = object; - ensureArrayStorage(array); - shouldBe(array[0], undefined); - shouldBe(array[1], 10); - shouldBe(array[6], undefined); - testArrayStorageInBounds(array, 6, 42); - testArrayStorageInBounds(array, 1, 42); - shouldBe(array.length, 7); - shouldBe(array[1], 62); - shouldBe(array[6], 42); -} diff --git a/implementation-contributed/javascriptcore/stress/put-by-val-with-string-break.js b/implementation-contributed/javascriptcore/stress/put-by-val-with-string-break.js deleted file mode 100644 index 5ee64cafee..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-val-with-string-break.js +++ /dev/null @@ -1,25 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function assign(object, name, value) -{ - object[name] = value; -} -noInline(assign); - -var string = 'hello'; -for (var i = 0; i < 10001; ++i) { - var object = {}; - if (i === 10000) { - assign(object, 42, 42); - shouldBe(object[42], 42); - shouldBe(object.hello, undefined); - } else { - assign(object, string, 42); - shouldBe(object[string], 42); - } -} - diff --git a/implementation-contributed/javascriptcore/stress/put-by-val-with-string-generated.js b/implementation-contributed/javascriptcore/stress/put-by-val-with-string-generated.js deleted file mode 100644 index c1f43ad3b0..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-val-with-string-generated.js +++ /dev/null @@ -1,34 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function gen1(value) -{ - return 'he' + value; -} -noInline(gen1); - -function gen2(value) -{ - return value + 'ld'; -} -noInline(gen2); - -function assign(object, name, value) -{ - object[name] = value; -} -noInline(assign); - -for (var i = 0; i < 10000; ++i) { - var object = {}; - if (i % 2 === 0) { - assign(object, gen1('llo'), 42); - shouldBe(object.hello, 42); - } else { - assign(object, gen2('wor'), 42); - shouldBe(object.world, 42); - } -} diff --git a/implementation-contributed/javascriptcore/stress/put-by-val-with-string-generic.js b/implementation-contributed/javascriptcore/stress/put-by-val-with-string-generic.js deleted file mode 100644 index a6ff811604..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-val-with-string-generic.js +++ /dev/null @@ -1,25 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function assign(object, name, value) -{ - object[name] = value; -} -noInline(assign); - -var string = 'hello'; -for (var i = 0; i < 10001; ++i) { - var object = {}; - if (i === 10000) { - assign(object, 'testing', 42); - shouldBe(object.testing, 42); - shouldBe(object.hello, undefined); - } else { - assign(object, string, 42); - shouldBe(object[string], 42); - } -} - diff --git a/implementation-contributed/javascriptcore/stress/put-by-val-with-symbol-break.js b/implementation-contributed/javascriptcore/stress/put-by-val-with-symbol-break.js deleted file mode 100644 index d548511144..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-val-with-symbol-break.js +++ /dev/null @@ -1,25 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function assign(object, name, value) -{ - object[name] = value; -} -noInline(assign); - -var key = Symbol(); -for (var i = 0; i < 10001; ++i) { - var object = {}; - if (i === 10000) { - var key2 = 42; - assign(object, key2, 42); - shouldBe(object[key2], 42); - shouldBe(object[key], undefined); - } else { - assign(object, key, 42); - shouldBe(object[key], 42); - } -} diff --git a/implementation-contributed/javascriptcore/stress/put-by-val-with-symbol-generic.js b/implementation-contributed/javascriptcore/stress/put-by-val-with-symbol-generic.js deleted file mode 100644 index 5fc4d18d40..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-by-val-with-symbol-generic.js +++ /dev/null @@ -1,25 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function assign(object, name, value) -{ - object[name] = value; -} -noInline(assign); - -var key = Symbol(); -for (var i = 0; i < 10001; ++i) { - var object = {}; - if (i === 10000) { - var key2 = Symbol(); - assign(object, key2, 42); - shouldBe(object[key2], 42); - shouldBe(object[key], undefined); - } else { - assign(object, key, 42); - shouldBe(object[key], 42); - } -} diff --git a/implementation-contributed/javascriptcore/stress/put-direct-index-broken-2.js b/implementation-contributed/javascriptcore/stress/put-direct-index-broken-2.js deleted file mode 100644 index ee6da71b41..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-direct-index-broken-2.js +++ /dev/null @@ -1,248 +0,0 @@ -//@ skip if $architecture == "x86" -function assert(b) { - if (!b) - throw new Error("Bad assertion"); -} - -function test(f) { - for (let i = 0; i < 1000; ++i) { - f(); - } -} - -let __oldDesc = null; -let __localLength; -function makeLengthWritable() { - assert(__oldDesc === null); - __oldDesc = Object.getOwnPropertyDescriptor(Uint8ClampedArray.prototype.__proto__, "length"); - assert(typeof __oldDesc.get === "function"); - Reflect.defineProperty(Uint8ClampedArray.prototype.__proto__, "length", {configurable:true, get() { return __localLength; }, set(x) { __localLength = x; }}); -} - -function restoreOldDesc() { - assert(__oldDesc !== null); - Reflect.defineProperty(Uint8ClampedArray.prototype.__proto__, "length", __oldDesc); - __oldDesc = null; -} - -test(function() { - "use strict"; - let a = []; - a.push(300); - a.length = 4277; - - let x = new Uint8ClampedArray; - a.__proto__ = x; - let err = null; - try { - let y = Array.prototype.map.call(a, x => x); - } catch(e) { - err = e; - } - assert(!!err); - assert(err.toString() === "TypeError: Attempting to configure non-configurable property on a typed array at index: 0"); -}); - -test(function() { - let a = []; - for (let i = 0; i < 100; i++) { - a.push(i); - } - a.length = 4277; - let x = new Uint8ClampedArray; - a.__proto__ = x; - let err = null; - try { - let y = Array.prototype.filter.call(a, x => true); - } catch(e) { - err = e; - } - assert(err.toString() === "TypeError: Attempting to configure non-configurable property on a typed array at index: 0"); -}); - -test(function() { - let a = []; - for (let i = 0; i < 100; i++) { - a.push(i); - } - a.length = 4277; - let x = new Uint8ClampedArray; - a.__proto__ = x; - let err = null; - let y = Array.prototype.filter.call(a, x => false); - assert(y instanceof Uint8ClampedArray); -}); - -test(function() { - let a = []; - for (let i = 0; i < 100; i++) { - a.push(i); - } - a.length = 4277; - let x = new Uint8ClampedArray; - a.__proto__ = x; - - let err = null; - try { - let y = Array.prototype.slice.call(a, 0); - } catch(e) { - err = e; - } - assert(err.toString() === "TypeError: Attempting to configure non-configurable property on a typed array at index: 0"); -}); - -test(function() { - let a = []; - for (let i = 0; i < 100; i++) { - a.push(i); - } - a.length = 4277; - let x = new Uint8ClampedArray; - a.__proto__ = x; - - makeLengthWritable(); - let y = Array.prototype.slice.call(a, 100); - assert(y.length === 4277 - 100); - assert(y.length === __localLength); - assert(y instanceof Uint8ClampedArray); - restoreOldDesc(); -}); - -test(function() { - let a = []; - for (let i = 0; i < 100; i++) { - a.push(i); - } - a.length = 4277; - let x = new Uint8ClampedArray; - a.__proto__ = x; - - makeLengthWritable(); - let y = Array.prototype.splice.call(a); - assert(y.length === __localLength); - assert(y.length === 0); - restoreOldDesc(); -}); - -test(function() { - let a = []; - for (let i = 0; i < 100; i++) { - a.push(i); - } - a.length = 4277; - let x = new Uint8ClampedArray; - a.__proto__ = x; - - let err = null; - try { - let y = Array.prototype.splice.call(a, 0); - } catch(e) { - err = e; - } - assert(err.toString() === "TypeError: Attempting to configure non-configurable property on a typed array at index: 0"); -}); - -test(function() { - let a = []; - for (let i = 0; i < 100; i++) { - a.push(i); - } - a.length = 4277; - let x = new Uint8ClampedArray; - a.__proto__ = x; - - makeLengthWritable(); - let y = Array.prototype.slice.call(a, 100); - assert(y.length === 4277 - 100); - assert(y.length === __localLength); - assert(y instanceof Uint8ClampedArray); - restoreOldDesc(); -}); - -test(function() { - let a = []; - for (let i = 0; i < 100; i++) { - a.push(i); - } - a.length = 4277; - let calls = 0; - let target = {}; - a.__proto__ = { - constructor: { - [Symbol.species]: function(length) { - assert(length === 4277) - return new Proxy(target, { - defineProperty(...args) { - ++calls; - return Reflect.defineProperty(...args); - } - }); - } - } - }; - let y = Array.prototype.map.call(a, x => x); - assert(calls === 100); - for (let i = 0; i < 100; ++i) - assert(target[i] === i); -}); - -test(function() { - let a = []; - for (let i = 0; i < 100; i++) { - a.push(i); - } - a.length = 4277; - let calls = 0; - let target = {}; - a.__proto__ = { - constructor: { - [Symbol.species]: function(length) { - assert(length === 0) - return new Proxy(target, { - defineProperty(...args) { - ++calls; - return Reflect.defineProperty(...args); - } - }); - } - } - }; - let y = Array.prototype.filter.call(a, x => true); - assert(calls === 100); - for (let i = 0; i < 100; ++i) - assert(target[i] === i); -}); - -test(function() { - let a = []; - for (let i = 0; i < 100; i++) { - a.push(i); - } - a.length = 4277; - let calls = 0; - let target = {}; - let keys = []; - a.__proto__ = { - constructor: { - [Symbol.species]: function(length) { - assert(length === 4277) - return new Proxy(target, { - defineProperty(...args) { - keys.push(args[1]) - ++calls; - return Reflect.defineProperty(...args); - } - }); - } - } - }; - let y = Array.prototype.slice.call(a, 0); - assert(calls === 101); // length gets defined too. - assert(keys.length === 101); - for (let i = 0; i < 100; ++i) { - assert(parseInt(keys[i]) === i); - assert(target[i] === i); - } - assert(keys[keys.length - 1] === "length"); - assert(target.length === 4277); -}); diff --git a/implementation-contributed/javascriptcore/stress/put-direct-index-broken.js b/implementation-contributed/javascriptcore/stress/put-direct-index-broken.js deleted file mode 100644 index ce7d782c93..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-direct-index-broken.js +++ /dev/null @@ -1,25 +0,0 @@ -function whatToTest(code){return {allowExec: true,};} -function tryRunning(f, code, wtt) -{ - uneval = true - try {var rv = f();} catch(runError) {} - try {if ('__defineSetter__' in this) {delete this.uneval;} } catch(e) {} -} -function tryItOut(code) -{ - var wtt = true; - var f; - try {f = new Function(code);} catch(compileError) {} - tryRunning(f, code, wtt); -} -tryItOut(`a0 = []; - r0 = /x/; - t0 = new Uint8ClampedArray; - o1 = {}; - g1 = this; - v2 = null;`); - -tryItOut("func = (function(x, y) {});"); -tryItOut("for (var p in g1) { this.a0[new func([].map(q => q, null), x)]; }"); -tryItOut("a0.push(o1.m1);a0.length = (4277);a0.__proto__ = this.t0;"); -tryItOut("\"use strict\"; a0 = Array.prototype.map.call(a0, (function() {}));"); diff --git a/implementation-contributed/javascriptcore/stress/put-getter-setter-by-id-strict-transition.js b/implementation-contributed/javascriptcore/stress/put-getter-setter-by-id-strict-transition.js deleted file mode 100644 index 9abd44e15e..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-getter-setter-by-id-strict-transition.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict" - -let theglobal = 0; -for (theglobal = 0; theglobal < 100000; ++theglobal) - ; -const foo = (ignored, arg1) => { theglobal = arg1; }; -for (let j = 0; j < 10000; ++j) { - const obj = { - [theglobal]: 0, - set hello(ignored) {} - }; - foo(obj, 'hello'); -} diff --git a/implementation-contributed/javascriptcore/stress/put-getter-setter-by-id-transition.js b/implementation-contributed/javascriptcore/stress/put-getter-setter-by-id-transition.js deleted file mode 100644 index 7683ccd8ef..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-getter-setter-by-id-transition.js +++ /dev/null @@ -1,11 +0,0 @@ -let theglobal = 0; -for (theglobal = 0; theglobal < 100000; ++theglobal) - ; -const foo = (ignored, arg1) => { theglobal = arg1; }; -for (let j = 0; j < 10000; ++j) { - const obj = { - [theglobal]: 0, - set hello(ignored) {} - }; - foo(obj, 'hello'); -} diff --git a/implementation-contributed/javascriptcore/stress/put-indexed-getter-setter.js b/implementation-contributed/javascriptcore/stress/put-indexed-getter-setter.js deleted file mode 100644 index 4375e1e1d5..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-indexed-getter-setter.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo() { - let setterValue = 0; - class X { - static set 7(x) { setterValue = x; } - static get 7() { } - }; - X[7] = 27; - if (setterValue !== 27) - throw new Error("Bad") -} -noInline(foo); - -for (let i = 0; i < 10000; ++i) - foo(); - -Object.defineProperty(Object.prototype, "7", {get() { return 500; }, set(x) { }}); // this shouldn't change the test at all, it should be doing defineOwnProperty. -for (let i = 0; i < 10000; ++i) - foo(); diff --git a/implementation-contributed/javascriptcore/stress/put-inline-cache-side-effects.js b/implementation-contributed/javascriptcore/stress/put-inline-cache-side-effects.js deleted file mode 100644 index ea9fa1c90e..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-inline-cache-side-effects.js +++ /dev/null @@ -1,30 +0,0 @@ -let objs = new Array(1000); -for (let i of objs.keys()) { - let o = {}; - // Make the object an uncacheable dictionary. - o.foo = 1; - delete o.foo; - objs[i] = o; -} - -function f(o) { - o.foo = 42; -} - -for (let obj of objs) { - let setter = new Function(` - Object.defineProperty(this, "foo", { - writable: true, - configurable: true, - value: null - }); - let o = Object.create(this); - // Need eval to get a new IC to flatten obj. - let str = "for (let i = 0; i < 1000; i++) o.foo"; - eval(str); - `); - - obj.__defineSetter__("foo", setter); - f(obj); - f(obj); -} diff --git a/implementation-contributed/javascriptcore/stress/put-local-conservative.js b/implementation-contributed/javascriptcore/stress/put-local-conservative.js deleted file mode 100644 index c63a0c1302..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-local-conservative.js +++ /dev/null @@ -1,47 +0,0 @@ -function foo(o, a, b, c) { - // Don't do anything real but have some control flow. This causes the PutLocals for a, - // b, and c to survive into SSA form. But we don't have any effects, so sinking will be - // successful. - if (o.f) - return 42; - else - return 0; -} - -function bar(o, y) { - var a = y; - var b = y + 1; - var c = y + 2; - var d = y + 3; - var e = y + 4; - var f = y + 5; - var g = y + 6; - var h = y + 7; - var i = y + 8; - var j = y + 9; - var k = y + 10; - var result = function(p, q) { - var x = a + b + c + d + e + f + g + h + i + j + k; - if (q) { - // Make it appear that it's possible to clobber those closure variables, so that we - // load from them again down below. - a = b = c = d = e = f = g = h = i = j = k = 42; - } - if (p) - x = foo(o, 1, 2, 3) - else - x = 5; - return x + a + b + c + d + e + f + g + h + i + j + k; - }; - noInline(result); - return result; -} - -var o = {f: 42}; - -for (var i = 0; i < 100000; ++i) { - var result = bar(o, i)(true, false); - if (result != 42 + 11 * i + 55) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/put-on-cow-prototype.js b/implementation-contributed/javascriptcore/stress/put-on-cow-prototype.js deleted file mode 100644 index 6bfa7b25cb..0000000000 --- a/implementation-contributed/javascriptcore/stress/put-on-cow-prototype.js +++ /dev/null @@ -1,18 +0,0 @@ -function putByVal() { - let proto = [0,1]; - let object = Object.create(proto); - object[0] = 5; -} -noInline(putByVal); - -function putById() { - let proto = [0,1]; - let object = Object.create(proto); - object.foo = 5; -} -noInline(putById); - -for (let i = 0; i < 10000; i++) { - putByVal(); - putById(); -} diff --git a/implementation-contributed/javascriptcore/stress/raise-error-in-iterator-close.js b/implementation-contributed/javascriptcore/stress/raise-error-in-iterator-close.js deleted file mode 100644 index 88f6e8604e..0000000000 --- a/implementation-contributed/javascriptcore/stress/raise-error-in-iterator-close.js +++ /dev/null @@ -1,118 +0,0 @@ - -function createIterator(callback) { - var array = [0,1,2,3,4,5]; - var iterator = array[Symbol.iterator](); - iterator.return = function () { - iterator.returned = true; - if (callback) - return callback(this); - return { done: true, value: undefined }; - }; - iterator.returned = false; - return iterator; -} - -(function test() { - var outerIterator = createIterator(); - var innerIterator = createIterator(function () { - throw new Error("Inner return called."); - }); - var error = null; - try { - outer: for (var e1 of outerIterator) { - inner: for (var e2 of innerIterator) { - break; - } - } - } catch (e) { - error = e; - } - if (!error) - throw new Error("no error"); - if (String(error) !== "Error: Inner return called.") - throw new Error("bad error: " + String(error)); - if (!innerIterator.returned) - throw new Error("bad value: " + innerIterator.returned); - if (!outerIterator.returned) - throw new Error("bad value: " + outerIterator.returned); -}()); - -(function test() { - var outerIterator = createIterator(function () { - throw new Error("Outer return called."); - }); - var innerIterator = createIterator(function () { - throw new Error("Inner return called."); - }); - var error = null; - try { - outer: for (var e1 of outerIterator) { - inner: for (var e2 of innerIterator) { - break; - } - } - } catch (e) { - error = e; - } - if (!error) - throw new Error("no error"); - if (String(error) !== "Error: Inner return called.") - throw new Error("bad error: " + String(error)); - if (!innerIterator.returned) - throw new Error("bad value: " + innerIterator.returned); - if (!outerIterator.returned) - throw new Error("bad value: " + outerIterator.returned); -}()); - -(function test() { - var outerIterator = createIterator(function () { - throw new Error("Outer return called."); - }); - var innerIterator = createIterator(); - var error = null; - try { - outer: for (var e1 of outerIterator) { - inner: for (var e2 of innerIterator) { - break outer; - } - } - } catch (e) { - error = e; - } - if (!error) - throw new Error("no error"); - if (String(error) !== "Error: Outer return called.") - throw new Error("bad error: " + String(error)); - if (!innerIterator.returned) - throw new Error("bad value: " + innerIterator.returned); - if (!outerIterator.returned) - throw new Error("bad value: " + outerIterator.returned); -}()); - -(function test() { - var outerIterator = createIterator(function () { - throw new Error("Outer return called."); - }); - var innerIterator = createIterator(function () { - throw new Error("Inner return called."); - }); - var error = null; - try { - outer: for (var e1 of outerIterator) { - inner: for (var e2 of innerIterator) { - throw new Error("Loop raises error."); - } - } - } catch (e) { - error = e; - } - if (!error) - throw new Error("no error"); - if (String(error) !== "Error: Loop raises error.") - throw new Error("bad error: " + String(error)); - if (!innerIterator.returned) - throw new Error("bad value: " + innerIterator.returned); - if (!outerIterator.returned) - throw new Error("bad value: " + outerIterator.returned); -}()); - diff --git a/implementation-contributed/javascriptcore/stress/random-53bit.js b/implementation-contributed/javascriptcore/stress/random-53bit.js deleted file mode 100644 index e86777ef2e..0000000000 --- a/implementation-contributed/javascriptcore/stress/random-53bit.js +++ /dev/null @@ -1,28 +0,0 @@ -function test() { - var MAX = 50; - var found53Bit = false; - var foundLessThan53Bit = false; - var results = new Array(MAX); - - for (var i = 0; i < MAX; ++i) { - var str = Math.random().toString(2); - results[i] = str; - // 53 bit + '0.'.length - if (str.length === (53 + 2)) - found53Bit = true; - else if (str.length < (53 + 2)) - foundLessThan53Bit = true; - - if (found53Bit && foundLessThan53Bit) - return true; - } - print(`Random seed ${getRandomSeed()}`); - print(results.join('\n')); - return false; -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) { - if (!test()) - throw new Error("OUT"); -} diff --git a/implementation-contributed/javascriptcore/stress/random-in-range.js b/implementation-contributed/javascriptcore/stress/random-in-range.js deleted file mode 100644 index 9ec0d9fbef..0000000000 --- a/implementation-contributed/javascriptcore/stress/random-in-range.js +++ /dev/null @@ -1,14 +0,0 @@ -function test() { - var value = Math.random(); - if (value >= 1.0) - return false; - if (value < 0) - return false; - return true; -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) { - if (!test()) - throw new Error("OUT"); -} diff --git a/implementation-contributed/javascriptcore/stress/real-forward-varargs-for-inlined-escaped-arguments.js b/implementation-contributed/javascriptcore/stress/real-forward-varargs-for-inlined-escaped-arguments.js deleted file mode 100644 index 0f5b65ce63..0000000000 --- a/implementation-contributed/javascriptcore/stress/real-forward-varargs-for-inlined-escaped-arguments.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo() { - return arguments; -} - -function fuzz(args) { - return foo.apply(void 0, args); -} - -function baz(a, b, c) { - return a + b + c; -} - -function bar(args1) { - var args2 = fuzz(args1); - return baz.apply(void 0, args2); -} - -noInline(bar); - -for (var i = 0; i < 20000; ++i) { - var result = bar([1, 2, 3]); - if (result != 6) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/recurse-infinitely-on-getter.js b/implementation-contributed/javascriptcore/stress/recurse-infinitely-on-getter.js deleted file mode 100644 index a896f529c1..0000000000 --- a/implementation-contributed/javascriptcore/stress/recurse-infinitely-on-getter.js +++ /dev/null @@ -1,23 +0,0 @@ -//@ skip -// FIXME: figure out why it times out. -// https://bugs.webkit.org/show_bug.cgi?id=130880 - -for (var i = 0; i < 100; ++i) { - var o = {}; - o.__defineGetter__("f", function() { - return o.f; - }); - var didThrow; - var result; - result = "not set"; - try { - result = o.f; - } catch (e) { - didThrow = e; - } - if (result != "not set") - throw "Did set result: " + result; - if (!didThrow || didThrow.toString().indexOf("RangeError") != 0) - throw "Bad exception: " + didThrow; -} - diff --git a/implementation-contributed/javascriptcore/stress/recursive-tail-call-with-different-argument-count.js b/implementation-contributed/javascriptcore/stress/recursive-tail-call-with-different-argument-count.js deleted file mode 100644 index 047fb01f88..0000000000 --- a/implementation-contributed/javascriptcore/stress/recursive-tail-call-with-different-argument-count.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -function foo(x, y) -{ - if (arguments.length >= 2) - return foo(x+y) - return x; -} -noInline(foo); - -function bar(x) -{ - if (arguments.length >= 2) - return bar(arguments[0] + arguments[1]) - return x; -} -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var result = foo(40, 2); - if (result !== 42) - throw "Wrong result for foo, expected 42, got " + result; - result = bar(40, 2); - if (result !== 42) - throw "Wrong result for bar, expected 42, got " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/recursive-try-catch.js b/implementation-contributed/javascriptcore/stress/recursive-try-catch.js deleted file mode 100644 index 647ea23d81..0000000000 --- a/implementation-contributed/javascriptcore/stress/recursive-try-catch.js +++ /dev/null @@ -1,89 +0,0 @@ -//@ defaultNoSamplingProfilerRun -// This test should run to completion without excessive memory usage - -let maxHeapAllowed = 10 * 1024 * 1024; // This test should run using much less than 10MB. -let badFunction = undefined; -let loggedError = undefined; - -function logError(error) -{ - loggedError = error; -} - -function tryCallingBadFunction() -{ - try { - badFunction(42); - } catch(error) { - logError(error); - } - - recurse(); -} - -function recurse() -{ - // Make the frame big to run out of stack with fewer recursive calls. - let val1, val2, val3, val4, val5, val6, val7, val8, val9, val10; - let val11, val12, val13, val14, val15, val16, val17, val18, val19, val20; - let val21, val22, val23, val24, val25, val26, val27, val28, val29, val30; - let val31, val32, val33, val34, val35, val36, val37, val38, val39, val40; - let val41, val42, val43, val44, val45, val46, val47, val48, val49, val50; - let val51, val52, val53, val54, val55, val56, val57, val58, val59, val60; - let val61, val62, val63, val64, val65, val66, val67, val68, val69, val70; - let val71, val72, val73, val74, val75, val76, val77, val78, val79, val80; - let val81, val82, val83, val84, val85, val86, val87, val88, val89, val90; - let val91, val92, val93, val94, val95, val96, val97, val98, val99, val100; - let val101, val102, val103, val104, val105, val106, val107, val108, val109, val110; - let val111, val112, val113, val114, val115, val116, val117, val118, val119, val120; - let val121, val122, val123, val124, val125, val126, val127, val128, val129, val130; - let val131, val132, val133, val134, val135, val136, val137, val138, val139, val140; - let val141, val142, val143, val144, val145, val146, val147, val148, val149, val150; - let val151, val152, val153, val154, val155, val156, val157, val158, val159, val160; - let val161, val162, val163, val164, val165, val166, val167, val168, val169, val170; - let val171, val172, val173, val174, val175, val176, val177, val178, val179, val180; - let val181, val182, val183, val184, val185, val186, val187, val188, val189, val190; - let val191, val192, val193, val194, val195, val196, val197, val198, val199, val200; - let val201, val202, val203, val204, val205, val206, val207, val208, val209, val210; - let val211, val212, val213, val214, val215, val216, val217, val218, val219, val220; - let val221, val222, val223, val224, val225, val226, val227, val228, val229, val230; - let val231, val232, val233, val234, val235, val236, val237, val238, val239, val240; - let val241, val242, val243, val244, val245, val246, val247, val248, val249, val250; - let val251, val252, val253, val254, val255, val256, val257, val258, val259, val260; - let val261, val262, val263, val264, val265, val266, val267, val268, val269, val270; - let val271, val272, val273, val274, val275, val276, val277, val278, val279, val280; - let val281, val282, val283, val284, val285, val286, val287, val288, val289, val290; - let val291, val292, val293, val294, val295, val296, val297, val298, val299, val300; - let val301, val302, val303, val304, val305, val306, val307, val308, val309, val310; - let val311, val312, val313, val314, val315, val316, val317, val318, val319, val320; - let val321, val322, val323, val324, val325, val326, val327, val328, val329, val330; - let val331, val332, val333, val334, val335, val336, val337, val338, val339, val340; - let val341, val342, val343, val344, val345, val346, val347, val348, val349, val350; - let val351, val352, val353, val354, val355, val356, val357, val358, val359, val360; - let val361, val362, val363, val364, val365, val366, val367, val368, val369, val370; - let val371, val372, val373, val374, val375, val376, val377, val378, val379, val380; - let val381, val382, val383, val384, val385, val386, val387, val388, val389, val390; - let val391, val392, val393, val394, val395, val396, val397, val398, val399, val400; - - tryCallingBadFunction(); -} - -function test() -{ - try { - recurse(); - } catch(error) { - if (error != "RangeError: Maximum call stack size exceeded.") - throw "Expected: \"RangeError: Maximum call stack size exceeded.\", but got: " + error; - - let heapUsed = gcHeapSize(); - if (heapUsed > maxHeapAllowed) - throw "Used too much heap. Limit was " + maxHeapAllowed + " bytes, but we used " + heapUsed + " bytes."; - } - - if (loggedError.name != "TypeError") - throw "Expected logged error to be: \"TypeError\", but got: " + loggedError.name; -} - -test(); - diff --git a/implementation-contributed/javascriptcore/stress/recursive_property_redefine_during_inline_caching.js b/implementation-contributed/javascriptcore/stress/recursive_property_redefine_during_inline_caching.js deleted file mode 100644 index a92dfbcfea..0000000000 --- a/implementation-contributed/javascriptcore/stress/recursive_property_redefine_during_inline_caching.js +++ /dev/null @@ -1,23 +0,0 @@ -// to be run with useLLInt = false -var o = {}; - -function getSomeProperty(){ - return o.someProperty; -} - -var count = 0; -function test(){ - count++; - if (count == 3) { - Object.defineProperty(this, 'someProperty', { value : "okay" }); - return getSomeProperty(); - } - return "okay"; -} - -o.__defineGetter__('someProperty', test) - -for (var i = 0; i < 4; i++) { - if (getSomeProperty() != "okay") - throw ("Error: " + i); -} diff --git a/implementation-contributed/javascriptcore/stress/redundant-add-overflow-checks.js b/implementation-contributed/javascriptcore/stress/redundant-add-overflow-checks.js deleted file mode 100644 index b435ff3d94..0000000000 --- a/implementation-contributed/javascriptcore/stress/redundant-add-overflow-checks.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo(x) { - return (x + 0) + (x + 1) + (x + 2) + (x + 3) + (x + 4) + (x + 5) + (x + 6) + (x + 7) + (x + 8) + (x + 9) + (x + 10); -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(i); - if (result != i * 11 + 55) - throw "Error: bad result for i = " + i + ": " + result; -} - -for (var i = 2147483628; i <= 2147483647; i++) { - var result = foo(i); - if (result != i * 11 + 55) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/redundant-array-bounds-checks-addition-skip-first.js b/implementation-contributed/javascriptcore/stress/redundant-array-bounds-checks-addition-skip-first.js deleted file mode 100644 index e8a0391c3d..0000000000 --- a/implementation-contributed/javascriptcore/stress/redundant-array-bounds-checks-addition-skip-first.js +++ /dev/null @@ -1,50 +0,0 @@ -function foo(a, i) { - return [a[i], a[i + 1], a[i + 2], a[i + 3], a[i + 4], a[i + 5], a[i + 6], a[i + 7]]; -} - -noInline(foo); - -function arraycmp(a, b) { - if (a.length != b.length) - return false; - for (var i = 0; i < a.length; ++i) { - if (a[i] != b[i]) - return false; - } - return true; -} - -for (var i = 0; i < 100000; ++i) { - var array = []; - var offset = i & 3; - for (var j = 0; j < offset; ++j) - array.push(42); - var result = foo(array.concat([1, 2, 3, 4, 5, 6, 7, 8]), offset); - if (!arraycmp(result, [1, 2, 3, 4, 5, 6, 7, 8])) - throw "Error: bad result (1..8): " + result; -} - -var result = foo([1, 2, 3, 4, 5, 6, 7], 0); -if (!arraycmp(result, [1, 2, 3, 4, 5, 6, 7, void 0])) - throw "Error: bad result (1..7): " + result; -var result = foo([1, 2, 3, 4, 5, 6], 0); -if (!arraycmp(result, [1, 2, 3, 4, 5, 6, void 0, void 0])) - throw "Error: bad result (1..6): " + result; -var result = foo([1, 2, 3, 4, 5], 0); -if (!arraycmp(result, [1, 2, 3, 4, 5, void 0, void 0, void 0])) - throw "Error: bad result (1..5): " + result; -var result = foo([1, 2, 3, 4], 0); -if (!arraycmp(result, [1, 2, 3, 4, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..4): " + result; -var result = foo([1, 2, 3], 0); -if (!arraycmp(result, [1, 2, 3, void 0, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..3): " + result; -var result = foo([1, 2], 0); -if (!arraycmp(result, [1, 2, void 0, void 0, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..2): " + result; -var result = foo([1], 0); -if (!arraycmp(result, [1, void 0, void 0, void 0, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..1): " + result; -var result = foo([], 0); -if (!arraycmp(result, [void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..1): " + result; diff --git a/implementation-contributed/javascriptcore/stress/redundant-array-bounds-checks-addition.js b/implementation-contributed/javascriptcore/stress/redundant-array-bounds-checks-addition.js deleted file mode 100644 index 256e53619c..0000000000 --- a/implementation-contributed/javascriptcore/stress/redundant-array-bounds-checks-addition.js +++ /dev/null @@ -1,50 +0,0 @@ -function foo(a, i) { - return [a[i + 0], a[i + 1], a[i + 2], a[i + 3], a[i + 4], a[i + 5], a[i + 6], a[i + 7]]; -} - -noInline(foo); - -function arraycmp(a, b) { - if (a.length != b.length) - return false; - for (var i = 0; i < a.length; ++i) { - if (a[i] != b[i]) - return false; - } - return true; -} - -for (var i = 0; i < 100000; ++i) { - var array = []; - var offset = i & 3; - for (var j = 0; j < offset; ++j) - array.push(42); - var result = foo(array.concat([1, 2, 3, 4, 5, 6, 7, 8]), offset); - if (!arraycmp(result, [1, 2, 3, 4, 5, 6, 7, 8])) - throw "Error: bad result (1..8): " + result; -} - -var result = foo([1, 2, 3, 4, 5, 6, 7], 0); -if (!arraycmp(result, [1, 2, 3, 4, 5, 6, 7, void 0])) - throw "Error: bad result (1..7): " + result; -var result = foo([1, 2, 3, 4, 5, 6], 0); -if (!arraycmp(result, [1, 2, 3, 4, 5, 6, void 0, void 0])) - throw "Error: bad result (1..6): " + result; -var result = foo([1, 2, 3, 4, 5], 0); -if (!arraycmp(result, [1, 2, 3, 4, 5, void 0, void 0, void 0])) - throw "Error: bad result (1..5): " + result; -var result = foo([1, 2, 3, 4], 0); -if (!arraycmp(result, [1, 2, 3, 4, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..4): " + result; -var result = foo([1, 2, 3], 0); -if (!arraycmp(result, [1, 2, 3, void 0, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..3): " + result; -var result = foo([1, 2], 0); -if (!arraycmp(result, [1, 2, void 0, void 0, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..2): " + result; -var result = foo([1], 0); -if (!arraycmp(result, [1, void 0, void 0, void 0, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..1): " + result; -var result = foo([], 0); -if (!arraycmp(result, [void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..1): " + result; diff --git a/implementation-contributed/javascriptcore/stress/redundant-array-bounds-checks-unchecked-addition.js b/implementation-contributed/javascriptcore/stress/redundant-array-bounds-checks-unchecked-addition.js deleted file mode 100644 index 5ccb2be5b3..0000000000 --- a/implementation-contributed/javascriptcore/stress/redundant-array-bounds-checks-unchecked-addition.js +++ /dev/null @@ -1,50 +0,0 @@ -function foo(a, i) { - return [a[(i + 0)|0], a[(i + 1)|0], a[(i + 2)|0], a[(i + 3)|0], a[(i + 4)|0], a[(i + 5)|0], a[(i + 6)|0], a[(i + 7)|0]]; -} - -noInline(foo); - -function arraycmp(a, b) { - if (a.length != b.length) - return false; - for (var i = 0; i < a.length; ++i) { - if (a[i] != b[i]) - return false; - } - return true; -} - -for (var i = 0; i < 100000; ++i) { - var array = []; - var offset = i & 3; - for (var j = 0; j < offset; ++j) - array.push(42); - var result = foo(array.concat([1, 2, 3, 4, 5, 6, 7, 8]), offset); - if (!arraycmp(result, [1, 2, 3, 4, 5, 6, 7, 8])) - throw "Error: bad result (1..8): " + result; -} - -var result = foo([1, 2, 3, 4, 5, 6, 7], 0); -if (!arraycmp(result, [1, 2, 3, 4, 5, 6, 7, void 0])) - throw "Error: bad result (1..7): " + result; -var result = foo([1, 2, 3, 4, 5, 6], 0); -if (!arraycmp(result, [1, 2, 3, 4, 5, 6, void 0, void 0])) - throw "Error: bad result (1..6): " + result; -var result = foo([1, 2, 3, 4, 5], 0); -if (!arraycmp(result, [1, 2, 3, 4, 5, void 0, void 0, void 0])) - throw "Error: bad result (1..5): " + result; -var result = foo([1, 2, 3, 4], 0); -if (!arraycmp(result, [1, 2, 3, 4, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..4): " + result; -var result = foo([1, 2, 3], 0); -if (!arraycmp(result, [1, 2, 3, void 0, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..3): " + result; -var result = foo([1, 2], 0); -if (!arraycmp(result, [1, 2, void 0, void 0, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..2): " + result; -var result = foo([1], 0); -if (!arraycmp(result, [1, void 0, void 0, void 0, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..1): " + result; -var result = foo([], 0); -if (!arraycmp(result, [void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..1): " + result; diff --git a/implementation-contributed/javascriptcore/stress/redundant-array-bounds-checks.js b/implementation-contributed/javascriptcore/stress/redundant-array-bounds-checks.js deleted file mode 100644 index df0c7cd741..0000000000 --- a/implementation-contributed/javascriptcore/stress/redundant-array-bounds-checks.js +++ /dev/null @@ -1,46 +0,0 @@ -function foo(a) { - return [a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]]; -} - -noInline(foo); - -function arraycmp(a, b) { - if (a.length != b.length) - return false; - for (var i = 0; i < a.length; ++i) { - if (a[i] != b[i]) - return false; - } - return true; -} - -for (var i = 0; i < 100000; ++i) { - var result = foo([1, 2, 3, 4, 5, 6, 7, 8]); - if (!arraycmp(result, [1, 2, 3, 4, 5, 6, 7, 8])) - throw "Error: bad result (1..8): " + result; -} - -var result = foo([1, 2, 3, 4, 5, 6, 7]); -if (!arraycmp(result, [1, 2, 3, 4, 5, 6, 7, void 0])) - throw "Error: bad result (1..7): " + result; -var result = foo([1, 2, 3, 4, 5, 6]); -if (!arraycmp(result, [1, 2, 3, 4, 5, 6, void 0, void 0])) - throw "Error: bad result (1..6): " + result; -var result = foo([1, 2, 3, 4, 5]); -if (!arraycmp(result, [1, 2, 3, 4, 5, void 0, void 0, void 0])) - throw "Error: bad result (1..5): " + result; -var result = foo([1, 2, 3, 4]); -if (!arraycmp(result, [1, 2, 3, 4, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..4): " + result; -var result = foo([1, 2, 3]); -if (!arraycmp(result, [1, 2, 3, void 0, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..3): " + result; -var result = foo([1, 2]); -if (!arraycmp(result, [1, 2, void 0, void 0, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..2): " + result; -var result = foo([1]); -if (!arraycmp(result, [1, void 0, void 0, void 0, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..1): " + result; -var result = foo([]); -if (!arraycmp(result, [void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0])) - throw "Error: bad result (1..1): " + result; diff --git a/implementation-contributed/javascriptcore/stress/reflect-apply.js b/implementation-contributed/javascriptcore/stress/reflect-apply.js deleted file mode 100644 index 0f692c7e70..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect-apply.js +++ /dev/null @@ -1,91 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -shouldBe(Reflect.apply.length, 3); - -shouldThrow(() => { - Reflect.apply("hello", 42); -}, `TypeError: Reflect.apply requires the first argument be a function`); - -shouldThrow(() => { - Reflect.apply(function () { }, 42, null); -}, `TypeError: Reflect.apply requires the third argument be an object`); - -shouldThrow(() => { - var array = { - get length() { - throw new Error("ok"); - }, - get 0() { - throw new Error("ng"); - } - }; - Reflect.apply(function () { }, {}, array); -}, `Error: ok`); - -shouldThrow(() => { - var array = { - get length() { - return 1; - }, - get 0() { - throw new Error("ok"); - } - }; - Reflect.apply(function () { }, {}, array); -}, `Error: ok`); - -var array = { - get length() { - return 0; - }, - get 0() { - throw new Error("ng"); - } -}; -shouldBe(Reflect.apply(function () { return arguments.length }, {}, array), 0); - -var globalObject = this; -shouldBe(Reflect.apply(function () { - "use strict"; - shouldBe(arguments[0], 0); - shouldBe(arguments[1], 1); - shouldBe(arguments[2], 2); - shouldBe(this, null); - return arguments.length; -}, null, [0,1,2]), 3) - -shouldBe(Reflect.apply(function () { - shouldBe(arguments[0], 0); - shouldBe(arguments[1], 1); - shouldBe(arguments[2], 2); - shouldBe(this, globalObject); - return arguments.length; -}, null, [0,1,2]), 3) - -var thisObject = {}; -shouldBe(Reflect.apply(function () { - "use strict"; - shouldBe(this, thisObject); - return arguments.length; -}, thisObject, []), 0) - -shouldBe(Reflect.apply(function () { - shouldBe(this, thisObject); - return arguments.length; -}, thisObject, []), 0) diff --git a/implementation-contributed/javascriptcore/stress/reflect-construct.js b/implementation-contributed/javascriptcore/stress/reflect-construct.js deleted file mode 100644 index 8939ab1ab1..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect-construct.js +++ /dev/null @@ -1,228 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -shouldBe(Reflect.construct.length, 2); - -shouldThrow(() => { - Reflect.construct("hello", 42); -}, `TypeError: Reflect.construct requires the first argument be a constructor`); - -shouldThrow(() => { - Reflect.construct(Array.prototype.forEach, []); -}, `TypeError: Reflect.construct requires the first argument be a constructor`); - -shouldThrow(() => { - Reflect.construct(function () { }, 42, null); -}, `TypeError: Reflect.construct requires the third argument be a constructor if present`); - -shouldThrow(() => { - Reflect.construct(function () { }, 42, {}); -}, `TypeError: Reflect.construct requires the third argument be a constructor if present`); - -shouldThrow(() => { - Reflect.construct(function () { }, 42, Array.prototype.forEach); -}, `TypeError: Reflect.construct requires the third argument be a constructor if present`); - -shouldThrow(() => { - Reflect.construct(function () { }, 42, function () { }); -}, `TypeError: Reflect.construct requires the second argument be an object`); - -shouldThrow(() => { - var array = { - get length() { - throw new Error("ok"); - }, - get 0() { - throw new Error("ng"); - } - }; - Reflect.construct(function () { }, array); -}, `Error: ok`); - -shouldThrow(() => { - var array = { - get length() { - return 1; - }, - get 0() { - throw new Error("ok"); - } - }; - Reflect.construct(function () { }, array); -}, `Error: ok`); - -var array = { - get length() { - return 0; - }, - get 0() { - throw new Error("ng"); - } -}; -shouldBe(Reflect.construct(function () { this.length = arguments.length; }, array).length, 0); - -var globalObject = this; -shouldBe(Reflect.construct(function Hello() { - "use strict"; - shouldBe(arguments[0], 0); - shouldBe(arguments[1], 1); - shouldBe(arguments[2], 2); - shouldBe(typeof this, "object"); - shouldBe(new.target, Hello); - this.result = arguments.length; -}, [0,1,2]).result, 3) - -shouldBe(Reflect.construct(function Hello() { - shouldBe(arguments[0], 0); - shouldBe(arguments[1], 1); - shouldBe(arguments[2], 2); - shouldBe(typeof this, "object"); - shouldBe(new.target, Hello); - this.result = arguments.length; -}, [0,1,2]).result, 3) - -var newTarget = function () { }; -shouldBe(Reflect.construct(function () { - "use strict"; - shouldBe(new.target, newTarget); - this.result = arguments.length; -}, [], newTarget).result, 0) - -shouldBe(Reflect.construct(function () { - shouldBe(new.target, newTarget); - this.result = arguments.length; -}, [], newTarget).result, 0) - -{ - class A { - constructor() - { - this.type = "A"; - } - } - - class B extends A { - constructor() - { - super(); - this.type = "B"; - } - } - - shouldBe(Reflect.construct(A, []).type, "A"); - shouldBe(Reflect.construct(B, []).type, "B"); - - shouldBe(Reflect.construct(B, [], B).__proto__, B.prototype); - shouldBe(Reflect.construct(B, [], A).__proto__, A.prototype); - shouldBe(Reflect.construct(B, [], A).type, "B"); - shouldBe(Reflect.construct(B, [], B).type, "B"); - - shouldBe(Reflect.construct(A, [], A).__proto__, A.prototype); - shouldBe(Reflect.construct(A, [], B).__proto__, B.prototype); - shouldBe(Reflect.construct(A, [], A).type, "A"); - shouldBe(Reflect.construct(A, [], B).type, "A"); -} - -function nativeConstructorTest() -{ - class DerivedMap { - } - shouldBe(Reflect.construct(Map, [], DerivedMap).__proto__, DerivedMap.prototype); - let map = Reflect.construct(Map, [], DerivedMap); - map.__proto__ = Map.prototype; - map.set(20, 30); - shouldBe(map.get(20), 30); - - class FailedMap { - } - shouldBe(Reflect.construct(FailedMap, [], Map).__proto__, Map.prototype); - shouldThrow(() => { - let map = Reflect.construct(FailedMap, [], Map); - map.set(20, 30); - }, `TypeError: Map operation called on non-Map object`); - - shouldBe(Reflect.construct(Set, [], Map).__proto__, Map.prototype); - shouldThrow(() => { - let map = Reflect.construct(Set, [], Map); - map.set(20, 30); - }, `TypeError: Map operation called on non-Map object`); - - let set = Reflect.construct(Set, [], Map); - Set.prototype.add.call(set, 20); - shouldBe(Set.prototype.has.call(set, 20), true); -} -noInline(nativeConstructorTest); - -for (var i = 0; i < 1e4; ++i) - nativeConstructorTest(); - -(function () { - function Hello() { } - let result = {}; - let proxy = new Proxy(Hello, { - construct(theTarget, argArray, newTarget) { - shouldBe(newTarget, Map); - shouldBe(theTarget, Hello); - shouldBe(argArray.length, 2); - shouldBe(argArray[0], 10); - shouldBe(argArray[1], 20); - return result; - } - }); - shouldBe(Reflect.construct(proxy, [10, 20], Map), result); -}()); - -(function () { - var proxy = new Proxy(Map, { - construct(theTarget, argArray, newTarget) { - } - }); - - var result = {}; - function Hello() { - shouldBe(new.target, proxy); - shouldBe(new.target.prototype, Map.prototype); - shouldBe(arguments.length, 2); - shouldBe(arguments[0], 10); - shouldBe(arguments[1], 20); - return result; - } - shouldBe(Reflect.construct(Hello, [10, 20], proxy), result); -}()); - -(function () { - function Hello() { } - var result = {}; - var proxy1 = new Proxy(Hello, { - construct(theTarget, argArray, newTarget) { - shouldBe(newTarget, proxy2); - shouldBe(theTarget, Hello); - shouldBe(argArray.length, 2); - shouldBe(argArray[0], 10); - shouldBe(argArray[1], 20); - return result; - } - }); - - var proxy2 = new Proxy(Map, { - construct(theTarget, argArray, newTarget) { - } - }); - - shouldBe(Reflect.construct(proxy1, [10, 20], proxy2), result); -}()); diff --git a/implementation-contributed/javascriptcore/stress/reflect-define-property.js b/implementation-contributed/javascriptcore/stress/reflect-define-property.js deleted file mode 100644 index dbef1b8b17..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect-define-property.js +++ /dev/null @@ -1,286 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -shouldBe(Reflect.defineProperty.length, 3); - -shouldThrow(() => { - Reflect.defineProperty("hello"); -}, `TypeError: Reflect.defineProperty requires the first argument be an object`); - -shouldThrow(() => { - Reflect.defineProperty(null); -}, `TypeError: Reflect.defineProperty requires the first argument be an object`); - -var object = {}; -shouldBe(object[42], undefined); -shouldBe(object.hello, undefined); -shouldBe(Reflect.defineProperty(object, 42, { - value: 42 -}), true); -shouldBe(Reflect.defineProperty(object, 'hello', { - value: 50 -}), true); -shouldBe(object[42], 42); -shouldBe(object.hello, 50); - -function testDescriptor(expected, actual) { - shouldBe(expected.enumerable, actual.enumerable); - shouldBe(expected.configurable, actual.configurable); - shouldBe(expected.writable, actual.writable); - shouldBe(expected.value, actual.value); - shouldBe(expected.get, actual.get); - shouldBe(expected.set, actual.set); -} - -function getter() { } -function setter() { } - -var object = {}; -shouldBe(Reflect.defineProperty(object, 'cocoa', {}), true); -testDescriptor(Object.getOwnPropertyDescriptor(object, 'cocoa'), { - configurable: false, - writable: false, - enumerable: false, - value: undefined -}); - - -var object = {}; -shouldBe(Reflect.defineProperty(object, 'cocoa', { - configurable: true -}), true); -testDescriptor(Object.getOwnPropertyDescriptor(object, 'cocoa'), { - configurable: true, - writable: false, - enumerable: false, - value: undefined -}); - -var object = {}; -shouldBe(Reflect.defineProperty(object, 'cocoa', { - configurable: true, - enumerable: true -}), true); -testDescriptor(Object.getOwnPropertyDescriptor(object, 'cocoa'), { - configurable: true, - writable: false, - enumerable: true, - value: undefined -}); - -var object = {}; -shouldBe(Reflect.defineProperty(object, 'cocoa', { - configurable: true, - enumerable: true, - writable: true -}), true); -testDescriptor(Object.getOwnPropertyDescriptor(object, 'cocoa'), { - configurable: true, - writable: true, - enumerable: true, - value: undefined -}); - -var object = {}; -shouldBe(Reflect.defineProperty(object, 'cocoa', { - configurable: true, - enumerable: true, - writable: true, - value: 42 -}), true); -testDescriptor(Object.getOwnPropertyDescriptor(object, 'cocoa'), { - configurable: true, - writable: true, - enumerable: true, - value: 42 -}); - -var object = {}; -shouldBe(Reflect.defineProperty(object, 'cocoa', { - configurable: true, - enumerable: true, - get: getter -}), true); -testDescriptor(Object.getOwnPropertyDescriptor(object, 'cocoa'), { - configurable: true, - enumerable: true, - get: getter, - set: undefined -}); - -var object = {}; -shouldBe(Reflect.defineProperty(object, 'cocoa', { - configurable: true, - enumerable: true, - set: setter -}), true); -testDescriptor(Object.getOwnPropertyDescriptor(object, 'cocoa'), { - configurable: true, - enumerable: true, - get: undefined, - set: setter -}); - -var object = {}; -shouldBe(Reflect.defineProperty(object, 'cocoa', { - configurable: true, - enumerable: true, - set: setter, - get: getter -}), true); -testDescriptor(Object.getOwnPropertyDescriptor(object, 'cocoa'), { - configurable: true, - enumerable: true, - get: getter, - set: setter -}); - -shouldThrow(() => { - var object = {}; - Reflect.defineProperty(object, 'cocoa', { - configurable: true, - enumerable: true, - set: setter, - get: getter, - value: 42 - }); -}, `TypeError: Invalid property. 'value' present on property with getter or setter.`); - -shouldThrow(() => { - var object = {}; - Reflect.defineProperty(object, 'cocoa', { - configurable: true, - enumerable: true, - value: 42, - set: setter, - get: getter - }); -}, `TypeError: Invalid property. 'value' present on property with getter or setter.`); - -shouldThrow(() => { - var object = {}; - Reflect.defineProperty(object, 'cocoa', { - configurable: true, - enumerable: true, - writable: false, - get: getter - }); -}, `TypeError: Invalid property. 'writable' present on property with getter or setter.`); - -var object = { cocoa: 42 }; -shouldBe(Reflect.defineProperty(object, 'cocoa', { - configurable: true, - enumerable: true, - writable: false, - value: 50 -}), true); -testDescriptor(Object.getOwnPropertyDescriptor(object, 'cocoa'), { - configurable: true, - enumerable: true, - writable: false, - value: 50 -}); - - -var object = { cocoa: 42 }; -shouldBe(Reflect.defineProperty(object, 'cocoa', { - writable: false, - value: 50 -}), true); -testDescriptor(Object.getOwnPropertyDescriptor(object, 'cocoa'), { - configurable: true, - enumerable: true, - writable: false, - value: 50 -}); -shouldBe(Reflect.defineProperty(object, 'cocoa', { - writable: true, -}), true); -testDescriptor(Object.getOwnPropertyDescriptor(object, 'cocoa'), { - configurable: true, - enumerable: true, - writable: true, - value: 50 -}); -shouldBe(Reflect.defineProperty(object, 'cocoa', { - writable: false, - configurable: false, - value: 50 -}), true); -testDescriptor(Object.getOwnPropertyDescriptor(object, 'cocoa'), { - configurable: false, - enumerable: true, - writable: false, - value: 50 -}); -shouldBe(Reflect.defineProperty(object, 'cocoa', { - writable: true, -}), false); -testDescriptor(Object.getOwnPropertyDescriptor(object, 'cocoa'), { - configurable: false, - enumerable: true, - writable: false, - value: 50 -}); -shouldBe(Reflect.defineProperty(object, 'cocoa', { - enumerable: false, -}), false); -testDescriptor(Object.getOwnPropertyDescriptor(object, 'cocoa'), { - configurable: false, - enumerable: true, - writable: false, - value: 50 -}); -shouldBe(Reflect.defineProperty(object, 'cocoa', { - enumerable: true, -}), true); -testDescriptor(Object.getOwnPropertyDescriptor(object, 'cocoa'), { - configurable: false, - enumerable: true, - writable: false, - value: 50 -}); - -var array = []; -shouldBe(Reflect.defineProperty(array, 'length', { - get: getter, - set: setter -}), false); -testDescriptor(Object.getOwnPropertyDescriptor(array, 'length'), { - configurable: false, - enumerable: false, - writable: true, - value: 0 -}); -shouldBe(Reflect.defineProperty(array, 'length', { - writable: false, - value: 30 -}), true); -testDescriptor(Object.getOwnPropertyDescriptor(array, 'length'), { - configurable: false, - enumerable: false, - writable: false, - value: 30 -}); -array.length = 40; -testDescriptor(Object.getOwnPropertyDescriptor(array, 'length'), { - configurable: false, - enumerable: false, - writable: false, - value: 30 -}); diff --git a/implementation-contributed/javascriptcore/stress/reflect-delete-property.js b/implementation-contributed/javascriptcore/stress/reflect-delete-property.js deleted file mode 100644 index 1f08651a22..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect-delete-property.js +++ /dev/null @@ -1,56 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -shouldBe(Reflect.deleteProperty.length, 2); - -shouldThrow(() => { - Reflect.deleteProperty("hello", 42); -}, `TypeError: Reflect.deleteProperty requires the first argument be an object`); - -var object = { hello: 42 }; -shouldBe(object.hello, 42); -shouldBe(object.hasOwnProperty('hello'), true); -shouldBe(Reflect.deleteProperty(object, 'hello'), true); -shouldBe(object.hasOwnProperty('hello'), false); -shouldBe(Reflect.deleteProperty(object, 'hasOwnProperty'), true); -shouldBe(object.hasOwnProperty('hasOwnProperty'), false); - -shouldBe(Reflect.deleteProperty([], 'length'), false); -shouldBe(Reflect.deleteProperty([0,1,2], 0), true); - -var object = { - [Symbol.iterator]: 42 -}; -shouldBe(object.hasOwnProperty(Symbol.iterator), true); -shouldBe(object[Symbol.iterator], 42); -shouldBe(Reflect.deleteProperty(object, Symbol.iterator), true); -shouldBe(object.hasOwnProperty(Symbol.iterator), false); - -var toPropertyKey = { - toString() { - throw new Error('toString called.'); - } -}; - -shouldThrow(() => { - Reflect.deleteProperty("hello", toPropertyKey); -}, `TypeError: Reflect.deleteProperty requires the first argument be an object`); - -shouldThrow(() => { - Reflect.deleteProperty({}, toPropertyKey); -}, `Error: toString called.`); diff --git a/implementation-contributed/javascriptcore/stress/reflect-get-own-property.js b/implementation-contributed/javascriptcore/stress/reflect-get-own-property.js deleted file mode 100644 index 963b14f739..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect-get-own-property.js +++ /dev/null @@ -1,147 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -shouldBe(Reflect.getOwnPropertyDescriptor.length, 2); - -var toPropertyKey = { - toString() { - throw new Error("ok"); - } -}; - -shouldThrow(() => { - Reflect.getOwnPropertyDescriptor("hello", 42); -}, `TypeError: Reflect.getOwnPropertyDescriptor requires the first argument be an object`); - -shouldThrow(() => { - Reflect.getOwnPropertyDescriptor("hello", toPropertyKey); -}, `TypeError: Reflect.getOwnPropertyDescriptor requires the first argument be an object`); - -shouldThrow(() => { - Reflect.getOwnPropertyDescriptor(null, toPropertyKey); -}, `TypeError: Reflect.getOwnPropertyDescriptor requires the first argument be an object`); - -shouldThrow(() => { - Reflect.getOwnPropertyDescriptor(undefined, toPropertyKey); -}, `TypeError: Reflect.getOwnPropertyDescriptor requires the first argument be an object`); - -shouldThrow(() => { - Reflect.getOwnPropertyDescriptor({}, toPropertyKey); -}, `Error: ok`); - -shouldBe(Reflect.getOwnPropertyDescriptor({ __proto__: { hello: 42 } }, "hello"), undefined); -shouldBe(JSON.stringify(Reflect.getOwnPropertyDescriptor({ hello: 42 }, "hello")), `{"value":42,"writable":true,"enumerable":true,"configurable":true}`); - -(function () { - var object = { - get hello() { - } - }; - var desc = Reflect.getOwnPropertyDescriptor(object, "hello"); - shouldBe(JSON.stringify(desc), `{"enumerable":true,"configurable":true}`); - shouldBe(desc.set, undefined); - shouldBe(desc.get, Object.getOwnPropertyDescriptor(object, "hello").get); -}()); - -(function () { - var object = { - set hello(value) { - } - }; - var desc = Reflect.getOwnPropertyDescriptor(object, "hello"); - shouldBe(JSON.stringify(desc), `{"enumerable":true,"configurable":true}`); - shouldBe(desc.set, Object.getOwnPropertyDescriptor(object, "hello").set); - shouldBe(desc.get, undefined); -}()); - -(function () { - var object = Object.defineProperty({}, "hello", { - enumerable: false, - value: 42 - }); - var desc = Reflect.getOwnPropertyDescriptor(object, "hello"); - shouldBe(JSON.stringify(desc), `{"value":42,"writable":false,"enumerable":false,"configurable":false}`); -}()); - -(function () { - var object = Object.defineProperty({}, "hello", { - enumerable: false, - configurable: true, - value: 42 - }); - var desc = Reflect.getOwnPropertyDescriptor(object, "hello"); - shouldBe(JSON.stringify(desc), `{"value":42,"writable":false,"enumerable":false,"configurable":true}`); -}()); - -(function () { - var object = Object.defineProperty({}, "hello", { - enumerable: true, - configurable: false, - value: 42 - }); - var desc = Reflect.getOwnPropertyDescriptor(object, "hello"); - shouldBe(JSON.stringify(desc), `{"value":42,"writable":false,"enumerable":true,"configurable":false}`); -}()); - -(function () { - var object = Object.defineProperty({}, "hello", { - enumerable: true, - configurable: false, - writable: false, - value: 42 - }); - var desc = Reflect.getOwnPropertyDescriptor(object, "hello"); - shouldBe(JSON.stringify(desc), `{"value":42,"writable":false,"enumerable":true,"configurable":false}`); -}()); - -(function () { - var object = Object.defineProperty({}, "hello", { - enumerable: true, - configurable: false, - writable: true, - value: 42 - }); - var desc = Reflect.getOwnPropertyDescriptor(object, "hello"); - shouldBe(JSON.stringify(desc), `{"value":42,"writable":true,"enumerable":true,"configurable":false}`); -}()); - -(function () { - var object = { - get hello() { - }, - set hello(value) { - } - }; - var desc = Reflect.getOwnPropertyDescriptor(object, "hello"); - shouldBe(JSON.stringify(desc), `{"enumerable":true,"configurable":true}`); - shouldBe(desc.get, Object.getOwnPropertyDescriptor(object, "hello").get); - shouldBe(desc.set, Object.getOwnPropertyDescriptor(object, "hello").set); -}()); - -(function () { - var object = { - get hello() { - }, - set hello(value) { - } - }; - var desc = Reflect.getOwnPropertyDescriptor(object, { toString() { return "hello"; } }); - shouldBe(JSON.stringify(desc), `{"enumerable":true,"configurable":true}`); - shouldBe(desc.get, Object.getOwnPropertyDescriptor(object, "hello").get); - shouldBe(desc.set, Object.getOwnPropertyDescriptor(object, "hello").set); -}()); diff --git a/implementation-contributed/javascriptcore/stress/reflect-get-prototype-of.js b/implementation-contributed/javascriptcore/stress/reflect-get-prototype-of.js deleted file mode 100644 index 15465f1cca..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect-get-prototype-of.js +++ /dev/null @@ -1,50 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -shouldBe(Reflect.getPrototypeOf.length, 1); - -shouldThrow(() => { - Reflect.getPrototypeOf("hello"); -}, `TypeError: Reflect.getPrototypeOf requires the first argument be an object`); - -var object = { hello: 42 }; -shouldBe(Reflect.getPrototypeOf(object), Object.prototype); -shouldBe(Reflect.getPrototypeOf(Reflect.getPrototypeOf(object)), null); -var proto = []; -object.__proto__ = proto; -shouldBe(Reflect.getPrototypeOf(object), proto); - -var array = []; -shouldBe(Reflect.getPrototypeOf(array), Array.prototype); -var proto = []; -array.__proto__ = Object.prototype; -shouldBe(Reflect.getPrototypeOf(array), Object.prototype); - -class Base { -} - -class Derived extends Base { -} - -shouldBe(Reflect.getPrototypeOf(new Derived), Derived.prototype); -shouldBe(Reflect.getPrototypeOf(Reflect.getPrototypeOf(new Derived)), Base.prototype); -shouldBe(Reflect.getPrototypeOf(Reflect.getPrototypeOf(Reflect.getPrototypeOf(new Derived))), Object.prototype); -shouldBe(Reflect.getPrototypeOf(Reflect.getPrototypeOf(Reflect.getPrototypeOf(Reflect.getPrototypeOf(new Derived)))), null); - -var object = Object.create(null); -shouldBe(Reflect.getPrototypeOf(object), null); diff --git a/implementation-contributed/javascriptcore/stress/reflect-get.js b/implementation-contributed/javascriptcore/stress/reflect-get.js deleted file mode 100644 index 48419bdb79..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect-get.js +++ /dev/null @@ -1,91 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -shouldBe(Reflect.get.length, 2); - -shouldThrow(() => { - Reflect.get("hello"); -}, `TypeError: Reflect.get requires the first argument be an object`); - -var object = { hello: 42 }; -shouldBe(Reflect.get(object, 'hello'), 42); -shouldBe(Reflect.get(object, 'world'), undefined); -var proto = []; -object.__proto__ = proto; -shouldBe(Reflect.get(object, 'length'), 0); - -var array = [ 0, 1, 2 ]; -shouldBe(Reflect.get(array, 0), 0); -var proto = [ 0, 1, 2, 5, 6 ]; -array.__proto__ = proto; -shouldBe(Reflect.get(array, 3), 5); -array.__proto__ = Object.prototype; -shouldBe(Reflect.get(array, 3), undefined); - -var object = { - value: 42, - world: 200, - get hello() - { - return this.value; - } -}; -shouldBe(Reflect.get(object, 'hello'), 42); -shouldBe(Reflect.get(object, 'hello', { value: 200 }), 200); -shouldBe(Reflect.get(object, 'hello', "OK"), undefined); -shouldBe(Reflect.get(object, 'world'), 200); -shouldBe(Reflect.get(object, 'world', { value: 200 }), 200); -shouldBe(Reflect.get(object, 'world', "OK"), 200); -var value = 400; -shouldBe(Reflect.get(object, 'hello', null), 400); -shouldBe(Reflect.get(object, 'hello', undefined), 400); - -var object = { - value: 42, - world: 200, - get hello() - { - "use strict"; - return this.value; - } -}; -shouldBe(Reflect.get(object, 'hello'), 42); -shouldBe(Reflect.get(object, 'hello', { value: 200 }), 200); -shouldBe(Reflect.get(object, 'hello', "OK"), undefined); -shouldBe(Reflect.get(object, 'world'), 200); -shouldBe(Reflect.get(object, 'world', { value: 200 }), 200); -shouldBe(Reflect.get(object, 'world', "OK"), 200); - -shouldThrow(() => { - Reflect.get(object, 'hello', null); -}, `TypeError: null is not an object (evaluating 'this.value')`); - -shouldThrow(() => { - Reflect.get(object, 'hello', undefined); -}, `TypeError: undefined is not an object (evaluating 'this.value')`); - -var object = { - value: 42, - world: 200, - set hello(value) - { - } -}; -shouldBe(Reflect.get(object, 'hello'), undefined); -shouldBe(Reflect.get(object, 'hello', { hello: 42 }), undefined); -shouldBe(Reflect.get(object, 'ok', { ok: 42 }), undefined); diff --git a/implementation-contributed/javascriptcore/stress/reflect-has.js b/implementation-contributed/javascriptcore/stress/reflect-has.js deleted file mode 100644 index 21b01fd012..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect-has.js +++ /dev/null @@ -1,65 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -shouldBe(Reflect.has.length, 2); - -shouldThrow(() => { - Reflect.has("hello", 42); -}, `TypeError: Reflect.has requires the first argument be an object`); - -var object = { hello: 42 }; -shouldBe(Reflect.has(object, 'hello'), true); -shouldBe(Reflect.has(object, 'world'), false); -shouldBe(Reflect.has(object, 'prototype'), false); -shouldBe(Reflect.has(object, '__proto__'), true); -shouldBe(Reflect.has(object, 'hasOwnProperty'), true); -shouldBe(Reflect.deleteProperty(object, 'hello'), true); -shouldBe(Reflect.has(object, 'hello'), false); - -shouldBe(Reflect.has([], 'length'), true); -shouldBe(Reflect.has([0,1,2], 0), true); -shouldBe(Reflect.has([0,1,2], 200), false); - -var object = { - [Symbol.iterator]: 42 -}; -shouldBe(Reflect.has(object, Symbol.iterator), true); -shouldBe(Reflect.has(object, Symbol.unscopables), false); -shouldBe(Reflect.deleteProperty(object, Symbol.iterator), true); -shouldBe(Reflect.has(object, Symbol.iterator), false); - -var toPropertyKey = { - toString() { - throw new Error('toString called.'); - } -}; - -shouldThrow(() => { - Reflect.has("hello", toPropertyKey); -}, `TypeError: Reflect.has requires the first argument be an object`); - -shouldThrow(() => { - Reflect.has({}, toPropertyKey); -}, `Error: toString called.`); - -var toPropertyKey = { - toString() { - return 'ok'; - } -}; -shouldBe(Reflect.has({ 'ok': 42 }, toPropertyKey), true); diff --git a/implementation-contributed/javascriptcore/stress/reflect-is-extensible.js b/implementation-contributed/javascriptcore/stress/reflect-is-extensible.js deleted file mode 100644 index 9d2581cb3f..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect-is-extensible.js +++ /dev/null @@ -1,28 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -shouldBe(Reflect.isExtensible.length, 1); - -shouldThrow(() => { - Reflect.isExtensible("hello"); -}, `TypeError: Reflect.isExtensible requires the first argument be an object`); - -var object = { hello: 42 }; -shouldBe(Reflect.isExtensible(object), true); -Object.preventExtensions(object); -shouldBe(Reflect.isExtensible(object), false); diff --git a/implementation-contributed/javascriptcore/stress/reflect-own-keys.js b/implementation-contributed/javascriptcore/stress/reflect-own-keys.js deleted file mode 100644 index 0685de3d74..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect-own-keys.js +++ /dev/null @@ -1,46 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -function shouldBeArray(actual, expected) { - shouldBe(actual.length, expected.length); - for (var i = 0; i < expected.length; ++i) { - try { - shouldBe(actual[i], expected[i]); - } catch(e) { - print(JSON.stringify(actual)); - throw e; - } - } -} - -shouldBe(Reflect.ownKeys.length, 1); - -shouldThrow(() => { - Reflect.ownKeys("hello"); -}, `TypeError: Reflect.ownKeys requires the first argument be an object`); - -var cocoa = Symbol("Cocoa"); -var cappuccino = Symbol("Cappuccino"); - -shouldBeArray(Reflect.ownKeys({}), []); -shouldBeArray(Reflect.ownKeys({42:42}), ['42']); -shouldBeArray(Reflect.ownKeys({0:0,1:1,2:2}), ['0','1','2']); -shouldBeArray(Reflect.ownKeys({0:0,1:1,2:2,hello:42}), ['0','1','2','hello']); -shouldBeArray(Reflect.ownKeys({hello:42,0:0,1:1,2:2,world:42}), ['0','1','2','hello','world']); -shouldBeArray(Reflect.ownKeys({[cocoa]:42,hello:42,0:0,1:1,2:2,world:42}), ['0','1','2','hello','world', cocoa]); -shouldBeArray(Reflect.ownKeys({[cocoa]:42,hello:42,0:0,1:1,2:2,[cappuccino]:42,world:42}), ['0','1','2','hello','world', cocoa, cappuccino]); diff --git a/implementation-contributed/javascriptcore/stress/reflect-prevent-extensions.js b/implementation-contributed/javascriptcore/stress/reflect-prevent-extensions.js deleted file mode 100644 index 4c5606ce7a..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect-prevent-extensions.js +++ /dev/null @@ -1,31 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -shouldBe(Reflect.preventExtensions.length, 1); - -shouldThrow(() => { - Reflect.preventExtensions("hello"); -}, `TypeError: Reflect.preventExtensions requires the first argument be an object`); - -var object = { hello: 42 }; -shouldBe(Reflect.isExtensible(object), true); -shouldBe(Reflect.preventExtensions(object), true); -shouldBe(Reflect.isExtensible(object), false); - -object.ok = 42; -shouldBe(object.hasOwnProperty('ok'), false); diff --git a/implementation-contributed/javascriptcore/stress/reflect-set-prototype-of.js b/implementation-contributed/javascriptcore/stress/reflect-set-prototype-of.js deleted file mode 100644 index 56fc13b7ad..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect-set-prototype-of.js +++ /dev/null @@ -1,75 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -shouldBe(Reflect.setPrototypeOf.length, 2); - -shouldThrow(() => { - Reflect.setPrototypeOf("hello"); -}, `TypeError: Reflect.setPrototypeOf requires the first argument be an object`); - -shouldThrow(() => { - Reflect.setPrototypeOf(null); -}, `TypeError: Reflect.setPrototypeOf requires the first argument be an object`); - -shouldThrow(() => { - Reflect.setPrototypeOf({}, 30); -}, `TypeError: Reflect.setPrototypeOf requires the second argument be either an object or null`); - -shouldThrow(() => { - Reflect.setPrototypeOf({}, undefined); -}, `TypeError: Reflect.setPrototypeOf requires the second argument be either an object or null`); - -var object = {}; -var prototype = {}; -shouldBe(Reflect.getPrototypeOf(object), Object.prototype); -shouldBe(Reflect.setPrototypeOf(object, prototype), true); -shouldBe(Reflect.getPrototypeOf(object), prototype); - -var object = {}; -shouldBe(Reflect.getPrototypeOf(object), Object.prototype); -shouldBe(Reflect.setPrototypeOf(object, null), true); -shouldBe(Reflect.getPrototypeOf(object), null); - -var array = []; -var prototype = {}; -shouldBe(Reflect.getPrototypeOf(array), Array.prototype); -shouldBe(Reflect.setPrototypeOf(array, prototype), true); -shouldBe(Reflect.getPrototypeOf(array), prototype); - -var array = []; -shouldBe(Reflect.getPrototypeOf(array), Array.prototype); -shouldBe(Reflect.setPrototypeOf(array, null), true); -shouldBe(Reflect.getPrototypeOf(array), null); - -var object = Object.create(null); -shouldBe(Reflect.getPrototypeOf(object), null); -shouldBe(Reflect.setPrototypeOf(object, Object.prototype), true); -shouldBe(Reflect.getPrototypeOf(object), Object.prototype); - -// Extensible check. -var object = {}; -shouldBe(Reflect.preventExtensions(object), true); -shouldBe(Reflect.setPrototypeOf(object, null), false); -shouldBe(Reflect.getPrototypeOf(object), Object.prototype); - -// Cyclic check. -var prototype = {}; -var object = { __proto__: prototype }; -shouldBe(Reflect.setPrototypeOf(prototype, object), false); -shouldBe(Reflect.getPrototypeOf(prototype), Object.prototype); - diff --git a/implementation-contributed/javascriptcore/stress/reflect-set-proxy-set.js b/implementation-contributed/javascriptcore/stress/reflect-set-proxy-set.js deleted file mode 100644 index 4e8abdd0d6..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect-set-proxy-set.js +++ /dev/null @@ -1,671 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function unreachable() -{ - throw new Error('unreachable'); -} - -function assert(b) { - if (!b) - throw new Error("bad assertion"); -} - -{ - let target = { - x: 30 - }; - - let called = false; - let handler = { - set: 45 - }; - - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - let threw = false; - try { - Reflect.set(proxy, 'x', 40); - unreachable(); - } catch(e) { - assert(e.toString() === "TypeError: 'set' property of a Proxy's handler should be callable"); - threw = true; - } - assert(threw); - } -} - -{ - let target = { - x: 30 - }; - - let error = null; - let handler = { - get set() { - error = new Error; - throw error; - } - }; - - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - let threw = false; - try { - Reflect.set(proxy, 'x', 40); - unreachable(); - } catch(e) { - assert(e === error); - threw = true; - } - assert(threw); - error = null; - } -} - -{ - let target = { - x: 30 - }; - - let error = null; - let handler = { - set: function() { - error = new Error; - throw error; - } - }; - - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - let threw = false; - try { - Reflect.set(proxy, 'x', 40); - unreachable(); - } catch(e) { - assert(e === error); - threw = true; - } - assert(threw); - error = null; - } -} - -{ - let target = { }; - Object.defineProperty(target, "x", { - configurable: false, - writable: false, - value: 500 - }); - - let called = false; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(theTarget === target); - called = true; - theTarget[propName] = value; - return false; - } - }; - - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, 'x', 40), false); - assert(called); - assert(proxy.x === 500); - assert(target.x === 500); - called = false; - } -} - -{ - let target = { }; - Object.defineProperty(target, "x", { - configurable: false, - writable: false, - value: 500 - }); - - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(theTarget === target); - theTarget[propName] = value; - return true; - } - }; - - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - let threw = false; - try { - Reflect.set(proxy, 'x', 40); - unreachable(); - } catch(e) { - threw = true; - assert(e.toString() === "TypeError: Proxy handler's 'set' on a non-configurable and non-writable property on 'target' should either return false or be the same value already on the 'target'"); - } - assert(threw); - } -} - -{ - let target = { }; - Object.defineProperty(target, "x", { - configurable: false, - get: function() { - return 25; - } - }); - - let called = false; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(theTarget === target); - called = true; - theTarget[propName] = value; - return false; - } - }; - - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, 'x', 40), false); - assert(proxy.x === 25); - assert(called); - called = false; - } -} - -{ - let target = { }; - Object.defineProperty(target, "x", { - configurable: false, - get: function() { - return 25; - } - }); - - let called = false; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(theTarget === target); - called = true; - theTarget[propName] = value; - return true; - } - }; - - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - let threw = false; - try { - Reflect.set(proxy, 'x', 40); - unreachable(); - } catch(e) { - threw = true; - assert(e.toString() === "TypeError: Proxy handler's 'set' method on a non-configurable accessor property without a setter should return false"); - } - assert(threw); - } -} - -{ - let target = { }; - Object.defineProperty(target, "x", { - configurable: false, - writable: true, - value: 50 - }); - - let called = false; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(theTarget === target); - called = true; - theTarget[propName] = value; - return true; - } - }; - - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, 'x', i), true); - assert(called); - assert(proxy.x === i); - assert(target.x === i); - called = false; - } -} - -{ - let target = { - x: 30 - }; - - let called = false; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - assert(receiver === proxy); - called = true; - theTarget[propName] = value; - } - }; - - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, 'x', i), false); - assert(called); - assert(proxy.x === i); - assert(target.x === i); - called = false; - - shouldBe(Reflect.set(proxy, 'y', i), false); - assert(called); - assert(proxy.y === i); - assert(target.y === i); - called = false; - } -} - -{ - let target = { - x: 30 - }; - - let called = false; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - assert(receiver === proxy); - called = true; - theTarget[propName] = value; - } - }; - - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, 'x', i), false); - assert(called); - assert(proxy.x === i); - assert(target.x === i); - called = false; - - shouldBe(Reflect.set(proxy, 'y', i), false); - assert(called); - assert(proxy.y === i); - assert(target.y === i); - called = false; - } -} - -{ - let target = []; - - let called = false; - let handler = { }; - - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, i, i), true); - assert(proxy[i] === i); - assert(target[i] === i); - } -} - -{ - let target = []; - - let called = false; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - assert(receiver === proxy); - called = true; - theTarget[propName] = value; - } - }; - - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, i, i), false); - assert(proxy[i] === i); - assert(target[i] === i); - assert(called); - called = false; - } -} - -{ - let target = []; - - let called = false; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - assert(receiver === proxy); - called = true; - theTarget[propName] = value; - } - }; - - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, i, i), false); - assert(proxy[i] === i); - assert(target[i] === i); - assert(called); - called = false; - } -} - -{ - let called = false; - let throughProxy = false; - let target = { - set x(v) { - assert(this === target); - this._x = v; - called = true; - }, - get x() { - if (throughProxy) - assert(this === proxy); - else - assert(this === target); - return this._x; - } - }; - - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - assert(receiver === proxy); - theTarget[propName] = value; - return true; - } - }; - - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, 'x', i), true); - assert(called); - throughProxy = true; - assert(proxy.x === i); - throughProxy = false; - assert(target.x === i); - assert(proxy._x === i); - assert(target._x === i); - called = false; - } -} - -{ - let called = false; - let target = {}; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - assert(receiver === obj); - theTarget[propName] = value; - called = true; - return true; - } - }; - - let proxy = new Proxy(target, handler); - let obj = Object.create(proxy, { - own: { - writable: true, - configurable: true, - value: null - } - }); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(obj, 'own', i), true); - assert(!called); - assert(obj.own === i); - - shouldBe(Reflect.set(obj, 'notOwn', i), true); - assert(target.notOwn === i); - assert(proxy.notOwn === i); - assert(obj.notOwn === i); - assert(called); - called = false; - } -} - -{ - let target = {}; - let handler = { }; - - let proxy = new Proxy(target, handler); - let obj = Object.create(proxy, { - own: { - writable: true, - configurable: true, - value: null - } - }); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(obj, 'own', i), true); - assert(obj.own === i); - assert(proxy.own === undefined); - - shouldBe(Reflect.set(obj, 'notOwn', i), true); - // The receiver is always |obj|. - // obj.[[Set]](P, V, obj) -> Proxy.[[Set]](P, V, obj) -> target.[[Set]](P, V, obj) - assert(target.notOwn === undefined); - assert(proxy.notOwn === undefined); - assert(obj.notOwn === i); - } -} - -{ - let called = false; - let target = {}; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - assert(receiver === obj); - theTarget[propName] = value; - called = true; - return true; - } - }; - - let proxy = new Proxy(target, handler); - let obj = Object.create(proxy, { - [0]: { - writable: true, - configurable: true, - value: null - } - }); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(obj, 0, i), true); - assert(!called); - assert(obj[0] === i); - assert(proxy[0] === undefined); - - shouldBe(Reflect.set(obj, 1, i), true); - assert(target[1] === i); - assert(proxy[1] === i); - assert(obj[1] === i); - assert(called); - called = false; - } -} - -{ - let target = {}; - let handler = { }; - - let proxy = new Proxy(target, handler); - let obj = Object.create(proxy, { - [0]: { - writable: true, - configurable: true, - value: null - } - }); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(obj, 0, i), true); - assert(obj[0] === i); - assert(proxy[0] === undefined); - - shouldBe(Reflect.set(obj, 1, i), true); - // The receiver is always |obj|. - // obj.[[Set]](P, V, obj) -> Proxy.[[Set]](P, V, obj) -> target.[[Set]](P, V, obj) - assert(target[1] === undefined); - assert(proxy[1] === undefined); - assert(obj[1] === i); - } -} - -{ - let called = false; - let target = {}; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - assert(receiver === obj); - theTarget[propName] = value; - called = true; - return true; - } - }; - - let proxy = new Proxy(target, handler); - let obj = Object.create(proxy, { - [0]: { - writable: true, - configurable: true, - value: null - } - }); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(obj, 0, i), true); - assert(!called); - assert(obj[0] === i); - assert(proxy[0] === undefined); - - shouldBe(Reflect.set(obj, 1, i), true); - assert(target[1] === i); - assert(proxy[1] === i); - assert(obj[1] === i); - assert(called); - called = false; - } -} - -{ - let called = false; - let target = [25]; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - assert(receiver === obj); - theTarget[propName] = value; - called = true; - return true; - } - }; - - let proxy = new Proxy(target, handler); - let obj = Object.create(proxy, { - [0]: { - writable: true, - configurable: true, - value: null - } - }); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(obj, 0, i), true); - assert(!called); - assert(obj[0] === i); - assert(proxy[0] === 25); - - shouldBe(Reflect.set(obj, 1, i), true); - assert(target[1] === i); - assert(proxy[1] === i); - assert(obj[1] === i); - assert(called); - called = false; - } -} - -{ - let called = false; - let ogTarget = {}; - let target = new Proxy(ogTarget, { - set: function(theTarget, propName, value, receiver) { - assert(theTarget === ogTarget); - assert(receiver === obj); - called = true; - theTarget[propName] = value; - } - }); - let handler = { }; - - let proxy = new Proxy(target, handler); - let obj = Object.create(proxy, { - own: { - writable: true, - configurable: true, - value: null - } - }); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(obj, 'own', i), true); - assert(!called); - assert(obj.own === i); - assert(proxy.own === undefined); - - shouldBe(Reflect.set(obj, 'notOwn', i), false); - assert(target.notOwn === i); - assert(proxy.notOwn === i); - assert(obj.notOwn === i); - assert(called); - called = false; - } -} - -{ - let called = false; - let ogTarget = [25]; - let target = new Proxy(ogTarget, { - set: function(theTarget, propName, value, receiver) { - assert(theTarget === ogTarget); - assert(receiver === obj); - called = true; - theTarget[propName] = value; - } - }); - let handler = { }; - - let proxy = new Proxy(target, handler); - let obj = Object.create(proxy, { - [0]: { - writable: true, - configurable: true, - value: null - } - }); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(obj, 0, i), true); - assert(!called); - assert(obj[0] === i); - assert(proxy[0] === 25); - - shouldBe(Reflect.set(obj, 1, i), false); - assert(target[1] === i); - assert(proxy[1] === i); - assert(obj[1] === i); - assert(called); - called = false; - } -} diff --git a/implementation-contributed/javascriptcore/stress/reflect-set-receiver-proxy-set.js b/implementation-contributed/javascriptcore/stress/reflect-set-receiver-proxy-set.js deleted file mode 100644 index 054de70921..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect-set-receiver-proxy-set.js +++ /dev/null @@ -1,704 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function unreachable() -{ - throw new Error('unreachable'); -} - -function assert(b) { - if (!b) - throw new Error("bad assertion"); -} - -(function () { - { - let target = { - x: 30 - }; - - let called = false; - let handler = { - set: 45 - }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - let threw = false; - try { - Reflect.set(proxy, 'x', 40, theReceiver); - unreachable(); - } catch(e) { - assert(e.toString() === "TypeError: 'set' property of a Proxy's handler should be callable"); - threw = true; - } - assert(threw); - } - } - - { - let target = { - x: 30 - }; - - let error = null; - let handler = { - get set() { - error = new Error; - throw error; - } - }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - let threw = false; - try { - Reflect.set(proxy, 'x', 40, theReceiver); - unreachable(); - } catch(e) { - assert(e === error); - threw = true; - } - assert(threw); - error = null; - } - } - - { - let target = { - x: 30 - }; - - let error = null; - let handler = { - set: function(_1, _2, _3, receiver) { - shouldBe(receiver, theReceiver); - error = new Error; - throw error; - } - }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - let threw = false; - try { - Reflect.set(proxy, 'x', 40, theReceiver); - unreachable(); - } catch(e) { - assert(e === error); - threw = true; - } - assert(threw); - error = null; - } - } - - { - let target = { }; - Object.defineProperty(target, "x", { - configurable: false, - writable: false, - value: 500 - }); - - let theReceiver = {}; - let called = false; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(theTarget === target); - shouldBe(receiver, theReceiver); - called = true; - theTarget[propName] = value; - return false; - } - }; - - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, 'x', 40, theReceiver), false); - assert(called); - assert(proxy.x === 500); - assert(target.x === 500); - called = false; - } - } - - { - let target = { }; - Object.defineProperty(target, "x", { - configurable: false, - writable: false, - value: 500 - }); - - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(theTarget === target); - shouldBe(receiver, theReceiver); - theTarget[propName] = value; - return true; - } - }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - let threw = false; - try { - Reflect.set(proxy, 'x', 40, theReceiver); - unreachable(); - } catch(e) { - threw = true; - assert(e.toString() === "TypeError: Proxy handler's 'set' on a non-configurable and non-writable property on 'target' should either return false or be the same value already on the 'target'"); - } - assert(threw); - } - } - - { - let target = { }; - Object.defineProperty(target, "x", { - configurable: false, - get: function() { - return 25; - } - }); - - let called = false; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(theTarget === target); - shouldBe(receiver, theReceiver); - called = true; - theTarget[propName] = value; - return false; - } - }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, 'x', 40, theReceiver), false); - assert(proxy.x === 25); - assert(theReceiver.x === undefined); - assert(called); - called = false; - } - } - - { - let target = { }; - Object.defineProperty(target, "x", { - configurable: false, - get: function() { - return 25; - } - }); - - let called = false; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(theTarget === target); - shouldBe(receiver, theReceiver); - called = true; - theTarget[propName] = value; - return true; - } - }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - let threw = false; - try { - Reflect.set(proxy, 'x', 40, theReceiver); - unreachable(); - } catch(e) { - threw = true; - assert(e.toString() === "TypeError: Proxy handler's 'set' method on a non-configurable accessor property without a setter should return false"); - } - assert(called); - assert(threw); - } - } - - { - let target = { }; - Object.defineProperty(target, "x", { - configurable: false, - writable: true, - value: 50 - }); - - let called = false; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(theTarget === target); - shouldBe(receiver, theReceiver); - called = true; - theTarget[propName] = value; - return true; - } - }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, 'x', i, theReceiver), true); - assert(called); - assert(proxy.x === i); - assert(target.x === i); - assert(theReceiver.x === undefined); - called = false; - } - } - - { - let target = { - x: 30 - }; - - let called = false; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - shouldBe(receiver, theReceiver); - called = true; - theTarget[propName] = value; - } - }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, 'x', i, theReceiver), false); - assert(called); - assert(proxy.x === i); - assert(target.x === i); - assert(theReceiver.x === undefined); - called = false; - - shouldBe(Reflect.set(proxy, 'y', i, theReceiver), false); - assert(called); - assert(proxy.y === i); - assert(target.y === i); - assert(theReceiver.y === undefined); - called = false; - } - } - - { - let target = { - x: 30 - }; - - let called = false; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - assert(receiver === theReceiver); - called = true; - theTarget[propName] = value; - } - }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, 'x', i, theReceiver), false); - assert(called); - assert(proxy.x === i); - assert(target.x === i); - assert(theReceiver.x === undefined); - called = false; - - shouldBe(Reflect.set(proxy, 'y', i, theReceiver), false); - assert(called); - assert(proxy.y === i); - assert(target.y === i); - assert(theReceiver.y === undefined); - called = false; - } - } - - { - let target = []; - - let called = false; - let handler = { }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, i, i, theReceiver), true); - assert(proxy[i] === undefined); - assert(target[i] === undefined); - assert(theReceiver[i] === i); - } - } - - { - let target = []; - - let called = false; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - assert(receiver === theReceiver); - called = true; - theTarget[propName] = value; - } - }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, i, i, theReceiver), false); - assert(proxy[i] === i); - assert(target[i] === i); - assert(theReceiver[i] === undefined); - assert(called); - called = false; - } - } - - { - let throughProxy = false; - let called = false; - let target = { - set x(v) { - assert(this === target); - this._x = v; - called = true; - }, - get x() { - if (throughProxy) - assert(this === proxy); - else - assert(this === target); - return this._x; - } - }; - - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - assert(receiver === theReceiver); - theTarget[propName] = value; - return true; - } - }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(proxy, 'x', i, theReceiver), true); - assert(called); - throughProxy = true; - assert(proxy.x === i); - throughProxy = false; - assert(target.x === i); - assert(theReceiver.x === undefined); - assert(proxy._x === i); - assert(target._x === i); - assert(theReceiver._x === undefined); - called = false; - } - } - - { - let called = false; - let target = {}; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - assert(receiver === theReceiver); - theTarget[propName] = value; - called = true; - return true; - } - }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - let obj = Object.create(proxy, { - own: { - writable: true, - configurable: true, - value: null - } - }); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(obj, 'own', i, theReceiver), true); - assert(!called); - assert(obj.own === null); - assert(theReceiver.own === i); - - shouldBe(Reflect.set(obj, 'notOwn', i, theReceiver), true); - assert(target.notOwn === i); - assert(proxy.notOwn === i); - assert(obj.notOwn === i); - assert(theReceiver.notOwn === undefined); - assert(called); - called = false; - } - } - - { - let target = {}; - let handler = { }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - let obj = Object.create(proxy, { - own: { - writable: true, - configurable: true, - value: null - } - }); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(obj, 'own', i, theReceiver), true); - assert(obj.own === null); - assert(proxy.own === undefined); - assert(theReceiver.own === i); - - shouldBe(Reflect.set(obj, 'notOwn', i, theReceiver), true); - // The receiver is always |theReceiver|. - // obj.[[Set]](P, V, theReceiver) -> Proxy.[[Set]](P, V, theReceiver) -> target.[[Set]](P, V, theReceiver) - assert(target.notOwn === undefined); - assert(proxy.notOwn === undefined); - assert(obj.notOwn === undefined); - assert(theReceiver.notOwn === i); - } - } - - { - let called = false; - let target = {}; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - assert(receiver === theReceiver); - theTarget[propName] = value; - called = true; - return true; - } - }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - let obj = Object.create(proxy, { - [0]: { - writable: true, - configurable: true, - value: null - } - }); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(obj, 0, i, theReceiver), true); - assert(!called); - assert(obj[0] === null); - assert(proxy[0] === undefined); - assert(theReceiver[0] === i); - - shouldBe(Reflect.set(obj, 1, i, theReceiver), true); - assert(target[1] === i); - assert(proxy[1] === i); - assert(obj[1] === i); - assert(theReceiver[1] === undefined); - assert(called); - called = false; - } - } - - { - let target = {}; - let handler = { }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - let obj = Object.create(proxy, { - [0]: { - writable: true, - configurable: true, - value: null - } - }); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(obj, 0, i, theReceiver), true); - assert(obj[0] === null); - assert(proxy[0] === undefined); - assert(theReceiver[0] === i); - - shouldBe(Reflect.set(obj, 1, i, theReceiver), true); - // The receiver is always |theReceiver|. - // obj.[[Set]](P, V, theReceiver) -> Proxy.[[Set]](P, V, theReceiver) -> target.[[Set]](P, V, theReceiver) - assert(target[1] === undefined); - assert(proxy[1] === undefined); - assert(obj[1] === undefined); - assert(theReceiver[1] === i); - } - } - - { - let called = false; - let target = {}; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - assert(receiver === theReceiver); - theTarget[propName] = value; - called = true; - return true; - } - }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - let obj = Object.create(proxy, { - [0]: { - writable: true, - configurable: true, - value: null - } - }); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(obj, 0, i, theReceiver), true); - assert(!called); - assert(obj[0] === null); - assert(proxy[0] === undefined); - assert(theReceiver[0] === i); - - shouldBe(Reflect.set(obj, 1, i, theReceiver), true); - assert(target[1] === i); - assert(proxy[1] === i); - assert(obj[1] === i); - assert(theReceiver[1] === undefined); - assert(called); - called = false; - } - } - - { - let called = false; - let target = [25]; - let handler = { - set: function(theTarget, propName, value, receiver) { - assert(target === theTarget); - assert(receiver === theReceiver); - theTarget[propName] = value; - called = true; - return true; - } - }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - let obj = Object.create(proxy, { - [0]: { - writable: true, - configurable: true, - value: null - } - }); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(obj, 0, i, theReceiver), true); - assert(!called); - assert(obj[0] === null); - assert(proxy[0] === 25); - assert(theReceiver[0] === i); - - shouldBe(Reflect.set(obj, 1, i, theReceiver), true); - assert(target[1] === i); - assert(proxy[1] === i); - assert(obj[1] === i); - assert(theReceiver[1] === undefined); - assert(called); - called = false; - } - } - - { - let called = false; - let ogTarget = {}; - let target = new Proxy(ogTarget, { - set: function(theTarget, propName, value, receiver) { - assert(theTarget === ogTarget); - assert(receiver === theReceiver); - called = true; - theTarget[propName] = value; - } - }); - let handler = { }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - let obj = Object.create(proxy, { - own: { - writable: true, - configurable: true, - value: null - } - }); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(obj, 'own', i, theReceiver), true); - assert(!called); - assert(obj.own === null); - assert(proxy.own === undefined); - assert(theReceiver.own === i); - - shouldBe(Reflect.set(obj, 'notOwn', i, theReceiver), false); - assert(target.notOwn === i); - assert(proxy.notOwn === i); - assert(obj.notOwn === i); - assert(theReceiver.notOwn === undefined); - assert(called); - called = false; - } - } - - { - let called = false; - let ogTarget = [25]; - let target = new Proxy(ogTarget, { - set: function(theTarget, propName, value, receiver) { - assert(theTarget === ogTarget); - assert(receiver === theReceiver); - called = true; - theTarget[propName] = value; - } - }); - let handler = { }; - - let theReceiver = {}; - let proxy = new Proxy(target, handler); - let obj = Object.create(proxy, { - [0]: { - writable: true, - configurable: true, - value: null - } - }); - for (let i = 0; i < 1000; i++) { - shouldBe(Reflect.set(obj, 0, i, theReceiver), true); - assert(!called); - assert(obj[0] === null); - assert(proxy[0] === 25); - assert(theReceiver[0] === i); - - shouldBe(Reflect.set(obj, 1, i, theReceiver), false); - assert(target[1] === i); - assert(proxy[1] === i); - assert(obj[1] === i); - assert(theReceiver[1] === undefined); - assert(called); - called = false; - } - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/reflect-set-with-global-proxy.js b/implementation-contributed/javascriptcore/stress/reflect-set-with-global-proxy.js deleted file mode 100644 index 1e44f2355f..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect-set-with-global-proxy.js +++ /dev/null @@ -1,206 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function unreachable() -{ - throw new Error('unreachable'); -} - -function receiverTest(object, receiver) -{ - shouldBe(Reflect.set(object, 'Cocoa', 42, receiver), true); - shouldBe(Reflect.get(receiver, 'Cocoa'), 42); - shouldBe(Reflect.get(object, 'Cocoa'), undefined); - - // Existing. - shouldBe(Reflect.set(object, 'Matcha', 40), true); - shouldBe(Reflect.get(object, 'Matcha'), 40); - shouldBe(Reflect.set(object, 'Matcha', 42, receiver), true); - shouldBe(Reflect.get(receiver, 'Matcha'), 42); - shouldBe(Reflect.get(object, 'Matcha'), 40); - - // Existing non writable own descriptor. - Reflect.defineProperty(object, 'Cappuccino', { - value: 'nice', - writable: false - }); - shouldBe(Reflect.set(object, 'Cappuccino', 42, receiver), false); - shouldBe(Reflect.get(receiver, 'Cappuccino'), undefined); - shouldBe(receiver.hasOwnProperty('Cappuccino'), false); - shouldBe(Reflect.get(object, 'Cappuccino'), 'nice'); - - // Existing non writable receiver descriptor. - Reflect.defineProperty(receiver, 'Kilimanjaro', { - value: 'good', - writable: false - }); - shouldBe(Reflect.set(object, 'Kilimanjaro', 42, receiver), false); - shouldBe(Reflect.get(receiver, 'Kilimanjaro'), 'good'); - shouldBe(receiver.hasOwnProperty('Kilimanjaro'), true); - shouldBe(Reflect.get(object, 'Kilimanjaro'), undefined); - shouldBe(object.hasOwnProperty('Kilimanjaro'), false); - - shouldBe(Reflect.set(object, 'Kilimanjaro', 42, 'receiver'), false); - - // Receiver accessors. - shouldBe(Reflect.defineProperty(receiver, 'Mocha', { - get() - { - return 42; - }, - configurable: true - }), true); - shouldBe(Reflect.set(object, 'Mocha', 42, receiver), false); - shouldBe(Reflect.defineProperty(receiver, 'Mocha', { - set(value) - { - unreachable(); - }, - configurable: true - }), true); - shouldBe(Reflect.set(object, 'Mocha', 42, receiver), false); - shouldBe(receiver.value, undefined); - shouldBe(Reflect.defineProperty(object, 'Mocha', { - get(value) - { - }, - configurable: true - }), true); - shouldBe(Reflect.set(object, 'Mocha', 42, receiver), false); - shouldBe(receiver.value, undefined); - shouldBe(Reflect.defineProperty(object, 'Mocha', { - set(value) - { - shouldBe(this, receiver); - this.value = value; - }, - configurable: true - }), true); - shouldBe(Reflect.set(object, 'Mocha', 42, receiver), true); - shouldBe(receiver.value, 42); - shouldBe(object.value, undefined); -} - -function receiverTestIndexed(object, receiver) -{ - shouldBe(Reflect.set(object, 11, 42, receiver), true); - shouldBe(Reflect.get(receiver, 11), 42); - shouldBe(Reflect.get(object, 11), undefined); - - // Existing. - shouldBe(Reflect.set(object, 12, 40), true); - shouldBe(Reflect.get(object, 12), 40); - shouldBe(Reflect.set(object, 12, 42, receiver), true); - shouldBe(Reflect.get(receiver, 12), 42); - shouldBe(Reflect.get(object, 12), 40); - - // Existing non writable own descriptor. - Reflect.defineProperty(object, 13, { - value: 'nice', - writable: false - }); - shouldBe(Reflect.set(object, 13, 42, receiver), false); - shouldBe(Reflect.get(receiver, 13), undefined); - shouldBe(receiver.hasOwnProperty(13), false); - shouldBe(Reflect.get(object, 13), 'nice'); - - // Existing non writable receiver descriptor. - Reflect.defineProperty(receiver, 14, { - value: 'good', - writable: false - }); - shouldBe(Reflect.set(object, 14, 42, receiver), false); - shouldBe(Reflect.get(receiver, 14), 'good'); - shouldBe(receiver.hasOwnProperty(14), true); - shouldBe(Reflect.get(object, 14), undefined); - shouldBe(object.hasOwnProperty(14), false); - - // Receiver is a primitive value. - shouldBe(Reflect.set(object, 14, 42, 'receiver'), false); - - // Receiver accessors. - shouldBe(Reflect.defineProperty(receiver, 15, { - get() - { - return 42; - }, - configurable: true - }), true); - shouldBe(Reflect.set(object, 15, 42, receiver), false); - shouldBe(Reflect.defineProperty(receiver, 15, { - set(value) - { - unreachable(); - }, - configurable: true - }), true); - shouldBe(Reflect.set(object, 15, 42, receiver), false); - shouldBe(receiver.value, undefined); - shouldBe(Reflect.defineProperty(object, 15, { - get(value) - { - }, - configurable: true - }), true); - shouldBe(Reflect.set(object, 15, 42, receiver), false); - shouldBe(receiver.value, undefined); - shouldBe(Reflect.defineProperty(object, 15, { - set(value) - { - shouldBe(this, receiver); - this.value = value; - }, - configurable: true - }), true); - shouldBe(Reflect.set(object, 15, 42, receiver), true); - shouldBe(receiver.value, 42); - shouldBe(object.value, undefined); -} - -// The global object is wrapped with the JSProxy. -var global = this; - -receiverTest(global, {}); -receiverTestIndexed(global, {}); -Reflect.defineProperty(global, 'OK1', { - set: function (value) { - shouldBe(this, global); - } -}); -function test1() -{ - global.OK1 = 'Hello'; -} -noInline(test1); -for (var i = 0; i < 1e4; ++i) - test1(); - -Reflect.defineProperty(global, 'OK2', { - set: function (value) { - 'use strict'; - shouldBe(this, global); - } -}); -function test2() -{ - global.OK2 = 'Hello'; -} -noInline(test2); -for (var i = 0; i < 1e4; ++i) - test2(); - -var receiver = {}; -Reflect.defineProperty(global, 'OK3', { - set: function (value) { - shouldBe(this, receiver); - } -}); -function test3() -{ - shouldBe(Reflect.set(global, 'OK3', 'value', receiver), true); -} -noInline(test3); -for (var i = 0; i < 1e4; ++i) - test3(); diff --git a/implementation-contributed/javascriptcore/stress/reflect-set.js b/implementation-contributed/javascriptcore/stress/reflect-set.js deleted file mode 100644 index ef315ac62d..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect-set.js +++ /dev/null @@ -1,1225 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error('not thrown.'); - if (String(error) !== message) - throw new Error('bad error: ' + String(error)); -} - -function unreachable() -{ - throw new Error('unreachable'); -} - -function receiverTest(object, receiver) -{ - shouldBe(Reflect.set(object, 'Cocoa', 42, receiver), true); - shouldBe(Reflect.get(receiver, 'Cocoa'), 42); - shouldBe(Reflect.get(object, 'Cocoa'), undefined); - - // Existing. - shouldBe(Reflect.set(object, 'Matcha', 40), true); - shouldBe(Reflect.get(object, 'Matcha'), 40); - shouldBe(Reflect.set(object, 'Matcha', 42, receiver), true); - shouldBe(Reflect.get(receiver, 'Matcha'), 42); - shouldBe(Reflect.get(object, 'Matcha'), 40); - - // Existing non writable own descriptor. - Reflect.defineProperty(object, 'Cappuccino', { - value: 'nice', - writable: false - }); - shouldBe(Reflect.set(object, 'Cappuccino', 42, receiver), false); - shouldBe(Reflect.get(receiver, 'Cappuccino'), undefined); - shouldBe(receiver.hasOwnProperty('Cappuccino'), false); - shouldBe(Reflect.get(object, 'Cappuccino'), 'nice'); - - // Existing non writable receiver descriptor. - Reflect.defineProperty(receiver, 'Kilimanjaro', { - value: 'good', - writable: false - }); - shouldBe(Reflect.set(object, 'Kilimanjaro', 42, receiver), false); - shouldBe(Reflect.get(receiver, 'Kilimanjaro'), 'good'); - shouldBe(receiver.hasOwnProperty('Kilimanjaro'), true); - shouldBe(Reflect.get(object, 'Kilimanjaro'), undefined); - shouldBe(object.hasOwnProperty('Kilimanjaro'), false); - - shouldBe(Reflect.set(object, 'Kilimanjaro', 42, 'receiver'), false); - - // Receiver accessors. - shouldBe(Reflect.defineProperty(receiver, 'Mocha', { - get() - { - return 42; - }, - configurable: true - }), true); - shouldBe(Reflect.set(object, 'Mocha', 42, receiver), false); - shouldBe(Reflect.defineProperty(receiver, 'Mocha', { - set(value) - { - unreachable(); - }, - configurable: true - }), true); - shouldBe(Reflect.set(object, 'Mocha', 42, receiver), false); - shouldBe(receiver.value, undefined); - shouldBe(Reflect.defineProperty(object, 'Mocha', { - get(value) - { - }, - configurable: true - }), true); - shouldBe(Reflect.set(object, 'Mocha', 42, receiver), false); - shouldBe(receiver.value, undefined); - shouldBe(Reflect.defineProperty(object, 'Mocha', { - set(value) - { - shouldBe(this, receiver); - this.value = value; - }, - configurable: true - }), true); - shouldBe(Reflect.set(object, 'Mocha', 42, receiver), true); - shouldBe(receiver.value, 42); - shouldBe(object.value, undefined); -} - -function receiverTestIndexed(object, receiver) -{ - shouldBe(Reflect.set(object, 11, 42, receiver), true); - shouldBe(Reflect.get(receiver, 11), 42); - shouldBe(Reflect.get(object, 11), undefined); - - // Existing. - shouldBe(Reflect.set(object, 12, 40), true); - shouldBe(Reflect.get(object, 12), 40); - shouldBe(Reflect.set(object, 12, 42, receiver), true); - shouldBe(Reflect.get(receiver, 12), 42); - shouldBe(Reflect.get(object, 12), 40); - - // Existing non writable own descriptor. - Reflect.defineProperty(object, 13, { - value: 'nice', - writable: false - }); - shouldBe(Reflect.set(object, 13, 42, receiver), false); - shouldBe(Reflect.get(receiver, 13), undefined); - shouldBe(receiver.hasOwnProperty(13), false); - shouldBe(Reflect.get(object, 13), 'nice'); - - // Existing non writable receiver descriptor. - Reflect.defineProperty(receiver, 14, { - value: 'good', - writable: false - }); - shouldBe(Reflect.set(object, 14, 42, receiver), false); - shouldBe(Reflect.get(receiver, 14), 'good'); - shouldBe(receiver.hasOwnProperty(14), true); - shouldBe(Reflect.get(object, 14), undefined); - shouldBe(object.hasOwnProperty(14), false); - - // Receiver is a primitive value. - shouldBe(Reflect.set(object, 14, 42, 'receiver'), false); - - // Receiver accessors. - shouldBe(Reflect.defineProperty(receiver, 15, { - get() - { - return 42; - }, - configurable: true - }), true); - shouldBe(Reflect.set(object, 15, 42, receiver), false); - shouldBe(Reflect.defineProperty(receiver, 15, { - set(value) - { - unreachable(); - }, - configurable: true - }), true); - shouldBe(Reflect.set(object, 15, 42, receiver), false); - shouldBe(receiver.value, undefined); - shouldBe(Reflect.defineProperty(object, 15, { - get(value) - { - }, - configurable: true - }), true); - shouldBe(Reflect.set(object, 15, 42, receiver), false); - shouldBe(receiver.value, undefined); - shouldBe(Reflect.defineProperty(object, 15, { - set(value) - { - shouldBe(this, receiver); - this.value = value; - }, - configurable: true - }), true); - shouldBe(Reflect.set(object, 15, 42, receiver), true); - shouldBe(receiver.value, 42); - shouldBe(object.value, undefined); -} - -shouldBe(Reflect.set.length, 3); - -shouldThrow(() => { - Reflect.set('hello', 'hello', 42); -}, `TypeError: Reflect.set requires the first argument be an object`); - -var symbol = Symbol(); - -(function simpleReceiverCase() { - var receiver = {}; - var object = { - }; - - shouldBe(Reflect.set(object, 'Cocoa', 42, receiver), true); - shouldBe(Reflect.get(object, 'Cocoa'), undefined); - shouldBe(Reflect.get(receiver, 'Cocoa'), 42); - - var object2 = { - set Cocoa(value) { - print(value); - shouldBe(this, receiver); - this.value = value; - } - }; - shouldBe(Reflect.set(object, 'Cocoa', 42, receiver), true); - shouldBe(Reflect.get(object, 'Cocoa'), undefined); - shouldBe(Reflect.get(receiver, 'Cocoa'), 42); -}()); - -(function objectCase() { - 'use strict'; - var object = {}; - shouldBe(Reflect.get(object, 'hello'), undefined); - shouldBe(Reflect.set(object, 'hello', 42), true); - shouldBe(Reflect.get(object, 'hello'), 42); - shouldBe(Reflect.get(object, 0), undefined); - shouldBe(Reflect.set(object, 0, 42), true); - shouldBe(Reflect.get(object, 0), 42); - shouldBe(Reflect.get(object, symbol), undefined); - shouldBe(Reflect.set(object, symbol, 42), true); - shouldBe(Reflect.get(object, symbol), 42); - - var object = {}; - shouldBe(Reflect.defineProperty(object, 'hello', { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), false); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.set(object, 0, 42), false); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, symbol, { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), false); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - - var object = {}; - shouldBe(Reflect.defineProperty(object, 'hello', { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.set(object, 0, 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, symbol, { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - - var object = {}; - shouldBe(Reflect.defineProperty(object, 'hello', { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), false); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.set(object, 0, 42), false); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, symbol, { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), false); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - - receiverTest({}, {}); - receiverTestIndexed({}, {}); -}()); - -(function arrayCase() { - 'use strict'; - var object = []; - shouldBe(Reflect.get(object, 'hello'), undefined); - shouldBe(Reflect.set(object, 'hello', 42), true); - shouldBe(Reflect.get(object, 'hello'), 42); - shouldBe(Reflect.get(object, 0), undefined); - shouldBe(Reflect.set(object, 0, 42), true); - shouldBe(Reflect.get(object, 0), 42); - shouldBe(Reflect.get(object, symbol), undefined); - shouldBe(Reflect.set(object, symbol, 42), true); - shouldBe(Reflect.get(object, symbol), 42); - object[1000000] = 'Hello'; - shouldBe(Reflect.set(object, 0, 50), true); - shouldBe(Reflect.get(object, 0), 50); - - var object = []; - shouldBe(Reflect.defineProperty(object, 'hello', { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), false); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.set(object, 0, 42), false); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(object.length, 1); - shouldBe(Reflect.defineProperty(object, symbol, { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), false); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - - // Length. - var object = []; - shouldBe(Reflect.get(object, 'length'), 0); - shouldThrow(() => { - Reflect.set(object, 'length', 'Cappuccino'); - }, `RangeError: Invalid array length`); - shouldBe(Reflect.get(object, 'length'), 0); - - var object = []; - shouldBe(Reflect.get(object, 'length'), 0); - shouldBe(Reflect.set(object, 'length', 20), true); - shouldBe(Reflect.get(object, 'length'), 20); - - var object = []; - Object.freeze(object); - shouldBe(Reflect.get(object, 'length'), 0); - shouldBe(Reflect.set(object, 'length', 20), false); - shouldBe(Reflect.get(object, 'length'), 0); - - var object = []; - shouldBe(Reflect.defineProperty(object, 'hello', { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.set(object, 0, 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, symbol, { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - - var object = []; - shouldBe(Reflect.defineProperty(object, 'hello', { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), false); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.set(object, 0, 42), false); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, symbol, { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), false); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - - receiverTest([], []); - receiverTest({}, []); - receiverTest([], {}); - receiverTestIndexed([], []); - receiverTestIndexed({}, []); - receiverTestIndexed([], {}); - - var array = [0, 1, 2, 3]; - var receiver = {}; - shouldBe(Reflect.set(array, 'length', 'V', receiver), true); - shouldBe(Reflect.get(receiver, 'length'), 'V'); - shouldBe(receiver.hasOwnProperty('length'), true); - shouldBe(Reflect.get(array, 'length'), 4); - Object.freeze(array); - var receiver = {}; - shouldBe(Reflect.set(array, 'length', 'V', receiver), false); - shouldBe(Reflect.get(receiver, 'length'), undefined); - shouldBe(receiver.hasOwnProperty('length'), false); - shouldBe(Reflect.get(array, 'length'), 4); -}()); - -(function arrayBufferCase() { - 'use strict'; - var object = new ArrayBuffer(64); - shouldBe(Reflect.get(object, 'hello'), undefined); - shouldBe(Reflect.set(object, 'hello', 42), true); - shouldBe(Reflect.get(object, 'hello'), 42); - shouldBe(Reflect.get(object, 0), undefined); - shouldBe(Reflect.set(object, 0, 42), true); - shouldBe(Reflect.get(object, 0), 42); - shouldBe(Reflect.get(object, symbol), undefined); - shouldBe(Reflect.set(object, symbol, 42), true); - shouldBe(Reflect.get(object, symbol), 42); - object[1000000] = 'Hello'; - shouldBe(Reflect.set(object, 0, 50), true); - shouldBe(Reflect.get(object, 0), 50); - - var object = new ArrayBuffer(64); - shouldBe(Reflect.defineProperty(object, 'hello', { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), false); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.set(object, 0, 42), false); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(object.length, undefined); - shouldBe(Reflect.defineProperty(object, symbol, { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), false); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - - var object = new ArrayBuffer(64); - shouldBe(Reflect.get(object, 'byteLength'), 64); - shouldBe(Reflect.set(object, 'byteLength', 'Cappuccino'), false); - shouldBe(Reflect.get(object, 'byteLength'), 64); - - var object = new ArrayBuffer(64); - shouldBe(Reflect.get(object, 'byteLength'), 64); - shouldBe(Reflect.set(object, 'byteLength', 2000), false); - shouldBe(Reflect.get(object, 'byteLength'), 64); - - var object = new ArrayBuffer(64); - shouldBe(Reflect.defineProperty(object, 'byteLength', { - writable: false - }), true); - shouldBe(Reflect.get(object, 'byteLength'), undefined); - shouldBe(Reflect.set(object, 'byteLength', 20), false); - shouldBe(Reflect.get(object, 'byteLength'), undefined); - - var object = new ArrayBuffer(64); - shouldBe(Reflect.defineProperty(object, 'hello', { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.set(object, 0, 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, symbol, { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - - var object = new ArrayBuffer(64); - shouldBe(Reflect.defineProperty(object, 'hello', { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), false); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.set(object, 0, 42), false); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, symbol, { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), false); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - - receiverTest(new ArrayBuffer(64), new ArrayBuffer(64)); - receiverTest({}, new ArrayBuffer(64)); - receiverTest(new ArrayBuffer(64), {}); - receiverTestIndexed(new ArrayBuffer(64), new ArrayBuffer(64)); - receiverTestIndexed({}, new ArrayBuffer(64)); - receiverTestIndexed(new ArrayBuffer(64), {}); -}()); - -[ - [ Uint8Array, 1 ], - [ Uint8ClampedArray, 1], - [ Uint16Array, 2 ], - [ Uint32Array, 4 ], - [ Int8Array, 1 ], - [ Int16Array, 2 ], - [ Int32Array, 4 ], - [ Float32Array, 4 ], - [ Float64Array, 8 ], -].forEach((function() { - 'use strict'; - return function typedArrayCase([ TypedArray, bytesPerElement ]) { - var object = new TypedArray(64); - shouldBe(Reflect.get(object, 'hello'), undefined); - shouldBe(Reflect.set(object, 'hello', 42), true); - shouldBe(Reflect.get(object, 'hello'), 42); - shouldBe(Reflect.get(object, 0), 0); - shouldBe(Reflect.set(object, 0, 42), true); - shouldBe(Reflect.get(object, 0), 42); - shouldBe(Reflect.get(object, symbol), undefined); - shouldBe(Reflect.set(object, symbol, 42), true); - shouldBe(Reflect.get(object, symbol), 42); - object[1000000] = 'Hello'; - shouldBe(Reflect.set(object, 0, 50), true); - shouldBe(Reflect.get(object, 0), 50); - - var object = new TypedArray(64); - shouldBe(Reflect.defineProperty(object, 'hello', { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), false); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - value: 'Cocoa', - writable: false - }), false); - shouldBe(Reflect.get(object, 0), 0); - shouldBe(Reflect.set(object, 0, 42), true); - shouldBe(Reflect.get(object, 0), 42); - shouldBe(object.length, 64); - shouldBe(Reflect.defineProperty(object, symbol, { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), false); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - - var object = new TypedArray(64); - shouldBe(Reflect.get(object, 'byteLength'), bytesPerElement * 64); - shouldBe(Reflect.set(object, 'byteLength', 'Cappuccino'), false); - shouldBe(Reflect.get(object, 'byteLength'), bytesPerElement * 64); - - var object = new TypedArray(64); - shouldBe(Reflect.get(object, 'byteLength'), bytesPerElement * 64); - shouldBe(Reflect.set(object, 'byteLength', 2000), false); - shouldBe(Reflect.get(object, 'byteLength'), bytesPerElement * 64); - - var object = new TypedArray(64); - shouldBe(Reflect.defineProperty(object, 'hello', { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - get() { - return 'Cocoa'; - }, - set() { - } - }), false); - shouldBe(Reflect.get(object, 0), 0); - shouldBe(Reflect.set(object, 0, 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, 0), 42); - shouldBe(Reflect.defineProperty(object, symbol, { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - - var object = new TypedArray(64); - shouldBe(Reflect.defineProperty(object, 'hello', { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), false); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - get() { - return 'Cocoa'; - } - }), false); - shouldBe(Reflect.get(object, 0), 0); - shouldBe(Reflect.set(object, 0, 42), true); - shouldBe(Reflect.get(object, 0), 42); - shouldBe(Reflect.defineProperty(object, symbol, { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), false); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - - receiverTest(new TypedArray(64), new TypedArray(64)); - receiverTest(new TypedArray(64), {}); - receiverTest({}, new TypedArray(64)); - - var object = new TypedArray(64); - var receiver = {}; - // The receiver is ignored when the property name is an indexed one. - // shouldBe(Reflect.set(object, 0, 42, receiver), true); - shouldBe(Reflect.set(object, 0, 42, receiver), true); - shouldBe(Reflect.get(object, 0), 42); - shouldBe(receiver.hasOwnProperty(0), false); - }; -})()); - - -(function argumentCase() { - function test1() { - var object = arguments; - shouldBe(Reflect.get(object, 'hello'), undefined); - shouldBe(Reflect.set(object, 'hello', 42), true); - shouldBe(Reflect.get(object, 'hello'), 42); - shouldBe(Reflect.get(object, 0), undefined); - shouldBe(Reflect.set(object, 0, 42), true); - shouldBe(Reflect.get(object, 0), 42); - shouldBe(Reflect.get(object, symbol), undefined); - shouldBe(Reflect.set(object, symbol, 42), true); - shouldBe(Reflect.get(object, symbol), 42); - } - - function test2() { - var object = arguments; - shouldBe(Reflect.defineProperty(object, 'hello', { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), false); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.set(object, 0, 42), false); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(object.length, 0); - shouldBe(Reflect.defineProperty(object, symbol, { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), false); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - } - - function test3() { - var object = arguments; - shouldBe(Reflect.get(object, 'length'), 0); - Reflect.set(object, 'length', 'Cappuccino'); - shouldBe(Reflect.get(object, 'length'), 'Cappuccino'); - - Reflect.set(object, 'callee', 'Cappuccino'); - shouldBe(Reflect.get(object, 'callee'), 'Cappuccino'); - } - - function test4() { - var object = arguments; - shouldBe(Reflect.defineProperty(object, 'hello', { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.set(object, 0, 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, symbol, { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - } - - function test5() { - var object = arguments; - shouldBe(Reflect.defineProperty(object, 'hello', { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), false); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.set(object, 0, 42), false); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, symbol, { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), false); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - } - - test1(); - test2(); - test3(); - test4(); - test5(); - - function getArguments() { return arguments; } - - receiverTest(getArguments(), getArguments()); - receiverTest({}, getArguments()); - receiverTest(getArguments(), {}); - receiverTestIndexed(getArguments(), getArguments()); - receiverTestIndexed({}, getArguments()); - receiverTestIndexed(getArguments(), {}); - - var args = getArguments(0, 1, 2); - var receiver = {}; - shouldBe(Reflect.set(args, 0, 'V', receiver), true); - shouldBe(Reflect.get(receiver, 0), 'V'); - shouldBe(Reflect.set(args, 'length', 'V', receiver), true); - shouldBe(Reflect.get(receiver, 'length'), 'V'); -}()); - -(function argumentStrictCase() { - 'use strict'; - function test1() { - var object = arguments; - shouldBe(Reflect.get(object, 'hello'), undefined); - shouldBe(Reflect.set(object, 'hello', 42), true); - shouldBe(Reflect.get(object, 'hello'), 42); - shouldBe(Reflect.get(object, 0), undefined); - shouldBe(Reflect.set(object, 0, 42), true); - shouldBe(Reflect.get(object, 0), 42); - shouldBe(Reflect.get(object, symbol), undefined); - shouldBe(Reflect.set(object, symbol, 42), true); - shouldBe(Reflect.get(object, symbol), 42); - } - - function test2() { - var object = arguments; - shouldBe(Reflect.defineProperty(object, 'hello', { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), false); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.set(object, 0, 42), false); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(object.length, 0); - shouldBe(Reflect.defineProperty(object, symbol, { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), false); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - } - - function test3() { - var object = arguments; - shouldBe(Reflect.get(object, 'length'), 0); - Reflect.set(object, 'length', 'Cappuccino'); - shouldBe(Reflect.get(object, 'length'), 'Cappuccino'); - - shouldThrow(() => { - Reflect.set(object, 'callee', 'Cappuccino'); - }, `TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context.`); - shouldThrow(() => { - Reflect.get(object, 'callee'); - }, `TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context.`); - } - - function test4() { - var object = arguments; - shouldBe(Reflect.defineProperty(object, 'hello', { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.set(object, 0, 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, symbol, { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - } - - function test5() { - var object = arguments; - shouldBe(Reflect.defineProperty(object, 'hello', { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), false); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.set(object, 0, 42), false); - shouldBe(Reflect.get(object, 0), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, symbol, { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), false); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - } - - test1(); - test2(); - test3(); - test4(); - test5(); - - function getArguments() { return arguments; } - - receiverTest(getArguments(), getArguments()); - receiverTest({}, getArguments()); - receiverTest(getArguments(), {}); - receiverTestIndexed(getArguments(), getArguments()); - receiverTestIndexed({}, getArguments()); - receiverTestIndexed(getArguments(), {}); - - var args = getArguments(0, 1, 2); - var receiver = {}; - shouldBe(Reflect.set(args, 0, 'V', receiver), true); - shouldBe(Reflect.get(receiver, 0), 'V'); - shouldBe(Reflect.set(args, 'length', 'V', receiver), true); - shouldBe(Reflect.get(receiver, 'length'), 'V'); -}()); - -(function stringObjectCase() { - 'use strict'; - var object = new String('Cocoa'); - shouldBe(Reflect.get(object, 'hello'), undefined); - shouldBe(Reflect.set(object, 'hello', 42), true); - shouldBe(Reflect.get(object, 'hello'), 42); - shouldBe(Reflect.get(object, 0), 'C'); - shouldBe(Reflect.set(object, 0, 42), false); - shouldBe(Reflect.get(object, 0), 'C'); - shouldBe(Reflect.get(object, symbol), undefined); - shouldBe(Reflect.set(object, symbol, 42), true); - shouldBe(Reflect.get(object, symbol), 42); - object[1000000] = 'Cocoa'; - shouldBe(Reflect.set(object, 0, 50), false); - shouldBe(Reflect.get(object, 0), 'C'); - - var object = new String('Cocoa'); - shouldBe(Reflect.defineProperty(object, 'hello', { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), false); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - value: 'Cocoa', - writable: false - }), false); - shouldBe(Reflect.get(object, 0), 'C'); - shouldBe(Reflect.set(object, 0, 42), false); - shouldBe(Reflect.get(object, 0), 'C'); - shouldBe(object.length, 5); - shouldBe(Reflect.defineProperty(object, symbol, { - value: 'Cocoa', - writable: false - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), false); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - - // Length. - var object = new String('Cocoa'); - shouldBe(Reflect.get(object, 'length'), 5); - shouldBe(Reflect.set(object, 'length', 'Cappuccino'), false); - shouldBe(Reflect.get(object, 'length'), 5); - - var object = new String('Cocoa'); - shouldBe(Reflect.get(object, 'length'), 5); - shouldBe(Reflect.set(object, 'length', 20), false); - shouldBe(Reflect.get(object, 'length'), 5); - - var object = new String('Cocoa'); - Object.freeze(object); - shouldBe(Reflect.get(object, 'length'), 5); - shouldBe(Reflect.set(object, 'length', 20), false); - shouldBe(Reflect.get(object, 'length'), 5); - - var object = new String('Cocoa'); - shouldBe(Reflect.defineProperty(object, 'hello', { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - get() { - return 'Cocoa'; - }, - set() { - } - }), false); - shouldBe(Reflect.get(object, 0), 'C'); - shouldBe(Reflect.set(object, 0, 42), false); // Return true since the setter exists. - shouldBe(Reflect.get(object, 0), 'C'); - shouldBe(Reflect.defineProperty(object, symbol, { - get() { - return 'Cocoa'; - }, - set() { - } - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), true); // Return true since the setter exists. - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - - var object = new String('Cocoa'); - shouldBe(Reflect.defineProperty(object, 'hello', { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.set(object, 'hello', 42), false); - shouldBe(Reflect.get(object, 'hello'), 'Cocoa'); - shouldBe(Reflect.defineProperty(object, 0, { - get() { - return 'Cocoa'; - } - }), false); - shouldBe(Reflect.get(object, 0), 'C'); - shouldBe(Reflect.set(object, 0, 42), false); - shouldBe(Reflect.get(object, 0), 'C'); - shouldBe(Reflect.defineProperty(object, symbol, { - get() { - return 'Cocoa'; - } - }), true); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - shouldBe(Reflect.set(object, symbol, 42), false); - shouldBe(Reflect.get(object, symbol), 'Cocoa'); - - receiverTest(new String('Hello'), new String('World')); - receiverTest({}, new String('World')); - receiverTest(new String('Hello'), {}); - // Tested indice should be out of range of the string object. - receiverTestIndexed(new String('Hello'), new String('World')); - receiverTestIndexed({}, new String('World')); - receiverTestIndexed(new String('Hello'), {}); - - var string = new String('Hello'); - var receiver = {}; - shouldBe(Reflect.set(string, 0, 'V', receiver), false); - shouldBe(Reflect.get(receiver, 0), undefined); - shouldBe(receiver.hasOwnProperty(0), false); - shouldBe(Reflect.set(string, 'length', 'V', receiver), false); - shouldBe(Reflect.get(receiver, 'length'), undefined); - shouldBe(receiver.hasOwnProperty('length'), false); -}()); - -(function regExpCase() { - receiverTest(/hello/, /world/); - receiverTest({}, /world/); - receiverTest(/hello/, {}); - receiverTestIndexed(/hello/, /world/); - receiverTestIndexed({}, /world/); - receiverTestIndexed(/hello/, {}); -}()); - -(function customValue() { - // In this case, RegExp.multiline behaves like a setter because it coerce boolean type. - // Anyway, it's OK, because RegExp.multiline is not specified in the spec. - - function test1() { - shouldBe(Reflect.set(RegExp, 'multiline', 'Cappuccino'), true); - shouldBe(Reflect.get(RegExp, 'multiline'), true); - shouldBe(Reflect.set(RegExp, 'multiline', 0), true); - shouldBe(Reflect.get(RegExp, 'multiline'), false); - - var receiver = {}; - shouldBe(Reflect.set(RegExp, 'multiline', 'Cappuccino', receiver), true); - shouldBe(Reflect.get(receiver, 'multiline'), 'Cappuccino'); - shouldBe(Reflect.get(RegExp, 'multiline'), false); - } - - function test2() { - 'use strict'; - shouldBe(Reflect.set(RegExp, 'multiline', 'Cappuccino'), true); - shouldBe(Reflect.get(RegExp, 'multiline'), true); - shouldBe(Reflect.set(RegExp, 'multiline', 0), true); - shouldBe(Reflect.get(RegExp, 'multiline'), false); - - var receiver = {}; - shouldBe(Reflect.set(RegExp, 'multiline', 'Cappuccino', receiver), true); - shouldBe(Reflect.get(receiver, 'multiline'), 'Cappuccino'); - shouldBe(Reflect.get(RegExp, 'multiline'), false); - } - - function test3() { - 'use strict'; - shouldBe(Reflect.defineProperty(RegExp, 'multiline', { - writable: false - }), true); - shouldBe(Reflect.get(RegExp, 'multiline'), false); - shouldBe(Reflect.set(RegExp, 'multiline', 'Cappuccino'), false); - shouldBe(Reflect.get(RegExp, 'multiline'), false); - shouldBe(Reflect.set(RegExp, 'multiline', 0), false); - shouldBe(Reflect.get(RegExp, 'multiline'), false); - - var receiver = {}; - shouldBe(Reflect.set(RegExp, 'multiline', 'Cappuccino', receiver), false); - shouldBe(Reflect.get(receiver, 'multiline'), undefined); - } - - test1(); - test2(); - test3(); -}()); - -(function regExpLastIndex() { - var regexp = new RegExp('Cocoa'); - regexp.lastIndex = 'Hello'; - shouldBe(Reflect.get(regexp, 'lastIndex'), 'Hello'); - regexp.lastIndex = 42; - shouldBe(Reflect.get(regexp, 'lastIndex'), 42); - - shouldBe(Reflect.set(regexp, 'lastIndex', 'Hello'), true); - shouldBe(Reflect.get(regexp, 'lastIndex'), 'Hello'); - - var receiver = {}; - shouldBe(Reflect.set(regexp, 'lastIndex', 'Cocoa', receiver), true); - shouldBe(Reflect.get(receiver, 'lastIndex'), 'Cocoa'); - shouldBe(Reflect.get(regexp, 'lastIndex'), 'Hello'); - - shouldBe(Reflect.defineProperty(regexp, 'lastIndex', { - value: 42, - writable: false - }), true); - shouldBe(Reflect.get(regexp, 'lastIndex'), 42); - shouldBe(Reflect.set(regexp, 'lastIndex', 'Hello'), false); - shouldBe(Reflect.get(regexp, 'lastIndex'), 42); - - var receiver = {}; - shouldBe(Reflect.set(regexp, 'lastIndex', 'Cocoa', receiver), false); - shouldBe(Reflect.get(receiver, 'lastIndex'), undefined); - shouldBe(Reflect.get(regexp, 'lastIndex'), 42); - - shouldThrow(function () { - 'use strict'; - regexp.lastIndex = 'NG'; - }, `TypeError: Attempted to assign to readonly property.`); -}()); - -(function functionCase() { - var func = function () { }; - shouldBe(Reflect.get(func, 'arguments'), null); - shouldBe(Reflect.set(func, 'arguments', 42), false); - shouldBe(Reflect.get(func, 'arguments'), null); - - shouldBe(Reflect.get(func, 'caller'), null); - shouldBe(Reflect.set(func, 'caller', 42), false); - shouldBe(Reflect.get(func, 'caller'), null); - - receiverTest(function () {}, function () {}); - receiverTest({}, function () {}); - receiverTest(function () {}, {}); - receiverTestIndexed(function () {}, function () {}); - receiverTestIndexed({}, function () {}); - receiverTestIndexed(function () {}, {}); - - var receiver = {}; - shouldBe(Reflect.set(func, 'arguments', 'V', receiver), false); - shouldBe(Reflect.get(receiver, 'arguments'), undefined); - shouldBe(receiver.hasOwnProperty('arguments'), false); - shouldBe(Reflect.get(func, 'arguments'), null); - shouldBe(Reflect.set(func, 'caller', 'V', receiver), false); - shouldBe(Reflect.get(receiver, 'caller'), undefined); - shouldBe(receiver.hasOwnProperty('caller'), false); - shouldBe(Reflect.get(func, 'caller'), null); -}()); diff --git a/implementation-contributed/javascriptcore/stress/reflect.js b/implementation-contributed/javascriptcore/stress/reflect.js deleted file mode 100644 index 1f14ea00c7..0000000000 --- a/implementation-contributed/javascriptcore/stress/reflect.js +++ /dev/null @@ -1,9 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -shouldBe(typeof Reflect, "object"); -shouldBe(Reflect, Reflect); -shouldBe(Object.getPrototypeOf(Reflect), Object.getPrototypeOf({})); -shouldBe(Reflect.toString(), "[object Object]"); diff --git a/implementation-contributed/javascriptcore/stress/regexp-exec-effect-after-exception.js b/implementation-contributed/javascriptcore/stress/regexp-exec-effect-after-exception.js deleted file mode 100644 index a737429137..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-exec-effect-after-exception.js +++ /dev/null @@ -1,26 +0,0 @@ -function foo(s) { - return /.*/.exec(s); -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) - foo("foo bar"); - -RegExp.input = "blah"; - -var didFinish = false; -try { - foo({toString: function() { - throw "error"; - }}); - didFinish = true; -} catch (e) { - if (e != "error") - throw "Error: bad exception at end: " + e; - if (RegExp.input != "blah") - throw "Error: bad value of input: " + RegExp.input; -} - -if (didFinish) - throw "Error: did not throw exception."; diff --git a/implementation-contributed/javascriptcore/stress/regexp-exec-test-effectful-last-index.js b/implementation-contributed/javascriptcore/stress/regexp-exec-test-effectful-last-index.js deleted file mode 100644 index ef68e559c4..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-exec-test-effectful-last-index.js +++ /dev/null @@ -1,50 +0,0 @@ -function assert(b) { - if (!b) - throw new Error; -} - -let outer = 42; - -function foo(r, s) { - let y = outer; - r.test(s); - return y + outer; -} -noInline(foo); - -for (let i = 0; i < 10000; ++i) { - let r = /foo/g; - regexLastIndex = {}; - regexLastIndex.toString = function() { - outer = 1; - return "1"; - }; - - r.lastIndex = regexLastIndex; - let result = foo(r, "bar"); - assert(result === 43); - - outer = 42; -} - -function bar(r, s) { - let y = outer; - r.exec(s); - return y + outer; -} -noInline(bar); - -for (let i = 0; i < 10000; ++i) { - let r = /foo/g; - regexLastIndex = {}; - regexLastIndex.toString = function() { - outer = 1; - return "1"; - }; - - r.lastIndex = regexLastIndex; - let result = bar(r, "bar"); - assert(result === 43); - - outer = 42; -} diff --git a/implementation-contributed/javascriptcore/stress/regexp-large-quantifier.js b/implementation-contributed/javascriptcore/stress/regexp-large-quantifier.js deleted file mode 100644 index 7c259f4bf2..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-large-quantifier.js +++ /dev/null @@ -1,16 +0,0 @@ -function testRegExp(pattern, string, expectedMatch) { - const r = new RegExp(pattern); - const actualResult = r.exec(string); - if (expectedMatch === undefined) { - if (actualResult !== null) - throw("Expected " + r + ".exec(\"" + string + "\") to be null"); - } else { - if (actualResult === null || actualResult[0] !== expectedMatch) - throw("Expected " + r + ".exec(\"" + string + "\")[0] to be " + expectedMatch + "."); - } -} - -testRegExp("a{0,4294967295}", "a", "a"); -testRegExp("a{0,4294967296}", "a", "a"); -testRegExp("^a{0,4294967296}$", "a{0,4294967296}", undefined); -testRegExp("(?:a{0,340282366920}?){0,1}a", "aa", "aa"); diff --git a/implementation-contributed/javascriptcore/stress/regexp-last-index-sinking.js b/implementation-contributed/javascriptcore/stress/regexp-last-index-sinking.js deleted file mode 100644 index 521fa8ea60..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-last-index-sinking.js +++ /dev/null @@ -1,23 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test(num) -{ - var regexp = /regexp/; - if (num & 1) - regexp.lastIndex = 42; - else - regexp.lastIndex = 2; - return regexp.lastIndex; -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) { - if (i & 1) - shouldBe(test(i), 42); - else - shouldBe(test(i), 2); -} diff --git a/implementation-contributed/javascriptcore/stress/regexp-last-index-writable.js b/implementation-contributed/javascriptcore/stress/regexp-last-index-writable.js deleted file mode 100644 index f6808b8f5b..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-last-index-writable.js +++ /dev/null @@ -1,52 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -(function regExpLastIndex() { - var regexp = new RegExp('Cocoa'); - regexp.lastIndex = 'Hello'; - shouldBe(Reflect.get(regexp, 'lastIndex'), 'Hello'); - regexp.lastIndex = 42; - shouldBe(Reflect.get(regexp, 'lastIndex'), 42); - - regexp.lastIndex = "Hello"; - shouldBe(Reflect.get(regexp, 'lastIndex'), 'Hello'); - - shouldBe(Reflect.defineProperty(regexp, 'lastIndex', { - value: 42, - writable: false - }), true); - shouldBe(Reflect.get(regexp, 'lastIndex'), 42); - shouldThrow(function () { - 'use strict'; - regexp.lastIndex = 'NG'; - }, `TypeError: Attempted to assign to readonly property.`); - shouldBe(Reflect.get(regexp, 'lastIndex'), 42); - - shouldThrow(function () { - 'use strict'; - regexp.lastIndex = "NG"; - }, `TypeError: Attempted to assign to readonly property.`); - - shouldThrow(function () { - 'use strict'; - Object.defineProperty(regexp, 'lastIndex', { - value: 'NG' - }); - }, `TypeError: Attempting to change value of a readonly property.`); - shouldBe(Reflect.get(regexp, 'lastIndex'), 42); -}()); diff --git a/implementation-contributed/javascriptcore/stress/regexp-match-in-other-realm-should-work.js b/implementation-contributed/javascriptcore/stress/regexp-match-in-other-realm-should-work.js deleted file mode 100644 index 3a9c8e8e6d..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-match-in-other-realm-should-work.js +++ /dev/null @@ -1,10 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -var regexp = /Hello/; -var string = "Hello"; -var otherRealm = createGlobalObject(); -shouldBe(otherRealm.RegExp.prototype[Symbol.match].call(regexp, string)[0], string) - diff --git a/implementation-contributed/javascriptcore/stress/regexp-match-proxy.js b/implementation-contributed/javascriptcore/stress/regexp-match-proxy.js deleted file mode 100644 index 24dc4ef6e4..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-match-proxy.js +++ /dev/null @@ -1,166 +0,0 @@ -function assert(assertion) { - if (typeof assertion != "string") - throw new Error("Invalid assertion."); - - let result = eval(assertion); - - if (!result) - throw new Error("Bad assertion: " + assertion); -} - -let get = []; -let set = []; -let getSet = []; - -function resetTracking() -{ - get = []; - set = []; - getSet = []; -} - -let getProxyNullExec = new Proxy({ - exec: function() - { - return null; - } - }, { - get: function(o, k) - { - get.push(k); return o[k]; - } - }); - -resetTracking(); -RegExp.prototype[Symbol.match].call(getProxyNullExec); -assert('get == "global,exec"'); - -let getSetProxyNullExec = new Proxy( - { - exec: function() - { - return null; - } - }, { - get: function(o, k) - { - get.push(k); - getSet.push(k); - return o[k]; - }, - set: function(o, k, v) - { - set.push(k); - getSet.push(k); - o[k] = v; - } - }); - -getSetProxyNullExec.global = true; - -resetTracking(); -RegExp.prototype[Symbol.match].call(getSetProxyNullExec); -assert('get == "global,unicode,exec"'); -assert('set == "lastIndex"'); -assert('getSet == "global,unicode,lastIndex,exec"'); - -let regExpGlobal_s = new RegExp("s", "g"); -let getSetProxyMatches_s = new Proxy( - { - exec: function(string) - { - return regExpGlobal_s.exec(string); - } - }, { - get: function(o, k) - { - get.push(k); - getSet.push(k); - return o[k]; - }, - set: function(o, k, v) - { - set.push(k); - getSet.push(k); - o[k] = v; - } - }); - -getSetProxyMatches_s.global = true; -resetTracking(); -let matchResult = RegExp.prototype[Symbol.match].call(getSetProxyMatches_s, "This is a test"); -assert('matchResult == "s,s,s"'); -assert('get == "global,unicode,exec,exec,exec,exec"'); -assert('set == "lastIndex"'); -assert('getSet == "global,unicode,lastIndex,exec,exec,exec,exec"'); - -let regExpGlobal_tx_Greedy = new RegExp("[tx]*", "g"); -let getSetProxyMatches_tx_Greedy = new Proxy( - { - exec: function(string) - { - return regExpGlobal_tx_Greedy.exec(string); - } - }, { - get: function(o, k) - { - get.push(k); - getSet.push(k); - if (k.toString() == "lastIndex") - return regExpGlobal_tx_Greedy.lastIndex; - return o[k]; - }, - set: function(o, k, v) - { - set.push(k); - getSet.push(k); - if (k.toString() == "lastIndex") - regExpGlobal_tx_Greedy.lastIndex = v; - o[k] = v; - } - }); - -getSetProxyMatches_tx_Greedy.global = true; - -resetTracking(); -matchResult = RegExp.prototype[Symbol.match].call(getSetProxyMatches_tx_Greedy, "testing"); -assert('matchResult == "t,,,t,,,,"'); -assert('get == "global,unicode,exec,exec,lastIndex,exec,lastIndex,exec,exec,lastIndex,exec,lastIndex,exec,lastIndex,exec,lastIndex,exec"'); -assert('set == "lastIndex,lastIndex,lastIndex,lastIndex,lastIndex,lastIndex,lastIndex"'); -assert('getSet == "global,unicode,lastIndex,exec,exec,lastIndex,lastIndex,exec,lastIndex,lastIndex,exec,exec,lastIndex,lastIndex,exec,lastIndex,lastIndex,exec,lastIndex,lastIndex,exec,lastIndex,lastIndex,exec"'); - -let regExpGlobalUnicode_digit_nonGreedy = new RegExp("\\d{0,1}", "gu"); -let getSetProxyMatchesUnicode_digit_nonGreedy = new Proxy( - { - exec: function(string) - { - return regExpGlobalUnicode_digit_nonGreedy.exec(string); - } - }, { - get: function(o, k) - { - get.push(k); - getSet.push(k); - if (k.toString() == "lastIndex") - return regExpGlobalUnicode_digit_nonGreedy.lastIndex; - return o[k]; - }, - set: function(o, k, v) - { - set.push(k); - getSet.push(k); - if (k.toString() == "lastIndex") - regExpGlobalUnicode_digit_nonGreedy.lastIndex = v; - o[k] = v; - } - }); - -getSetProxyMatchesUnicode_digit_nonGreedy.global = true; -getSetProxyMatchesUnicode_digit_nonGreedy.unicode = true; - -resetTracking(); -matchResult = RegExp.prototype[Symbol.match].call(getSetProxyMatchesUnicode_digit_nonGreedy, "12X3\u{10400}4"); -assert('matchResult == "1,2,,3,,4,"'); -assert('get == "global,unicode,exec,exec,exec,lastIndex,exec,exec,lastIndex,exec,exec,lastIndex,exec"'); -assert('set == "lastIndex,lastIndex,lastIndex,lastIndex"'); -assert('getSet == "global,unicode,lastIndex,exec,exec,exec,lastIndex,lastIndex,exec,exec,lastIndex,lastIndex,exec,exec,lastIndex,lastIndex,exec"'); diff --git a/implementation-contributed/javascriptcore/stress/regexp-match-should-work-with-objects-not-inheriting-object-prototype.js b/implementation-contributed/javascriptcore/stress/regexp-match-should-work-with-objects-not-inheriting-object-prototype.js deleted file mode 100644 index a0476234d4..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-match-should-work-with-objects-not-inheriting-object-prototype.js +++ /dev/null @@ -1,11 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} -var regexp = Object.create(null); -regexp.reg = /Hello/; -regexp.exec = function (value) { - return regexp.reg.exec(value); -}; -var string = "Hello"; -shouldBe(RegExp.prototype[Symbol.match].call(regexp, string)[0], string) diff --git a/implementation-contributed/javascriptcore/stress/regexp-match.js b/implementation-contributed/javascriptcore/stress/regexp-match.js deleted file mode 100644 index 59dcb3e269..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-match.js +++ /dev/null @@ -1,102 +0,0 @@ - -function shouldBe(actual, expected) { - if (actual !== expected && !(actual !== null && typeof(expected) === "string" && actual.toString() == expected)) - throw new Error('expected: ' + expected + ', bad value: ' + actual); -} - -function shouldThrow(func, expected) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error('not thrown'); - shouldBe(String(error), expected); -} - -var errorKey = { - toString() { - throw new Error('out'); - } -}; -var string = 'Cocoa, Cappuccino, Rize, Matcha, Kilimanjaro'; - -shouldThrow(function () { - String.prototype.match.call(null, /Cocoa/); -}, "TypeError: String.prototype.match requires that |this| not be null or undefined"); - -shouldThrow(function () { - String.prototype.match.call(undefined, /Cocoa/); -}, "TypeError: String.prototype.match requires that |this| not be null or undefined"); - -shouldThrow(function () { - string.match(errorKey); -}, "Error: out"); - -shouldBe('Cocoa'.match(/Cocoa/), "Cocoa"); - -shouldBe(string.match(/Rize/), "Rize"); -shouldBe(string.match('Rize'), "Rize"); -shouldBe(string.match(/Matcha/), "Matcha"); -shouldBe(string.match('Matcha'), "Matcha"); - -shouldBe(' undefined'.match(), ""); -shouldBe(' undefined'.match('undefined'), "undefined"); - -shouldBe((/Cocoa/)[Symbol.match]('Cocoa'), "Cocoa"); - -var primitives = [ - '', - 'string', - 42, - Symbol('Cocoa'), -]; - -for (var primitive of primitives) { - shouldThrow(function () { - RegExp.prototype[Symbol.match].call(primitive) - }, 'TypeError: RegExp.prototype.@@match requires that |this| be an Object'); -} - -shouldThrow(function () { - /Cocoa/[Symbol.match](errorKey); -}, "Error: out"); - - -function testRegExpMatch(regexp, string, result, lastIndex) { - shouldBe(regexp[Symbol.match](string), result); - shouldBe(regexp.lastIndex, lastIndex); -} - -function testMatch(regexp, string, result, lastIndex) { - shouldBe(string.match(regexp), result); - shouldBe(regexp.lastIndex, lastIndex); -} - -function testBoth(regexp, string, result, lastIndex) { - testMatch(regexp, string, result, lastIndex); - testRegExpMatch(regexp, string, result, lastIndex); -} - -var cocoa = /Cocoa/; -cocoa.lastIndex = 20; -testBoth(cocoa, 'Cocoa', "Cocoa", 20); -testBoth(cocoa, ' Cocoa', "Cocoa", 20); -testBoth(cocoa, ' ', null, 20); - -var multibyte = /ココア/; -multibyte.lastIndex = 20; -testBoth(multibyte, 'ココア', 'ココア', 20); -testBoth(multibyte, ' Cocoa', null, 20); -testBoth(multibyte, 'カプãƒãƒ¼ãƒŽ', null, 20); - -function alwaysUnmatch(string) { - return null; -} - -var regexp = new RegExp('ココア'); -regexp[Symbol.match] = alwaysUnmatch; -shouldBe(regexp[Symbol.match], alwaysUnmatch); -testBoth(regexp, 'ココア', null, 0); diff --git a/implementation-contributed/javascriptcore/stress/regexp-matches-array-bad-time.js b/implementation-contributed/javascriptcore/stress/regexp-matches-array-bad-time.js deleted file mode 100644 index 538e6f7a12..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-matches-array-bad-time.js +++ /dev/null @@ -1,19 +0,0 @@ -(function() { - var count = 11; - - var array; - for (var i = 0; i < 10000; ++i) { - array = /foo/.exec("foo"); - if (array[0] != "foo") - throw "Error: bad result: " + array[0]; - } - - delete array[0]; - - Array.prototype.__defineSetter__("0", function(value) { count += value; }); - - array[0] = 42; - if (count != 53) - throw "Error: bad count: " + count; -})(); - diff --git a/implementation-contributed/javascriptcore/stress/regexp-matches-array-slow-put.js b/implementation-contributed/javascriptcore/stress/regexp-matches-array-slow-put.js deleted file mode 100644 index b7a1fc1e6b..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-matches-array-slow-put.js +++ /dev/null @@ -1,15 +0,0 @@ -(function() { - var count = 0; - Array.prototype.__defineSetter__("0", function(value) { count += value; }); - - for (var i = 0; i < 10000; ++i) { - var array = /foo/.exec("foo"); - if (array[0] != "foo") - throw "Error: bad result: " + array[0]; - delete array[0]; - array[0] = 42; - if (count != (i + 1) * 42) - throw "Error: bad count at i = " + i + ": " + count; - } -})(); - diff --git a/implementation-contributed/javascriptcore/stress/regexp-matches-array.js b/implementation-contributed/javascriptcore/stress/regexp-matches-array.js deleted file mode 100644 index 6ccb27aa71..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-matches-array.js +++ /dev/null @@ -1,14 +0,0 @@ -function testArrayConcat() { - var array = 'abc'.match(/(a)(b)(c)/); - var result = array.concat(); - var expectedResult = ["abc", "a", "b", "c"]; - - if (result.length != 4) - throw new Error("Runtime array length is incorrect"); - for (var i = 0; i < result.length; i++) { - if (result[i] != expectedResult[i]) - throw new Error("Runtime array concat result is incorrect"); - } -}; - -testArrayConcat(); diff --git a/implementation-contributed/javascriptcore/stress/regexp-prototype-exec-on-too-long-rope.js b/implementation-contributed/javascriptcore/stress/regexp-prototype-exec-on-too-long-rope.js deleted file mode 100644 index a999a63844..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-prototype-exec-on-too-long-rope.js +++ /dev/null @@ -1,33 +0,0 @@ -// Skip this test because it's slow and it tests a very narrow condition. -//@ skip - -function shouldEqual(actual, expected) { - if (actual != expected) { - throw "ERROR: expect " + expected + ", actual " + actual; - } -} - -s0 = ""; -s1 = "NaNxxxxx"; - -try { - for (var count = 0; count < 27; count++) { - var oldS1 = s1; - s1 += s1; - s0 = oldS1; - } -} catch (e) { } - -try { - s1 += s0; -} catch (e) { } - -var exception; -try { - /x/.exec(s1); -} catch (e) { - exception = e; -} - -shouldEqual(exception, "Error: Out of memory"); - diff --git a/implementation-contributed/javascriptcore/stress/regexp-prototype-match-on-too-long-rope.js b/implementation-contributed/javascriptcore/stress/regexp-prototype-match-on-too-long-rope.js deleted file mode 100644 index 4a4b061a90..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-prototype-match-on-too-long-rope.js +++ /dev/null @@ -1,33 +0,0 @@ -// Skip this test because it's slow and it tests a very narrow condition. -//@ skip - -function shouldEqual(actual, expected) { - if (actual != expected) { - throw "ERROR: expect " + expected + ", actual " + actual; - } -} - -s0 = ""; -s1 = "NaNxxxxx"; - -try { - for (var count = 0; count < 27; count++) { - var oldS1 = s1; - s1 += s1; - s0 = oldS1; - } -} catch (e) { } - -try { - s1 += s0; -} catch (e) { } - -var exception; -try { - /x/[Symbol.match](s1); -} catch (e) { - exception = e; -} - -shouldEqual(exception, "Error: Out of memory"); - diff --git a/implementation-contributed/javascriptcore/stress/regexp-prototype-replace-builtin-should-not-use-for-of.js b/implementation-contributed/javascriptcore/stress/regexp-prototype-replace-builtin-should-not-use-for-of.js deleted file mode 100644 index 5248f7f35a..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-prototype-replace-builtin-should-not-use-for-of.js +++ /dev/null @@ -1,6 +0,0 @@ -Array.prototype[Symbol.iterator] = function() { - throw new Error("Bad, this should not be called!"); -} - -let regexp = /(foo)/; -regexp[Symbol.replace]("foo", "bar"); diff --git a/implementation-contributed/javascriptcore/stress/regexp-prototype-test-on-too-long-rope.js b/implementation-contributed/javascriptcore/stress/regexp-prototype-test-on-too-long-rope.js deleted file mode 100644 index f3788f83f9..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-prototype-test-on-too-long-rope.js +++ /dev/null @@ -1,33 +0,0 @@ -// Skip this test because it's slow and it tests a very narrow condition. -//@ skip - -function shouldEqual(actual, expected) { - if (actual != expected) { - throw "ERROR: expect " + expected + ", actual " + actual; - } -} - -s0 = ""; -s1 = "NaNxxxxx"; - -try { - for (var count = 0; count < 27; count++) { - var oldS1 = s1; - s1 += s1; - s0 = oldS1; - } -} catch (e) { } - -try { - s1 += s0; -} catch (e) { } - -var exception; -try { - /x/.test(s1); -} catch (e) { - exception = e; -} - -shouldEqual(exception, "Error: Out of memory"); - diff --git a/implementation-contributed/javascriptcore/stress/regexp-prototype-tostring.js b/implementation-contributed/javascriptcore/stress/regexp-prototype-tostring.js deleted file mode 100644 index ae12e937cb..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-prototype-tostring.js +++ /dev/null @@ -1,90 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("bad assertion") -} -function test(f) { - for (let i = 0; i < 100; i++) - f(); -} - -test(function() { - var get = []; - var p = new Proxy({}, { get: function(o, k) { get.push(k); return o[k]; }}); - RegExp.prototype.toString.call(p); - assert(get + '' === "source,flags"); -}); - -test(function() { - let handler = { - get: function(o, propName) { - switch(propName) { - case 'source': - return "foobar"; - case 'flags': - return "whatever"; - default: - assert(false, "should not be reached"); - } - } - } - let proxy = new Proxy({}, handler); - let result = RegExp.prototype.toString.call(proxy); - assert(result === "/foobar/whatever"); -}); - -test(function() { - let handler = { - get: function(o, propName) { - switch(propName) { - case 'source': - return "hello"; - case 'flags': - return "y"; - default: - assert(false, "should not be reached"); - } - } - } - - let proxy = new Proxy({}, handler); - let result = RegExp.prototype.toString.call(proxy); - assert(result === "/hello/y"); -}); - -test(function() { - let error = null; - let obj = { - get flags() { - error = new Error; - throw error; - } - } - - let threw = false; - try { - RegExp.prototype.toString.call(obj); - } catch(e) { - assert(e === error); - threw = true; - } - assert(threw); -}); - -test(function() { - let error = null; - let obj = { - get source() { - error = new Error; - throw error; - } - } - - let threw = false; - try { - RegExp.prototype.toString.call(obj); - } catch(e) { - assert(e === error); - threw = true; - } - assert(threw); -}); diff --git a/implementation-contributed/javascriptcore/stress/regexp-replace-in-other-realm-should-work.js b/implementation-contributed/javascriptcore/stress/regexp-replace-in-other-realm-should-work.js deleted file mode 100644 index 0e8cc5db02..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-replace-in-other-realm-should-work.js +++ /dev/null @@ -1,10 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -var regexp = /Hello/; -var string = "Hello"; -var otherRealm = createGlobalObject(); -shouldBe(otherRealm.RegExp.prototype[Symbol.replace].call(regexp, string, "OK"), "OK") - diff --git a/implementation-contributed/javascriptcore/stress/regexp-replace-proxy.js b/implementation-contributed/javascriptcore/stress/regexp-replace-proxy.js deleted file mode 100644 index 8346c5ccd0..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-replace-proxy.js +++ /dev/null @@ -1,154 +0,0 @@ -function assert(assertion) { - if (typeof assertion != "string") - throw new Error("Invalid assertion."); - - let result = eval(assertion); - - if (!result) - throw new Error("Bad assertion: " + assertion); -} - -let get = []; -let getSet = []; - -function resetTracking() -{ - get = []; - getSet = []; -} - -let getProxyNullExec = new Proxy({ - exec: function() - { - return null; - } - }, { - get: function(o, k) - { - get.push(k); return o[k]; - } - }); - -resetTracking(); -RegExp.prototype[Symbol.replace].call(getProxyNullExec); -assert('get == "global,exec"'); - -let getSetProxyNullExec = new Proxy( - { - exec: function() - { - return null; - } - }, { - get: function(o, k) - { - get.push(k); - getSet.push(k); - return o[k]; - }, - set: function(o, k, v) - { - getSet.push(k); - o[k] = v; - } - }); - -getSetProxyNullExec.global = true; - -resetTracking(); -RegExp.prototype[Symbol.replace].call(getSetProxyNullExec); -assert('get == "global,unicode,exec"'); -assert('getSet == "global,unicode,lastIndex,exec"'); - -let regExpGlobal_comma = new RegExp(",", "g"); -let getSetProxyMatches_comma = new Proxy( - { - exec: function(string) - { - return regExpGlobal_comma.exec(string); - } - }, { - get: function(o, k) - { - get.push(k); - getSet.push(k); - return o[k]; - }, - set: function(o, k, v) - { - getSet.push(k); - o[k] = v; - } - }); - -getSetProxyMatches_comma.global = true; -resetTracking(); -let replaceResult = RegExp.prototype[Symbol.replace].call(getSetProxyMatches_comma, "John,,Doe,121 Main St.,Anytown", ":"); -assert('replaceResult == "John::Doe:121 Main St.:Anytown"'); -assert('get == "global,unicode,exec,exec,exec,exec,exec"'); -assert('getSet == "global,unicode,lastIndex,exec,exec,exec,exec,exec"'); - -let regExp_phoneNumber = new RegExp("(\\d{3})(\\d{3})(\\d{4})", ""); -let getSetProxyReplace_phoneNumber = new Proxy( - { - exec: function(string) - { - return regExp_phoneNumber.exec(string); - } - }, { - get: function(o, k) - { - get.push(k); - getSet.push(k); - if (k.toString() == "lastIndex") - return regExpGlobal_phoneNumber.lastIndex; - return o[k]; - }, - set: function(o, k, v) - { - getSet.push(k); - if (k.toString() == "lastIndex") - regExp_phoneNumber.lastIndex = v; - o[k] = v; - } - }); - -resetTracking(); -replaceResult = RegExp.prototype[Symbol.replace].call(getSetProxyReplace_phoneNumber, "8005551212", "$1-$2-$3"); -assert('replaceResult == "800-555-1212"'); -assert('get == "global,exec"'); -assert('getSet == "global,exec"'); - -let regExpGlobalUnicode_digit_nonGreedy = new RegExp("\\d{0,1}", "gu"); -let getSetProxyReplaceUnicode_digit_nonGreedy = new Proxy( - { - exec: function(string) - { - return regExpGlobalUnicode_digit_nonGreedy.exec(string); - } - }, { - get: function(o, k) - { - get.push(k); - getSet.push(k); - if (k.toString() == "lastIndex") - return regExpGlobalUnicode_digit_nonGreedy.lastIndex; - return o[k]; - }, - set: function(o, k, v) - { - getSet.push(k); - if (k.toString() == "lastIndex") - regExpGlobalUnicode_digit_nonGreedy.lastIndex = v; - o[k] = v; - } - }); - -getSetProxyReplaceUnicode_digit_nonGreedy.global = true; -getSetProxyReplaceUnicode_digit_nonGreedy.unicode = true; - -resetTracking(); -replaceResult = RegExp.prototype[Symbol.replace].call(getSetProxyReplaceUnicode_digit_nonGreedy, "12X3\u{10400}4", "[$&]"); -assert('replaceResult == "[1][2][]X[3][]\u{10400}[4][]"'); -assert('get == "global,unicode,exec,exec,exec,lastIndex,exec,exec,lastIndex,exec,exec,lastIndex,exec"'); -assert('getSet == "global,unicode,lastIndex,exec,exec,exec,lastIndex,lastIndex,exec,exec,lastIndex,lastIndex,exec,exec,lastIndex,lastIndex,exec"'); diff --git a/implementation-contributed/javascriptcore/stress/regexp-replace-should-work-with-objects-not-inheriting-object-prototype.js b/implementation-contributed/javascriptcore/stress/regexp-replace-should-work-with-objects-not-inheriting-object-prototype.js deleted file mode 100644 index 6a178250c1..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-replace-should-work-with-objects-not-inheriting-object-prototype.js +++ /dev/null @@ -1,11 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} -var regexp = Object.create(null); -regexp.reg = /Hello/; -regexp.exec = function (value) { - return regexp.reg.exec(value); -}; -var string = "Hello"; -shouldBe(RegExp.prototype[Symbol.replace].call(regexp, string, "OK"), "OK") diff --git a/implementation-contributed/javascriptcore/stress/regexp-search.js b/implementation-contributed/javascriptcore/stress/regexp-search.js deleted file mode 100644 index 1e2ac1a70a..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-search.js +++ /dev/null @@ -1,104 +0,0 @@ - -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, expected) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error('not thrown'); - shouldBe(String(error), expected); -} - -var errorKey = { - toString() { - throw new Error('out'); - } -}; -var string = 'Cocoa, Cappuccino, Rize, Matcha, Kilimanjaro'; - -shouldThrow(function () { - String.prototype.search.call(null, /Cocoa/); -}, "TypeError: String.prototype.search requires that |this| not be null or undefined"); - -shouldThrow(function () { - String.prototype.search.call(undefined, /Cocoa/); -}, "TypeError: String.prototype.search requires that |this| not be null or undefined"); - -shouldThrow(function () { - string.search(errorKey); -}, "Error: out"); - -shouldBe('Cocoa'.search(/Cocoa/), 0); - -shouldBe(string.search(/Rize/), 19); -shouldBe(string.search('Rize'), 19); -shouldBe(string.search(/Matcha/), 25); -shouldBe(string.search('Matcha'), 25); - -shouldBe(' undefined'.search(), 0); -shouldBe(' undefined'.search('undefined'), 4); - -shouldBe((/Cocoa/)[Symbol.search]('Cocoa'), 0); - -var primitives = [ - '', - 'string', - null, - undefined, - 42, - Symbol('Cocoa'), -]; - -for (var primitive of primitives) { - shouldThrow(function () { - RegExp.prototype[Symbol.search].call(primitive) - }, 'TypeError: RegExp.prototype.@@search requires that |this| be an Object'); -} - -shouldThrow(function () { - /Cocoa/[Symbol.search](errorKey); -}, "Error: out"); - - -function testRegExpSearch(regexp, string, result, lastIndex) { - shouldBe(regexp[Symbol.search](string), result); - shouldBe(regexp.lastIndex, lastIndex); -} - -function testSearch(regexp, string, result, lastIndex) { - shouldBe(string.search(regexp), result); - shouldBe(regexp.lastIndex, lastIndex); -} - -function testBoth(regexp, string, result, lastIndex) { - testSearch(regexp, string, result, lastIndex); - testRegExpSearch(regexp, string, result, lastIndex); -} - -var cocoa = /Cocoa/; -cocoa.lastIndex = 20; -testBoth(cocoa, 'Cocoa', 0, 20); -testBoth(cocoa, ' Cocoa', 2, 20); -testBoth(cocoa, ' ', -1, 20); - -var multibyte = /ココア/; -multibyte.lastIndex = 20; -testBoth(multibyte, 'ココア', 0, 20); -testBoth(multibyte, ' Cocoa', -1, 20); -testBoth(multibyte, 'カプãƒãƒ¼ãƒŽ', -1, 20); - -function alwaysUnmatch(string) { - return -1; -} - -var regexp = new RegExp('ココア'); -regexp[Symbol.search] = alwaysUnmatch; -shouldBe(regexp[Symbol.search], alwaysUnmatch); -testBoth(regexp, 'ココア', -1, 0); diff --git a/implementation-contributed/javascriptcore/stress/regexp-syntax-error-invalid-flags.js b/implementation-contributed/javascriptcore/stress/regexp-syntax-error-invalid-flags.js deleted file mode 100644 index a4961baecc..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-syntax-error-invalid-flags.js +++ /dev/null @@ -1,23 +0,0 @@ -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -function test() -{ - return /Hello/cocoa; -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) - shouldThrow(test, `SyntaxError: Invalid regular expression: invalid flags`); diff --git a/implementation-contributed/javascriptcore/stress/regexp-with-nonBMP-any.js b/implementation-contributed/javascriptcore/stress/regexp-with-nonBMP-any.js deleted file mode 100644 index 979936bc87..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-with-nonBMP-any.js +++ /dev/null @@ -1,10 +0,0 @@ -// This test that . followed by fixed character terms works with non-BMP characters - -if (!/^.-clef/u.test("\u{1D123}-clef")) - throw "Should have matched string with leading non-BMP with BOL anchored . in RE"; - -if (!/c.lef/u.test("c\u{1C345}lef")) - throw "Should have matched string with non-BMP with . in RE"; - - - diff --git a/implementation-contributed/javascriptcore/stress/regexp-with-runtime-syntax-errors.js b/implementation-contributed/javascriptcore/stress/regexp-with-runtime-syntax-errors.js deleted file mode 100644 index 3321a310d6..0000000000 --- a/implementation-contributed/javascriptcore/stress/regexp-with-runtime-syntax-errors.js +++ /dev/null @@ -1,66 +0,0 @@ -// This test checks that malformed regular expressions compiled at runtime throw SyntaxErrors - -function testThrowsSyntaxtError(f) -{ - try { - f(); - } catch (e) { - if (!e instanceof SyntaxError) - throw "Expected SynteaxError, but got: " + e; - } -} - -function fromExecWithBadUnicodeEscape() -{ - let baseRE = /\u{123x}/; - let line = "abc"; - - (new RegExp(baseRE, "u")).exec(line); -} - -function fromTestWithBadUnicodeProperty() -{ - let baseRE = /a|\p{Blah}/; - let line = "abc"; - - (new RegExp(baseRE, "u")).test(line); -} - -function fromSplitWithBadUnicodeIdentity() -{ - let baseRE = /,|:|\-/; - let line = "abc:def-ghi"; - - let fields = line.split(new RegExp(baseRE, "u")); -} - -function fromMatchWithBadUnicodeBackReference() -{ - let baseRE = /\123/; - let line = "xyz"; - - let fields = line.match(new RegExp(baseRE, "u")); -} - -function fromReplaceWithBadUnicodeEscape() -{ - let baseRE = /\%/; - let line = "xyz"; - - let fields = line.replace(new RegExp(baseRE, "u"), "x"); -} - -function fromSearchWithBadUnicodeEscape() -{ - let baseRE = /\=/; - let line = "xyz"; - - let fields = line.search(new RegExp(baseRE, "u")); -} - -testThrowsSyntaxtError(fromExecWithBadUnicodeEscape); -testThrowsSyntaxtError(fromTestWithBadUnicodeProperty); -testThrowsSyntaxtError(fromSplitWithBadUnicodeIdentity); -testThrowsSyntaxtError(fromMatchWithBadUnicodeBackReference); -testThrowsSyntaxtError(fromReplaceWithBadUnicodeEscape); -testThrowsSyntaxtError(fromSearchWithBadUnicodeEscape); diff --git a/implementation-contributed/javascriptcore/stress/relaxed-line-terminators-in-string.js b/implementation-contributed/javascriptcore/stress/relaxed-line-terminators-in-string.js deleted file mode 100644 index c675ac8694..0000000000 --- a/implementation-contributed/javascriptcore/stress/relaxed-line-terminators-in-string.js +++ /dev/null @@ -1,14 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -shouldBe(eval("'\u2028Japanese'").charCodeAt(0), 0x2028); -shouldBe(eval("'\u2029Japanese'").charCodeAt(0), 0x2029); -shouldBe(eval("'\u2028日本語'").charCodeAt(0), 0x2028); -shouldBe(eval("'\u2029日本語'").charCodeAt(0), 0x2029); - -shouldBe(eval("'\u2028Japanese' + 'hello' + 'world'").charCodeAt(0), 0x2028); -shouldBe(eval("'\u2029Japanese' + 'hello' + 'world'").charCodeAt(0), 0x2029); -shouldBe(eval("'\u2028日本語' + 'hello' + 'world'").charCodeAt(0), 0x2028); -shouldBe(eval("'\u2029日本語' + 'hello' + 'world'").charCodeAt(0), 0x2029); diff --git a/implementation-contributed/javascriptcore/stress/remove-phantom-after-setlocal.js b/implementation-contributed/javascriptcore/stress/remove-phantom-after-setlocal.js deleted file mode 100644 index 3b792412b3..0000000000 --- a/implementation-contributed/javascriptcore/stress/remove-phantom-after-setlocal.js +++ /dev/null @@ -1,18 +0,0 @@ -var constant = {}; - -function foo(o) { - var v = o.f; - return v === constant; -} - -noInline(foo); - -for (var i = 0; i < 1000000; ++i) { - var result = foo({f:null}); - if (result !== false) - throw "Error: bogus result in loop"; -} - -var result = foo({f:constant}); -if (result !== true) - throw "Error: bogus result at end"; diff --git a/implementation-contributed/javascriptcore/stress/repeat-put-to-scope-global-with-same-value-watchpoint-invalidate.js b/implementation-contributed/javascriptcore/stress/repeat-put-to-scope-global-with-same-value-watchpoint-invalidate.js deleted file mode 100644 index fce955b366..0000000000 --- a/implementation-contributed/javascriptcore/stress/repeat-put-to-scope-global-with-same-value-watchpoint-invalidate.js +++ /dev/null @@ -1,23 +0,0 @@ -function foo(v) { - global = v; -} - -function bar() { - return global; -} - -noInline(foo); -noInline(bar); - -var value = 42; -for (var i = 0; i < 10; ++i) - foo(value); -var n = 100000; -var m = 100; -for (var i = 0; i < n; ++i) { - if (i == n - m) - foo(value = 53); - var result = bar(); - if (result != value) - throw "Error: on iteration " + i + " got: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/repeated-arity-check-fail.js b/implementation-contributed/javascriptcore/stress/repeated-arity-check-fail.js deleted file mode 100644 index da4498e011..0000000000 --- a/implementation-contributed/javascriptcore/stress/repeated-arity-check-fail.js +++ /dev/null @@ -1,8 +0,0 @@ -function bar(a,b,c,d,e,f,g,h,i,j,k) { -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) - bar(); - diff --git a/implementation-contributed/javascriptcore/stress/repeated-put-by-id-reallocating-transition.js b/implementation-contributed/javascriptcore/stress/repeated-put-by-id-reallocating-transition.js deleted file mode 100644 index e7b8b9a0f8..0000000000 --- a/implementation-contributed/javascriptcore/stress/repeated-put-by-id-reallocating-transition.js +++ /dev/null @@ -1,87 +0,0 @@ -function foo(o) { - o.a = 0 - o.b = 1 - o.c = 2 - o.d = 3 - o.e = 4 - o.f = 5 - o.g = 6 - o.h = 7 - o.i = 8 - o.j = 9 - o.k = 10 - o.l = 11 - o.m = 12 - o.n = 13 - o.o = 14 - o.p = 15 - o.q = 16 - o.r = 17 - o.s = 18 - o.t = 19 - o.u = 20 - o.v = 21 - o.w = 22 - o.x = 23 - o.y = 24 - o.z = 25 -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var o = {}; - foo(o); - if (o.a != 0) - throw "Error: bad value for a: " + o.a; - if (o.b != 1) - throw "Error: bad value for b: " + o.b; - if (o.c != 2) - throw "Error: bad value for c: " + o.c; - if (o.d != 3) - throw "Error: bad value for d: " + o.d; - if (o.e != 4) - throw "Error: bad value for e: " + o.e; - if (o.f != 5) - throw "Error: bad value for f: " + o.f; - if (o.g != 6) - throw "Error: bad value for g: " + o.g; - if (o.h != 7) - throw "Error: bad value for h: " + o.h; - if (o.i != 8) - throw "Error: bad value for i: " + o.i; - if (o.j != 9) - throw "Error: bad value for j: " + o.j; - if (o.k != 10) - throw "Error: bad value for k: " + o.k; - if (o.l != 11) - throw "Error: bad value for l: " + o.l; - if (o.m != 12) - throw "Error: bad value for m: " + o.m; - if (o.n != 13) - throw "Error: bad value for n: " + o.n; - if (o.o != 14) - throw "Error: bad value for o: " + o.o; - if (o.p != 15) - throw "Error: bad value for p: " + o.p; - if (o.q != 16) - throw "Error: bad value for q: " + o.q; - if (o.r != 17) - throw "Error: bad value for r: " + o.r; - if (o.s != 18) - throw "Error: bad value for s: " + o.s; - if (o.t != 19) - throw "Error: bad value for t: " + o.t; - if (o.u != 20) - throw "Error: bad value for u: " + o.u; - if (o.v != 21) - throw "Error: bad value for v: " + o.v; - if (o.w != 22) - throw "Error: bad value for w: " + o.w; - if (o.x != 23) - throw "Error: bad value for x: " + o.x; - if (o.y != 24) - throw "Error: bad value for y: " + o.y; - if (o.z != 25) - throw "Error: bad value for z: " + o.z; -} diff --git a/implementation-contributed/javascriptcore/stress/replacement-watchpoint-dictionary.js b/implementation-contributed/javascriptcore/stress/replacement-watchpoint-dictionary.js deleted file mode 100644 index b3542263c3..0000000000 --- a/implementation-contributed/javascriptcore/stress/replacement-watchpoint-dictionary.js +++ /dev/null @@ -1,27 +0,0 @@ -function foo(o) { - return o.f; -} - -noInline(foo); - -var p = {f:42}; -var o = Object.create(p); - -for (var i = 0; i < 100; ++i) { - p["i" + i] = i; - for (var j = 0; j < 100; ++j) { - var result = foo(o); - if (result != 42) - throw "Error: bad result: " + result; - } -} - -// Make p a non-dictionary. -for (var i = 0; i < 100; ++i) { - var tmp = o.f; -} - -p.f = 43; -var result = foo(o); -if (result != 43) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/replacement-watchpoint.js b/implementation-contributed/javascriptcore/stress/replacement-watchpoint.js deleted file mode 100644 index d654ea776f..0000000000 --- a/implementation-contributed/javascriptcore/stress/replacement-watchpoint.js +++ /dev/null @@ -1,22 +0,0 @@ -function foo(o) { - return o.f; -} - -noInline(foo); - -var p = {f:42}; -var o = Object.create(p); - -for (var i = 0; i < 100; ++i) { - p["i" + i] = i; - for (var j = 0; j < 100; ++j) { - var result = foo(o); - if (result != 42) - throw "Error: bad result: " + result; - } -} - -p.f = 43; -var result = foo(o); -if (result != 43) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/rest-elements.js b/implementation-contributed/javascriptcore/stress/rest-elements.js deleted file mode 100644 index d8cc18bec6..0000000000 --- a/implementation-contributed/javascriptcore/stress/rest-elements.js +++ /dev/null @@ -1,193 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -(function () { - var [a, b, ...c] = "Cocoa"; - shouldBe(a, 'C'); - shouldBe(b, 'o'); - shouldBe(JSON.stringify(c), String.raw`["c","o","a"]`); -}()); - -(function () { - var [a, b, ...c] = "Co"; - shouldBe(a, 'C'); - shouldBe(b, 'o'); - shouldBe(JSON.stringify(c), String.raw`[]`); -}()); - -(function () { - var [a, b, ...c] = "C"; - shouldBe(a, 'C'); - shouldBe(b, undefined); - shouldBe(JSON.stringify(c), String.raw`[]`); -}()); - -(function () { - var a, b, c; - [a, b, ...c] = "Cocoa"; - shouldBe(a, 'C'); - shouldBe(b, 'o'); - shouldBe(JSON.stringify(c), String.raw`["c","o","a"]`); -}()); - -(function () { - var a, b, c; - [a, b, ...c] = "Co"; - shouldBe(a, 'C'); - shouldBe(b, 'o'); - shouldBe(JSON.stringify(c), String.raw`[]`); -}()); - -(function () { - var a, b, c; - [a, b, ...c] = "C"; - shouldBe(a, 'C'); - shouldBe(b, undefined); - shouldBe(JSON.stringify(c), String.raw`[]`); -}()); - -(function ([a, b, ...c]) { - shouldBe(a, 'C'); - shouldBe(b, 'o'); - shouldBe(JSON.stringify(c), String.raw`["c","o","a"]`); -}("Cocoa")); - -(function ([a, b, ...c]) { - shouldBe(a, 'C'); - shouldBe(b, 'o'); - shouldBe(JSON.stringify(c), String.raw`[]`); -}("Co")); - -(function ([a, b, ...c]) { - shouldBe(a, 'C'); - shouldBe(b, undefined); - shouldBe(JSON.stringify(c), String.raw`[]`); -}("C")); - -testSyntaxError(String.raw`var [a, ...b, c] = 20`, String.raw`SyntaxError: Unexpected token ','. Expected a closing ']' following a rest element destructuring pattern.`); -testSyntaxError(String.raw`var [a, ...b,] = 20`, String.raw`SyntaxError: Unexpected token ','. Expected a closing ']' following a rest element destructuring pattern.`); -testSyntaxError(String.raw`var [a, ...b,,] = 20`, String.raw`SyntaxError: Unexpected token ','. Expected a closing ']' following a rest element destructuring pattern.`); -testSyntaxError(String.raw`var [a, ...b = 20] = 20`, String.raw`SyntaxError: Unexpected token '='. Expected a closing ']' following a rest element destructuring pattern.`); - -testSyntaxError(String.raw`(function ([a, ...b,]) { })`, String.raw`SyntaxError: Unexpected token ','. Expected a closing ']' following a rest element destructuring pattern.`); -testSyntaxError(String.raw`(function ([a, ...b,,]) { })`, String.raw`SyntaxError: Unexpected token ','. Expected a closing ']' following a rest element destructuring pattern.`); -testSyntaxError(String.raw`(function ([a, ...b = 20,,]) { })`, String.raw`SyntaxError: Unexpected token '='. Expected a closing ']' following a rest element destructuring pattern.`); - - -testSyntaxError(String.raw`[a, ...b, c] = 20`, String.raw`SyntaxError: Unexpected token ','. Expected a closing ']' following a rest element destructuring pattern.`); -testSyntaxError(String.raw`[a, ...b,] = 20`, String.raw`SyntaxError: Unexpected token ','. Expected a closing ']' following a rest element destructuring pattern.`); -testSyntaxError(String.raw`[a, ...b,,] = 20`, String.raw`SyntaxError: Unexpected token ','. Expected a closing ']' following a rest element destructuring pattern.`); -testSyntaxError(String.raw`[a, ...b = 20] = 20`, String.raw`SyntaxError: Unexpected token '='. Expected a closing ']' following a rest element destructuring pattern.`); - -(function () { - var a, b, c; - [a, b, ...[...c]] = "Cocoa"; - shouldBe(a, 'C'); - shouldBe(b, 'o'); - shouldBe(JSON.stringify(c), String.raw`["c","o","a"]`); -}()); - -(function () { - var a, b, c, d, e, f; - [a, b, ...{ 0: c, 1: d, 2: e, 3: f }] = "Cocoa"; - shouldBe(a, 'C'); - shouldBe(b, 'o'); - shouldBe(c, 'c'); - shouldBe(d, 'o'); - shouldBe(f, undefined); -}()); - -(function () { - var a, b, c, d, e; - [a, b, ...[c, d, ...e]] = "Cocoa"; - shouldBe(a, 'C'); - shouldBe(b, 'o'); - shouldBe(c, 'c'); - shouldBe(d, 'o'); - shouldBe(JSON.stringify(e), String.raw`["a"]`); -}()); - -function iterator(array) { - var nextCount = 0; - var returnCount = 0; - var original = array.values(); - return { - [Symbol.iterator]() { - return this; - }, - - next() { - ++nextCount; - return original.next(); - }, - - return() { - ++returnCount; - return { done: true }; - }, - - reportNext() { - return nextCount; - }, - - reportReturn() { - return returnCount; - } - }; -}; - -(function () { - var iter = iterator([1, 2, 3]); - var [...a] = iter; - shouldBe(iter.reportNext(), 4); - shouldBe(iter.reportReturn(), 0); - shouldBe(JSON.stringify(a), String.raw`[1,2,3]`); -}()); - -(function () { - var iter = iterator([1, 2, 3]); - var [a, b, ...c] = iter; - shouldBe(iter.reportNext(), 4); - shouldBe(iter.reportReturn(), 0); - shouldBe(a, 1); - shouldBe(b, 2); - shouldBe(JSON.stringify(c), String.raw`[3]`); -}()); - -(function () { - var iter = iterator([1, 2, 3]); - var [a, b, c, d, ...e] = iter; - shouldBe(iter.reportNext(), 4); - shouldBe(iter.reportReturn(), 0); - shouldBe(a, 1); - shouldBe(b, 2); - shouldBe(c, 3); - shouldBe(d, undefined); - shouldBe(JSON.stringify(e), String.raw`[]`); -}()); - -(function () { - var iter = iterator([1, 2, 3]); - var a, b; - [...[a, b]] = iter; - shouldBe(iter.reportNext(), 4); - shouldBe(iter.reportReturn(), 0); - shouldBe(a, 1); - shouldBe(b, 2); -}()); diff --git a/implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints-2.js b/implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints-2.js deleted file mode 100644 index c14cac8c36..0000000000 --- a/implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints-2.js +++ /dev/null @@ -1,19 +0,0 @@ -function assert(b) { - if (!b) - throw new Error; -} -noInline(assert); - -function foo(...args) { - return args[0]; -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - // Warm it up on in bound accesses. - assert(foo(i) === i); -} - -Array.prototype[0] = 50; -for (let i = 0; i < 10000; i++) - assert(foo() === 50); diff --git a/implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints-3.js b/implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints-3.js deleted file mode 100644 index d25868744c..0000000000 --- a/implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints-3.js +++ /dev/null @@ -1,22 +0,0 @@ -function assert(b) { - if (!b) - throw new Error; -} -noInline(assert); - -function foo(...args) { - return args[0]; -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - // Warm it up on both in bound and out of bound accesses. - if (i % 2) - assert(foo(i) === i); - else - assert(foo() === undefined); -} - -Object.prototype[0] = 50; -for (let i = 0; i < 10000; i++) - assert(foo() === 50); diff --git a/implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints-4.js b/implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints-4.js deleted file mode 100644 index 4226770674..0000000000 --- a/implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints-4.js +++ /dev/null @@ -1,20 +0,0 @@ - -function assert(b) { - if (!b) - throw new Error; -} -noInline(assert); - -function foo(...args) { - return args[0]; -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - // Warm it up on in bound accesses. - assert(foo(i) === i); -} - -Object.prototype[0] = 50; -for (let i = 0; i < 10000; i++) - assert(foo() === 50); diff --git a/implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints-5.js b/implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints-5.js deleted file mode 100644 index 5449872c63..0000000000 --- a/implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints-5.js +++ /dev/null @@ -1,25 +0,0 @@ -function assert(b) { - if (!b) - throw new Error; -} -noInline(assert); - -function foo(...args) { - return args[0]; -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - // Warm it up on both in bound and out of bound accesses. - if (i % 2) - assert(foo(i) === i); - else - assert(foo() === undefined); -} - -let newProto = [50]; -newProto.__proto__ = null; - -Array.prototype.__proto__ = newProto; -for (let i = 0; i < 10000; i++) - assert(foo() === 50); diff --git a/implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints.js b/implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints.js deleted file mode 100644 index 8a70e42d4a..0000000000 --- a/implementation-contributed/javascriptcore/stress/rest-parameter-allocation-elimination-watchpoints.js +++ /dev/null @@ -1,22 +0,0 @@ -function assert(b) { - if (!b) - throw new Error; -} -noInline(assert); - -function foo(...args) { - return args[0]; -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - // Warm it up on both in bound and out of bound accesses. - if (i % 2) - assert(foo(i) === i); - else - assert(foo() === undefined); -} - -Array.prototype[0] = 50; -for (let i = 0; i < 10000; i++) - assert(foo() === 50); diff --git a/implementation-contributed/javascriptcore/stress/rest-parameter-and-default-arguments.js b/implementation-contributed/javascriptcore/stress/rest-parameter-and-default-arguments.js deleted file mode 100644 index ee1b45178e..0000000000 --- a/implementation-contributed/javascriptcore/stress/rest-parameter-and-default-arguments.js +++ /dev/null @@ -1,36 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} -noInline(assert); - -function shouldThrowTDZ(func) { - var hasThrown = false; - try { - func(); - } catch(e) { - if (e.name.indexOf("ReferenceError") !== -1) - hasThrown = true; - } - assert(hasThrown); -} -noInline(shouldThrowTDZ); - -function foo(a = function() { return c; }, b = a(), ...c) { - return a(); -} -noInline(foo); - -function baz(a = function() { return b; }, ...b) { - return a(); -} - -for (let i = 0; i < 1000; i++) { - shouldThrowTDZ(function() { foo(undefined, undefined, 10, 20); }); - let o = {x: 20}; - let result = baz(undefined, 10, o, "baz"); - assert(result.length === 3); - assert(result[0] === 10); - assert(result[1] === o); - assert(result[2] === "baz"); -} diff --git a/implementation-contributed/javascriptcore/stress/rest-parameter-basics.js b/implementation-contributed/javascriptcore/stress/rest-parameter-basics.js deleted file mode 100644 index e8f1007bc3..0000000000 --- a/implementation-contributed/javascriptcore/stress/rest-parameter-basics.js +++ /dev/null @@ -1,103 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} -noInline(assert); - -function foo(a, ...b) { - return b; -} -noInline(foo); - -function bar(a, ...b) { - return a + b[0]; -} -noInline(bar); - -function baz(a, ...b) { - function capture() { return b; } - assert(b[0] === capture()[0]); - return a + b[0]; -} -noInline(baz); - -function jaz(a, ...b) { - function capture() { return a + b[0]; } - assert(capture() === a + b[0]); - return a + b[0]; -} -noInline(jaz); - -function kaz(a = 10, ...b) { - return a + b[0] -} -noInline(kaz); - -function raz(a = 10, ...b) { - function capture() { return a + b[0]; } - assert(capture() === a + b[0]); - return a + b[0]; -} -noInline(raz); - -function restLength(a, ...b) { - return b.length; -} -noInline(restLength); - -function testArgumentsObject(...args) { - assert(args.length === arguments.length); - for (let i = 0; i < args.length; i++) - assert(args[i] === arguments[i]); -} -noInline(testArgumentsObject); - -function strictModeLikeArgumentsObject(a, ...args) { - assert(arguments[0] === a); - a = "a"; - assert(arguments[0] !== a); - assert(arguments[0] === 20); - assert(arguments.length === 2); - assert(args.length === 1); - assert(arguments[1] === args[0]); - arguments[1] = "b"; - assert(args[0] !== "b"); -} -noInline(strictModeLikeArgumentsObject); - -for (let i = 0; i < 10000; i++) { - let a1 = foo(10, 20); - assert(a1 instanceof Array); - assert(a1.length === 1); - assert(a1[0] === 20); - - let a2 = foo(10); - assert(a2 instanceof Array); - assert(a2.length === 0); - - let a3 = bar(10, 20); - assert(a3 === 30); - - let a4 = baz(10, 20); - assert(a4 === 30); - - let a5 = jaz("hello", "world"); - assert(a5 === "helloworld"); - - let a6 = kaz(undefined, 40); - assert(a6 === 50); - - let a7 = kaz(undefined, 40); - assert(a7 === 50); - - assert(restLength() === 0); - assert(restLength(1) === 0); - assert(restLength(1, 1) === 1); - assert(restLength(1, 1, 1) === 2); - assert(restLength(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) === 20); - - let obj = {foo: 40}; - testArgumentsObject("hello", obj, 100, 12.34, "world", obj, [1, 2, 3]); - - strictModeLikeArgumentsObject(20, 30); -} diff --git a/implementation-contributed/javascriptcore/stress/rest-parameter-having-a-bad-time.js b/implementation-contributed/javascriptcore/stress/rest-parameter-having-a-bad-time.js deleted file mode 100644 index cc0205b1c0..0000000000 --- a/implementation-contributed/javascriptcore/stress/rest-parameter-having-a-bad-time.js +++ /dev/null @@ -1,68 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad!") -} -noInline(assert); - -function test1() { - function foo(...c) { - return c; - } - noInline(foo); - - let arr = [1,2,3]; - for (let i = 0; i < 10000; i++) { - let result = foo(...arr); - assert(result.length === 3); - assert(result.length === arr.length); - assert(result[0] === arr[0]); - assert(result[1] === arr[1]); - assert(result[2] === arr[2]); - } - - let called = false; - Reflect.defineProperty(Array.prototype, "10", { - get() { return 35; }, - set(x) { called = true; } - }); - let called2 = false; - Reflect.defineProperty(Array.prototype, "0", { - get: function() { print("In get!"); return 35; }, - set: function(x) { called2 = true; } - }); - - for (let i = 0; i < 10000; i++) { - let result = foo(...arr); - assert(result.length === 3); - assert(result[0] === arr[0]); - assert(result[0] === 1); - assert(result[1] === arr[1]); - assert(result[2] === arr[2]); - result[10] = 25; - assert(result[10] === 35); - assert(called); - called = false; - - result[0] = "foo"; - assert(!called2); // Creating a rest should defineProperty, ensuring we don't call the setter. - } - - for (let i = 0; i < 10000; i++) { - let result = foo(...arr); - assert(result.length === 3); - assert(result[0] === arr[0]); - assert(result[0] === 1); - assert(result[1] === arr[1]); - assert(result[2] === arr[2]); - result[11] = 35; - assert(result.length === 12); - result[10] = 25; - assert(result[10] === 35); - assert(called); - called = false; - - result[0] = "foo"; - assert(!called2); // Creating a rest should defineProperty, ensuring we don't call the setter. - } -} -test1(); diff --git a/implementation-contributed/javascriptcore/stress/rest-parameter-inlined.js b/implementation-contributed/javascriptcore/stress/rest-parameter-inlined.js deleted file mode 100644 index 92f266b2f5..0000000000 --- a/implementation-contributed/javascriptcore/stress/rest-parameter-inlined.js +++ /dev/null @@ -1,38 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} -noInline(assert); - -function bar(...rest) { - return rest; -} - -function foo(a, b, c) { - return bar(a, b, c); -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - let result = foo(10, 20, 30); - assert(result.length === 3); - assert(result[0] === 10); - assert(result[1] === 20); - assert(result[2] === 30); -} - -function baz(...rest) { - return rest; -} -function jaz(a, b, c) { - return baz.apply(null, Array.prototype.slice.call(arguments)); -} -noInline(jaz); - -for (let i = 0; i < 50000; i++) { - let result = jaz(10, 20, 30); - assert(result.length === 3); - assert(result[0] === 10); - assert(result[1] === 20); - assert(result[2] === 30); -} diff --git a/implementation-contributed/javascriptcore/stress/rest-parameter-is-destructuring.js b/implementation-contributed/javascriptcore/stress/rest-parameter-is-destructuring.js deleted file mode 100644 index 4ca72ec462..0000000000 --- a/implementation-contributed/javascriptcore/stress/rest-parameter-is-destructuring.js +++ /dev/null @@ -1,88 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} -noInline(assert); - -function test(f, count = 1000) { - for (let i = 0; i < count; i++) - f(); -} - -function foo(a = function() { return c; }, ...[b = function() { return a; }, ...c]) { - assert(b()() === c); - assert(a() === c); -} - - -test(function() { - foo(undefined, undefined, {}); -}); - -function bar(a, ...{c}) { - return c; -} -test(function() { - assert(bar(10, 20, 30) === undefined); -}); - -function baz(...[{b}, {b: c}, ...d]) { - return [b, c, d]; -} -test(function() { - let o = {}; - - let result = baz({b: 20}, {b: 30}, 40, o); - assert(result.length === 3); - assert(result[0] === 20); - assert(result[1] === 30); - assert(result[2].length === 2); - assert(result[2][0] === 40); - assert(result[2][1] === o); -}); - -function jaz(...[...[...c]]) { - return c; -} -test(function() { - let result = jaz(10, 20); - assert(result.length === 2); - assert(result[0] === 10); - assert(result[1] === 20); -}); - -let raz = (a, ...[b, ...c]) => { - return [b, ...c]; -}; -test(function() { - let result = raz(10, 20, 30, 40); - assert(result.length === 3); - assert(result[0] === 20); - assert(result[1] === 30); - assert(result[2] === 40); -}); - -Array.prototype.c = 500; -test(function() { - assert(bar(10, 20, 30) === 500); -}); - -raz = (a, ...[b = function() { return c; }, ...c]) => { - return b(); -}; -test(function() { - let result = raz(undefined, undefined, 20, 30); - assert(result.length === 2); - assert(result[0] === 20); - assert(result[1] === 30); -}); - -raz = (a, ...[b = function() { return c; }, d = b(), ...c]) => { }; -test(function() { - let threw = false; - try { - raz(undefined, undefined, undefined, undefined); - } catch(e) { - threw = e instanceof ReferenceError; } - assert(threw); -}); diff --git a/implementation-contributed/javascriptcore/stress/rest-parameter-many-arguments.js b/implementation-contributed/javascriptcore/stress/rest-parameter-many-arguments.js deleted file mode 100644 index 9a2cb289c3..0000000000 --- a/implementation-contributed/javascriptcore/stress/rest-parameter-many-arguments.js +++ /dev/null @@ -1,51 +0,0 @@ -//@ if $architecture == "x86" then defaultSpotCheckNoMaximalFlush else defaultRun end - -function assert(b) { - if (!b) - throw new Error("Bad!") -} -noInline(assert); - -let calledGet = false; -let definedAccessor = false; -function test() { - function foo(...rest) { - return rest; - } - noInline(foo); - - for (let i = 0; i < 10000; i++) { - const size = 800; - let arr = new Array(size); - for (let i = 0; i < size; i++) - arr[i] = i; - let result = foo(...arr); - - assert(result.length === arr.length); - assert(result.length === size); - for (let i = 0; i < arr.length; i++) { - assert(arr[i] === result[i]); - assert(result[i] === i); - } - if (definedAccessor) { - calledGet = false; - result[0]; - assert(!calledGet); - arr[0]; - assert(calledGet); - - let testArr = [...arr]; - calledGet = false; - testArr[0]; - assert(!calledGet); - } - } -} -test(); - -definedAccessor = true; -Reflect.defineProperty(Array.prototype, "0", { - get() { calledGet = true; return 0; }, - set(x) { } -}); -test(); diff --git a/implementation-contributed/javascriptcore/stress/rest-parameter-negative.js b/implementation-contributed/javascriptcore/stress/rest-parameter-negative.js deleted file mode 100644 index 632dad958c..0000000000 --- a/implementation-contributed/javascriptcore/stress/rest-parameter-negative.js +++ /dev/null @@ -1,21 +0,0 @@ -function __f_5484(__v_22596) { - if (!__v_22596) throw new Error(); -} - -try { - noInline(__f_5484); -} catch (e) {} - -function __f_5485(...__v_22597) { - return __v_22597[-13]; -} - -try { - noInline(__f_5485); -} catch (e) {} - -for (let __v_22598 = 0; __v_22598 < 10000; __v_22598++) { - try { - __f_5484(__f_5485(__v_22598) === __v_22598); - } catch (e) {} -} diff --git a/implementation-contributed/javascriptcore/stress/rest-parameter-various-types.js b/implementation-contributed/javascriptcore/stress/rest-parameter-various-types.js deleted file mode 100644 index 8efd934e29..0000000000 --- a/implementation-contributed/javascriptcore/stress/rest-parameter-various-types.js +++ /dev/null @@ -1,98 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad!"); -} -noInline(assert); - -function foo(a, b, ...c) { - return c; -} -noInline(foo); -function bar(a, b, ...c) { - return c; -} -noInline(bar); - -function baz(a, b, ...c) { // allow this to be inlined - return c; -} - -noInline(isNaN); - -function test1(f, iters) { - for (let i = 0; i < iters; i++) { - let result = f(10, 20, 20.5, 22.45, 23.50); - assert(result.length === 3); - assert(result[0] === 20.5) - assert(result[1] === 22.45) - assert(result[2] === 23.50); - } - - let o = {}; - let result = f(10, 20, 20.4, o, 20.2); - assert(result.length === 3); - assert(result[0] === 20.4) - assert(result[1] === o) - assert(result[2] === 20.2); - - result = f(10, 20, 20.4, 20.45, NaN); - assert(result.length === 3); - assert(result[0] === 20.4) - assert(result[1] === 20.45) - assert(isNaN(result[2])); -} -test1(foo, 1000); -test1(bar, 10000); -test1(baz, 10000); - -function makeTest2() { - return eval(`${Math.random()}; - ;(function test2(f, iters) { - let a = 10; - let b = 20; - for (let i = 0; i < iters; i++) { - if (i === iters - 2) { - b = {}; - } else if (i === iters - 1) { - b = NaN; - } - - let r = f(a, b); - assert(r.length === 2); - assert(r[0] === a || (isNaN(a) && isNaN(r[0]))); - assert(r[1] === b || (isNaN(b) && isNaN(r[1]))); - } - })`); -} -function f1(...rest) { return rest; } -function f2(...rest) { return rest; } -function f3(...rest) { return rest; } -makeTest2()(f1, 1000); -makeTest2()(f2, 10000); -makeTest2()(f3, 500000); - -function test3(f, iters) { - let o = {}; - for (let i = 0; i < iters; i++) { - let r = f(i, o, 25); - assert(r.length === 2 || r.length === 10000); - assert(r[0] === o); - assert(r[1] === 25); - if (r.length === 10000) - assert(r[9999] === 30); - } -} - -function f11(i, ...rest) { - if (i === 999) - rest[9999] = 30; - return rest; -} -function f22(i, ...rest) { - if (i === 49999) - rest[9999] = 30; - return rest; -} -test3(f11, 1000); -test3(f22, 50000); - diff --git a/implementation-contributed/javascriptcore/stress/retry-cache-later.js b/implementation-contributed/javascriptcore/stress/retry-cache-later.js deleted file mode 100644 index 1f4cfdaedd..0000000000 --- a/implementation-contributed/javascriptcore/stress/retry-cache-later.js +++ /dev/null @@ -1,18 +0,0 @@ -//@ runNoCJIT("--useLLInt=false", "--useDFGJIT=false") - -function foo(o) { - return o.i7; -} - -var o = {}; -for (var i = 0; i < 100; ++i) - o["i" + i] = i; -for (var i = 0; i < 100; i+=2) - delete o["i" + i]; - -for (var i = 0; i < 100; ++i) { - var result = foo(o); - if (result != 7) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/right-left-context-invalidated-by-input.js b/implementation-contributed/javascriptcore/stress/right-left-context-invalidated-by-input.js deleted file mode 100644 index 30274d780d..0000000000 --- a/implementation-contributed/javascriptcore/stress/right-left-context-invalidated-by-input.js +++ /dev/null @@ -1,25 +0,0 @@ -//@ runDefault - -function test(when) -{ - /bar/.exec("foo bar baz"); - - function validateContexts(when) - { - if (RegExp.leftContext !== "foo ") - throw "Error: " + when + ": bad leftContext: " + RegExp.leftContext; - if (RegExp.rightContext !== " baz") - throw "Error: " + when + ": bad rightContext: " + RegExp.rightContext; - } - - if (when === "before") - validateContexts("before"); - - RegExp.input = ""; - - if (when === "after") - validateContexts("after"); -} - -test("before"); -test("after"); diff --git a/implementation-contributed/javascriptcore/stress/ropes-symbol-toprimitive.js b/implementation-contributed/javascriptcore/stress/ropes-symbol-toprimitive.js deleted file mode 100644 index f6dcf19219..0000000000 --- a/implementation-contributed/javascriptcore/stress/ropes-symbol-toprimitive.js +++ /dev/null @@ -1,28 +0,0 @@ -function ropify(a,b,c) { - return a + b + c; -} -noInline(ropify); - -function ropify2(a,b,c) { - return a + b + c; -} -noInline(ropify2); - -let test = new String("test"); - -for (let i = 0; i < 100000; i++) { - if (ropify("a", "b", test) !== "abtest") - throw "wrong on warmup"; -} - -String.prototype[Symbol.toPrimitive] = function() { return "changed"; } - -if (ropify("a", "b", test) !== "abchanged") - throw "watchpoint didn't fire"; - - -// Test we don't start doing the wrong thing if the prototype chain has been mucked with. -for (let i = 0; i < 100000; i++) { - if (ropify2("a", "b", test) !== "abchanged") - throw "wrong on warmup"; -} diff --git a/implementation-contributed/javascriptcore/stress/runtime-throw-through-optimized-code.js b/implementation-contributed/javascriptcore/stress/runtime-throw-through-optimized-code.js deleted file mode 100644 index 1d9df1ddfb..0000000000 --- a/implementation-contributed/javascriptcore/stress/runtime-throw-through-optimized-code.js +++ /dev/null @@ -1,33 +0,0 @@ -function foo(a, s) { - return a[s] + 1; -} - -var shouldThrow = false; -function bar() { - if (shouldThrow) - throw "hello"; - return 42; -} - -var a = {}; -a.__defineGetter__("bar", bar); - -noInline(foo); -noInline(bar); - -for (var i = 0; i < 100000; ++i) { - var result = foo(a, "bar"); - if (result != 43) - throw "Error: bad result: " + result; -} - -var didThrow; -try { - shouldThrow = true; - foo(a, "bar"); -} catch (e) { - didThrow = e; -} - -if (didThrow != "hello") - throw "Error: didn't throw or threw wrong exception: " + didThrow; diff --git a/implementation-contributed/javascriptcore/stress/sampling-profiler-anonymous-function.js b/implementation-contributed/javascriptcore/stress/sampling-profiler-anonymous-function.js deleted file mode 100644 index 5876df74cc..0000000000 --- a/implementation-contributed/javascriptcore/stress/sampling-profiler-anonymous-function.js +++ /dev/null @@ -1,22 +0,0 @@ -if (platformSupportsSamplingProfiler()) { - load("./sampling-profiler/samplingProfiler.js"); - - function foo(f) { - f(); - } - - function baz() { - foo(function() { - let x = 0; - let o = {}; - for (let i = 0; i < 5000; i++) { - o[i] = i; - i++; - i--; - x++; - } - }); - } - - runTest(baz, ["(anonymous function)", "foo", "baz"]); -} diff --git a/implementation-contributed/javascriptcore/stress/sampling-profiler-basic.js b/implementation-contributed/javascriptcore/stress/sampling-profiler-basic.js deleted file mode 100644 index c122870dad..0000000000 --- a/implementation-contributed/javascriptcore/stress/sampling-profiler-basic.js +++ /dev/null @@ -1,44 +0,0 @@ -if (platformSupportsSamplingProfiler()) { - load("./sampling-profiler/samplingProfiler.js"); - - function bar(y) { - let x; - for (let i = 0; i < 20; i++) - x = new Error(); - return x; - } - noInline(bar); - - function foo() { - bar(1000); - } - noInline(foo); - - function nothing(x) { return x; } - noInline(nothing); - - runTest(foo, ["Error", "bar", "foo"]); - - function top() { - let x = 0; - for (let i = 0; i < 25; i++) { - x++; - x--; - } - } - - function jaz(x) { return x + top(); } - function kaz(y) { - return jaz(y) + 5; - } - function checkInlining() { - for (let i = 0; i < 100; i++) - kaz(104); - } - - // Tier it up. - for (let i = 0; i < 1000; i++) - checkInlining(); - - runTest(checkInlining, ["jaz", "kaz", "checkInlining"]); -} diff --git a/implementation-contributed/javascriptcore/stress/sampling-profiler-bound-function-name.js b/implementation-contributed/javascriptcore/stress/sampling-profiler-bound-function-name.js deleted file mode 100644 index 7ebaa433a1..0000000000 --- a/implementation-contributed/javascriptcore/stress/sampling-profiler-bound-function-name.js +++ /dev/null @@ -1,28 +0,0 @@ -if (platformSupportsSamplingProfiler()) { - load("./sampling-profiler/samplingProfiler.js"); - - function foo() { - let o = {}; - for (let i = 0; i < 100; i++) { - o[i + "p"] = i; - } - } - - function bar() { - let o = {}; - for (let i = 0; i < 100; i++) { - o[i + "p"] = i; - } - } - - let boundFoo = foo.bind(null); - let boundBar = bar.bind(null); - - let baz = function() { - boundFoo(); - boundBar(); - } - - runTest(baz, ["foo", "bound foo", "baz"]); - runTest(baz, ["bar", "bound bar", "baz"]); -} diff --git a/implementation-contributed/javascriptcore/stress/sampling-profiler-deep-stack.js b/implementation-contributed/javascriptcore/stress/sampling-profiler-deep-stack.js deleted file mode 100644 index c339691638..0000000000 --- a/implementation-contributed/javascriptcore/stress/sampling-profiler-deep-stack.js +++ /dev/null @@ -1,33 +0,0 @@ -if (platformSupportsSamplingProfiler()) { - load("./sampling-profiler/samplingProfiler.js"); - - function foo(x) { - let o = {}; - for (let i = 0; i < 1000; i++) { - let x = i; - x--; - o["x" + x] = x; - } - return x; - } - noInline(foo); - const limit = 300; - let hellaDeep = function(i) { - if (i < limit) - hellaDeep(i + 1); - else - foo(i); - } - - let start = function() { - hellaDeep(1); - } - - let stackTrace = []; - stackTrace.push("foo"); - for (let i = 0; i < limit; i++) - stackTrace.push("hellaDeep"); - stackTrace.push("start"); - - runTest(start, stackTrace); -} diff --git a/implementation-contributed/javascriptcore/stress/sampling-profiler-display-name.js b/implementation-contributed/javascriptcore/stress/sampling-profiler-display-name.js deleted file mode 100644 index dab71080a7..0000000000 --- a/implementation-contributed/javascriptcore/stress/sampling-profiler-display-name.js +++ /dev/null @@ -1,49 +0,0 @@ -if (platformSupportsSamplingProfiler()) { - load("./sampling-profiler/samplingProfiler.js"); - - function foo() { - let o = {}; - for (let i = 0; i < 500; i++) - o[i + "p"] = i; - } - foo.displayName = "display foo"; - runTest(foo, ["display foo"]); - - - function baz() { - let o = {}; - for (let i = 0; i < 500; i++) - o[i + "p"] = i; - } - Object.defineProperty(baz, 'displayName', { get: function() { throw new Error("shouldnt be called"); } }); // We should ignore this because it's a getter. - runTest(baz, ["baz"]); - - - function bar() { - let o = {}; - for (let i = 0; i < 500; i++) - o[i + "p"] = i; - } - bar.displayName = 20; // We should ignore this because it's not a string. - runTest(bar, ["bar"]); - - function jaz() { - let o = {}; - for (let i = 0; i < 500; i++) - o[i + "p"] = i; - } - jaz.displayName = ""; // We should ignore this because it's the empty string. - runTest(jaz, ["jaz"]); - - function makeFunction(displayName) { - let result = function() { - let o = {}; - for (let i = 0; i < 500; i++) - o[i + "p"] = i; - }; - result.displayName = displayName; - return result; - } - - runTest(makeFunction("hello world"), ["hello world"]) -} diff --git a/implementation-contributed/javascriptcore/stress/sampling-profiler-internal-function-name.js b/implementation-contributed/javascriptcore/stress/sampling-profiler-internal-function-name.js deleted file mode 100644 index 8892ca3503..0000000000 --- a/implementation-contributed/javascriptcore/stress/sampling-profiler-internal-function-name.js +++ /dev/null @@ -1,17 +0,0 @@ -if (platformSupportsSamplingProfiler()) { - load("./sampling-profiler/samplingProfiler.js"); - - function foo() { - let x; - for (let i = 0; i < 1000; i++) - x = new Error(); - } - runTest(foo, ["Error", "foo"]); - - function bar() { - let x; - for (let i = 0; i < 1000; i++) - x = new Function(); - } - runTest(bar, ["Function", "bar"]); -} diff --git a/implementation-contributed/javascriptcore/stress/scoped-arguments-array-length.js b/implementation-contributed/javascriptcore/stress/scoped-arguments-array-length.js deleted file mode 100644 index 3217bd3376..0000000000 --- a/implementation-contributed/javascriptcore/stress/scoped-arguments-array-length.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo(a) { - var result = 0; - if (!a) - return function() { return a }; - for (var i = 0; i < arguments.length; ++i) - result += arguments[i]; - return result; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(42, i); - if (result != 42 + i) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/scoped-arguments-check-array.js b/implementation-contributed/javascriptcore/stress/scoped-arguments-check-array.js deleted file mode 100644 index fac9407489..0000000000 --- a/implementation-contributed/javascriptcore/stress/scoped-arguments-check-array.js +++ /dev/null @@ -1,41 +0,0 @@ -//@ defaultRun -//@ runNoLLInt("--useConcurrentJIT=false", "--forceEagerCompilation=True") - -// This is a regression test that verifies we handle direct arguments as ArrayStorage. This test should complete and not crash. -// It is a reduction of a fuzzing bug produced testcase. All of the code present was needed to reproduce the issue. - -let a; -let f2; -let args; - -function setup(arg1) { - function foo() { return arg1; } - a = [0]; - a.unshift(0); - for (let z of [4, 4, 4, 4, 4]) {}; - new Float64Array(a); - f2 = function() {}; - args = arguments; - args.length = 0; -}; - -function forOfArray() { - for (let z of [true, true, true, true, true, true, true]) { - } -} - -function forOfArgs() { - for (let v of args) { - } -} - -function callEveryOnArgs() { - for (i = 0; i < 1000; ++i) { - Array.prototype.every.call(args, f2, {}); - } -} - -setup(); -forOfArray(); -forOfArgs(); -callEveryOnArgs(); diff --git a/implementation-contributed/javascriptcore/stress/scoped-arguments-out-of-bounds-change-structure.js b/implementation-contributed/javascriptcore/stress/scoped-arguments-out-of-bounds-change-structure.js deleted file mode 100644 index 533437d6e3..0000000000 --- a/implementation-contributed/javascriptcore/stress/scoped-arguments-out-of-bounds-change-structure.js +++ /dev/null @@ -1,30 +0,0 @@ -function foo(o) -{ - var theO = (function() { return o; })(); - var x = theO.f; - arguments[42]; - return x + theO.f; -} - -// Break some watchpoints. -var o = {f:24}; -o.g = 43; - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo({f:42}); - if (result != 84) - throw "Error: bad result: " + result; -} - -var globalO = {f:42}; -Object.prototype.__defineGetter__(42, function() { - delete globalO.f; - globalO.__defineGetter__("f", function() { return 75; }); - return 33; -}); -var result = foo(globalO); -if (result != 42 + 75) - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/scoped-arguments-test.js b/implementation-contributed/javascriptcore/stress/scoped-arguments-test.js deleted file mode 100644 index 838c91b5a6..0000000000 --- a/implementation-contributed/javascriptcore/stress/scoped-arguments-test.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a) -{ - (function() { return a; })(); - return [arguments[0], arguments]; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(42); - if (result[0] != 42) - throw new Error("result[0] is not 42: " + result[0]); - if (result[1][0] != 42) - throw new Error("result[1][0] is not 42: " + result[1][0]); -} - diff --git a/implementation-contributed/javascriptcore/stress/scoped-arguments-write-barrier-should-be-on-scope-object.js b/implementation-contributed/javascriptcore/stress/scoped-arguments-write-barrier-should-be-on-scope-object.js deleted file mode 100644 index 78c1ea6e56..0000000000 --- a/implementation-contributed/javascriptcore/stress/scoped-arguments-write-barrier-should-be-on-scope-object.js +++ /dev/null @@ -1,35 +0,0 @@ -//@ runDefault -// This test should not crash. - -var arr = []; -let numberOfIterations = 1000; - -function captureScopedArguments(i) { - try { - eval("arr[" + i + "] = arguments"); - } catch(e) { - } -} - -function addPointersToEdenGenObjects(i) { - Array.prototype.push.call(arr[i], [,,]); - - try { - Array.prototype.reverse.call(arr[i]) - } catch (e) { - } -} - -for (var i = 0; i < numberOfIterations; i++) { - captureScopedArguments(i); -} - -gc(); // Promote those ScopeArguments to the old generation. - -for (var i = 0; i < numberOfIterations; i++) { - addPointersToEdenGenObjects(i); -} - -edenGC(); // Do eden GC to scan the remembered set which should include the ScopedArguments. - -gc(); // Scan the ScopedArguments again. They better not point to collected objects. diff --git a/implementation-contributed/javascriptcore/stress/scoped-then-direct-arguments-get-by-val-in-baseline.js b/implementation-contributed/javascriptcore/stress/scoped-then-direct-arguments-get-by-val-in-baseline.js deleted file mode 100644 index 7c821043a6..0000000000 --- a/implementation-contributed/javascriptcore/stress/scoped-then-direct-arguments-get-by-val-in-baseline.js +++ /dev/null @@ -1,30 +0,0 @@ -function direct() { - return arguments; -} - -function scoped(a) { - if (!effectful42()) - return function() { return a; } - return arguments; -} - -function foo(a) { - try { - return a[0]; - } catch (e) { - return -23; - } -} - -for (var i = 0; i < 100; ++i) { - var result = foo(scoped(42)); - if (result != 42) - throw "Error: bad result: " + result; -} - -for (var i = 0; i < 100; ++i) { - var result = foo(direct(42)); - if (result != 42) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/set-add-check-failure.js b/implementation-contributed/javascriptcore/stress/set-add-check-failure.js deleted file mode 100644 index 32bd6c1622..0000000000 --- a/implementation-contributed/javascriptcore/stress/set-add-check-failure.js +++ /dev/null @@ -1,35 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -var func = Set.prototype.add; -function target(set) -{ - return func.call(set, 42); -} -noInline(target); - -for (var i = 0; i < 1e6; ++i) { - var set = new Set(); - shouldBe(target(set), set); - shouldBe(set.has(42), true); -} -shouldThrow(() => { - target(new Map()); -}, `TypeError: Set operation called on non-Set object`); diff --git a/implementation-contributed/javascriptcore/stress/set-add-clobber-set-has.js b/implementation-contributed/javascriptcore/stress/set-add-clobber-set-has.js deleted file mode 100644 index 1f2dc9a88d..0000000000 --- a/implementation-contributed/javascriptcore/stress/set-add-clobber-set-has.js +++ /dev/null @@ -1,20 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var set = new Set(); - var res1 = set.has(42); - set.add(42); - var res2 = set.has(42); - return [res1, res2]; -} - -for (var i = 0; i < 1e6; ++i) { - var [res1, res2] = test(); - shouldBe(res1, false); - shouldBe(res2, true); -} diff --git a/implementation-contributed/javascriptcore/stress/set-add-create-bucket.js b/implementation-contributed/javascriptcore/stress/set-add-create-bucket.js deleted file mode 100644 index 879c6368f7..0000000000 --- a/implementation-contributed/javascriptcore/stress/set-add-create-bucket.js +++ /dev/null @@ -1,26 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var set = new Set(); - var res1 = set.has(42); - set.add(42); - var res2 = set.has(42); - set.add(42); - var res3 = set.has(42); - set.delete(42); - var res4 = set.has(42); - return [res1, res2, res3, res4]; -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - var [res1, res2, res3, res4] = test(); - shouldBe(res1, false); - shouldBe(res2, true); - shouldBe(res3, true); - shouldBe(res4, false); -} diff --git a/implementation-contributed/javascriptcore/stress/set-add-does-not-clobber-map-get.js b/implementation-contributed/javascriptcore/stress/set-add-does-not-clobber-map-get.js deleted file mode 100644 index 120e8ed791..0000000000 --- a/implementation-contributed/javascriptcore/stress/set-add-does-not-clobber-map-get.js +++ /dev/null @@ -1,19 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var map = new Map(); - var set = new Set(); - map.set(42, 42); - var res1 = map.get(42); - set.add(42); - var res2 = map.get(42); - return res1 + res2; -} - -for (var i = 0; i < 1e6; ++i) - shouldBe(test(), 84); diff --git a/implementation-contributed/javascriptcore/stress/set-clone-instance-iterator-change.js b/implementation-contributed/javascriptcore/stress/set-clone-instance-iterator-change.js deleted file mode 100644 index 340bb2585c..0000000000 --- a/implementation-contributed/javascriptcore/stress/set-clone-instance-iterator-change.js +++ /dev/null @@ -1,17 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -let set = new Set([0, 1, 2, 3, 4]); -for (let i = 0; i < 1e2; ++i) { - let cloned = new Set(set); - shouldBe(cloned.size, set.size); -} - -set[Symbol.iterator] = function () { return [][Symbol.iterator](); }; -for (let i = 0; i < 1e2; ++i) { - let cloned = new Set(set); - shouldBe(cloned.size, 0); -} diff --git a/implementation-contributed/javascriptcore/stress/set-clone-iterator-change.js b/implementation-contributed/javascriptcore/stress/set-clone-iterator-change.js deleted file mode 100644 index 0c001c61b6..0000000000 --- a/implementation-contributed/javascriptcore/stress/set-clone-iterator-change.js +++ /dev/null @@ -1,17 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -let set = new Set([0, 1, 2, 3, 4]); -for (let i = 0; i < 1e2; ++i) { - let cloned = new Set(set); - shouldBe(cloned.size, set.size); -} - -Set.prototype[Symbol.iterator] = function () { return [][Symbol.iterator](); }; -for (let i = 0; i < 1e2; ++i) { - let cloned = new Set(set); - shouldBe(cloned.size, 0); -} diff --git a/implementation-contributed/javascriptcore/stress/set-clone-next-change.js b/implementation-contributed/javascriptcore/stress/set-clone-next-change.js deleted file mode 100644 index 78db528cbc..0000000000 --- a/implementation-contributed/javascriptcore/stress/set-clone-next-change.js +++ /dev/null @@ -1,17 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -let set = new Set([0, 1, 2, 3, 4]); -for (let i = 0; i < 1e2; ++i) { - let cloned = new Set(set); - shouldBe(cloned.size, set.size); -} - -set[Symbol.iterator]().__proto__.next = function () { return {done:true}; }; -for (let i = 0; i < 1e2; ++i) { - let cloned = new Set(set); - shouldBe(cloned.size, 0); -} diff --git a/implementation-contributed/javascriptcore/stress/set-clone.js b/implementation-contributed/javascriptcore/stress/set-clone.js deleted file mode 100644 index 835a2bd311..0000000000 --- a/implementation-contributed/javascriptcore/stress/set-clone.js +++ /dev/null @@ -1,16 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -let set = new Set([0, 1, 2, 3, 4]); -for (let i = 0; i < 1e2; ++i) { - let cloned = new Set(set); - shouldBe(cloned.size, set.size); -} -Set.prototype.add = function empty(value) { }; -for (let i = 0; i < 1e2; ++i) { - let cloned = new Set(set); - shouldBe(cloned.size, 0); -} diff --git a/implementation-contributed/javascriptcore/stress/set-constructor-adder.js b/implementation-contributed/javascriptcore/stress/set-constructor-adder.js deleted file mode 100644 index c69ae91f39..0000000000 --- a/implementation-contributed/javascriptcore/stress/set-constructor-adder.js +++ /dev/null @@ -1,34 +0,0 @@ -// Set constructor with adder change. - -var originalAdder = Set.prototype.add; -var counter = 0; - -Set.prototype.add = function (value) { - counter++; - return originalAdder.call(this, value); -}; - -var values = [0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0]; -var set = new Set(values); -if (set.size !== 6) - throw "Error: bad set size " + set.size; -if (counter !== values.length) - throw "Error: bad counter " + counter; - -Set.prototype.add = function () { - throw new Error("adder called"); -}; - -var set = new Set(); -var set = new Set([]); -var error = null; -try { - var set = new Set([0]); -} catch (e) { - error = e; -} -if (!error) - throw "Error: error not thrown"; -if (String(error) !== "Error: adder called") - throw "Error: bad error " + String(error); - diff --git a/implementation-contributed/javascriptcore/stress/set-constructor.js b/implementation-contributed/javascriptcore/stress/set-constructor.js deleted file mode 100644 index 958cb3b2d1..0000000000 --- a/implementation-contributed/javascriptcore/stress/set-constructor.js +++ /dev/null @@ -1,69 +0,0 @@ -// Set constructor behaviors. - -if (typeof Set !== 'function') - throw "Error: bad value" + typeof Set; - -function testCallTypeError(item) { - var error = null; - try { - var set = Set(item); - } catch (e) { - error = e; - } - if (!error) - throw "Error: error not thrown"; - if (String(error) !== "TypeError: calling Set constructor without new is invalid") - throw "Error: bad error " + String(error); -} - -var pass = [ - [ null, 0 ], - [ undefined, 0 ], - [ "Cocoa", 4 ], - [ [0, 1, 2, 3, 4], 5 ], - [ [0, 0, 0, 1, 0], 2 ], - [ ["A", "B", "A"], 2 ], - [ new String("cocoa"), 3 ], - [ new String("Cocoa"), 4 ], - [ new Set([0,1,2,3,4]), 5], - [ new Set([1,1,1,1]), 1], - [ new Map([[1, 2],[1, 2]]), 1], - [ new Map([[1, 2],[2, 2]]), 2], -]; - -for (var pair of pass) { - var set = new Set(pair[0]); - if (set.size !== pair[1]) - throw "Error: bad set size " + set.size; - testCallTypeError(pair[0]); -} - -function testTypeError(item) { - var error = null; - try { - var set = new Set(item); - } catch (e) { - error = e; - } - if (!error) - throw "Error: error not thrown"; - if (String(error) !== "TypeError: Type error") - throw "Error: bad error " + String(error); -} - -var nonIterable = [ - 42, - Symbol("Cappuccino"), - true, - false, - {}, - new Date(), - new Error(), - Object(Symbol("Matcha")), - (function () { }), -]; - -for (var item of nonIterable) { - testTypeError(item); - testCallTypeError(item); -} diff --git a/implementation-contributed/javascriptcore/stress/set-inherit-add.js b/implementation-contributed/javascriptcore/stress/set-inherit-add.js deleted file mode 100644 index 8985d296ec..0000000000 --- a/implementation-contributed/javascriptcore/stress/set-inherit-add.js +++ /dev/null @@ -1,28 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -let set = new Set([0, 1, 2, 3, 4]); -for (let i = 0; i < 1e2; ++i) { - let cloned = new Set(set); - shouldBe(cloned.size, set.size); -} - -class DerivedSet extends Set { - constructor(set) - { - super(set); - } - - add(value) - { - // ignore. - } -} - -for (let i = 0; i < 1e2; ++i) { - let cloned = new DerivedSet(set); - shouldBe(cloned.size, 0); -} diff --git a/implementation-contributed/javascriptcore/stress/set-iterator-result-should-have-expected-shape.js b/implementation-contributed/javascriptcore/stress/set-iterator-result-should-have-expected-shape.js deleted file mode 100644 index 5b7d12bae8..0000000000 --- a/implementation-contributed/javascriptcore/stress/set-iterator-result-should-have-expected-shape.js +++ /dev/null @@ -1,33 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -{ - let set = new Set(); - set.add(42); - let iterator = set[Symbol.iterator](); - { - let result = iterator.next(); - shouldBe(JSON.stringify(Object.getOwnPropertyNames(result).sort()), `["done","value"]`); - shouldBe(result.done, false); - shouldBe(result.value, 42); - } - { - let result = iterator.next(); - shouldBe(JSON.stringify(Object.getOwnPropertyNames(result).sort()), `["done","value"]`); - shouldBe(result.done, true); - shouldBe(result.value, undefined); - } -} - -{ - let set = new Set(); - let iterator = set[Symbol.iterator](); - { - let result = iterator.next(); - shouldBe(JSON.stringify(Object.getOwnPropertyNames(result).sort()), `["done","value"]`); - shouldBe(result.done, true); - shouldBe(result.value, undefined); - } -} diff --git a/implementation-contributed/javascriptcore/stress/set-iterators-next.js b/implementation-contributed/javascriptcore/stress/set-iterators-next.js deleted file mode 100644 index a0e416525c..0000000000 --- a/implementation-contributed/javascriptcore/stress/set-iterators-next.js +++ /dev/null @@ -1,115 +0,0 @@ -// This test checks the behavior of the iterator.next methods on Set objects - -var testArray = [1,2,3,4,5,6] -var testSet = new Set(); -for (var [key, value] of testArray.entries()) { - testSet.add(value); -} -var keys = testSet.keys(); -var i = 0; -while (true) { - var {done, value: key} = keys.next(); - if (done) - break; - if (testArray.indexOf(key) === -1) - throw "Error: bad value: " + key; - i++; -} - -if (testSet.size !== i) - throw "Error: bad value: " + i; - -var value = keys.next().value; -if (value !== undefined) - throw "Error: bad value: " + value; - -var values = testSet.values(); -var i = 0; -while (true) { - var {done, value} = values.next(); - if (done) - break; - i++; - if (testArray.indexOf(value) === -1) - throw "Error: bad value: " + value; -} - -if (testSet.size !== i) - throw "Error: bad value: " + i; - -var value = values.next().value; -if (value !== undefined) - throw "Error: bad value: " + value; - -var entries = testSet.entries(); -var i = 0; -do { - var {done, value: entry} = entries.next(); - if (done) - break; - var [key, value] = entry; - if (key !== value) - throw "Error: bad value: " + key + " " + value; - if (!testSet.has(value)) - throw "Error: bad value: " + value; - if (!testSet.has(key)) - throw "Error: bad value: " + key; - i++; - if (testArray.indexOf(value) === -1) - throw "Error: bad value: " + value + " " + i; -} while (!done); - -if (testSet.size !== i) - throw "Error: bad value: " + i; - -var value = entries.next().value; -if (value !== undefined) - throw "Error: bad value: " + value; - -var entries = testSet.entries(); -var i = 0; -do { - var {done, value: entry} = entries.next(); - if (done) - break; - var [key, value] = entry; - if (key !== value) - throw "Error: bad value: " + key + " " + value; - if (!testSet.has(key)) - throw "Error: bad value: " + value; - i++; - if (i % 4 === 0) - testSet.add(100000 + i); -} while (!done); - -if (testSet.size !== i) - throw "Error: bad value: " + i; - -var value = entries.next().value; -if (value !== undefined) - throw "Error: bad value: " + value; - -function otherKey(key) { - return (key + 1) % testArray.length; -} - -var entries = testSet.entries(); -var i = 0; -do { - var {done, value: entry} = entries.next(); - if (done) - break; - var [key, value] = entry; - if (!testSet.has(key)) - throw "Error: bad value: " + value + " " + testSet.get(key); - i++; - if (i % 4 === 0) - testSet.delete(otherKey(key)); -} while (!done); - -if (testSet.size !== i) - throw "Error: bad value: " + i; - -var value = entries.next().value; -if (value !== undefined) - throw "Error: bad value: " + value; diff --git a/implementation-contributed/javascriptcore/stress/set-same-prototype.js b/implementation-contributed/javascriptcore/stress/set-same-prototype.js deleted file mode 100644 index 65f5c7118b..0000000000 --- a/implementation-contributed/javascriptcore/stress/set-same-prototype.js +++ /dev/null @@ -1,38 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -var proto = {}; -var object = Object.preventExtensions(Object.create(proto)); - -shouldBe(Object.setPrototypeOf(object, proto), object); -shouldThrow(() => { - Object.setPrototypeOf(object, {}); -}, `TypeError: Attempted to assign to readonly property.`); -shouldBe(Reflect.getPrototypeOf(object), proto); - -shouldBe(Reflect.setPrototypeOf(object, proto), true); -shouldBe(Reflect.setPrototypeOf(object, {}), false); -shouldBe(Reflect.getPrototypeOf(object), proto); - -object.__proto__ = proto; -shouldThrow(() => { - object.__proto__ = {}; -}, `TypeError: Attempted to assign to readonly property.`); -shouldBe(object.__proto__, proto); diff --git a/implementation-contributed/javascriptcore/stress/set-untyped-normalize-cse.js b/implementation-contributed/javascriptcore/stress/set-untyped-normalize-cse.js deleted file mode 100644 index d2587497dd..0000000000 --- a/implementation-contributed/javascriptcore/stress/set-untyped-normalize-cse.js +++ /dev/null @@ -1,44 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var keys = [ - "Cappuccino", - -0.0, - Symbol("Cocoa"), - 42, - -42, - null, - undefined, - 420.5, - 0xffffffff, - 0x80000000, - -1, - -2147483648, - {}, - [], - false, - true, - NaN, -]; - -let i = 0; -let set = new Set(); -for (let key of keys) - set.add(key); - -function test(set, key) -{ - return set.has(key) + set.has(key); -} -noInline(test); - -for (let i = 0; i < 1e4; ++i) { - let j = 0; - for (let key of keys) { - shouldBe(test(set, key), 2); - } -} -shouldBe(test(set, 0.0), 2); diff --git a/implementation-contributed/javascriptcore/stress/set-untyped-normalize.js b/implementation-contributed/javascriptcore/stress/set-untyped-normalize.js deleted file mode 100644 index 22c4eac58c..0000000000 --- a/implementation-contributed/javascriptcore/stress/set-untyped-normalize.js +++ /dev/null @@ -1,44 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var keys = [ - "Cappuccino", - -0.0, - Symbol("Cocoa"), - 42, - -42, - null, - undefined, - 420.5, - 0xffffffff, - 0x80000000, - -1, - -2147483648, - {}, - [], - false, - true, - NaN, -]; - -let i = 0; -let set = new Set(); -for (let key of keys) - set.add(key); - -function test(set, key) -{ - return set.has(key); -} -noInline(test); - -for (let i = 0; i < 1e4; ++i) { - let j = 0; - for (let key of keys) { - shouldBe(test(set, key), true); - } -} -shouldBe(test(set, 0.0), true); diff --git a/implementation-contributed/javascriptcore/stress/simple-ai-effect.js b/implementation-contributed/javascriptcore/stress/simple-ai-effect.js deleted file mode 100644 index f05d208b1b..0000000000 --- a/implementation-contributed/javascriptcore/stress/simple-ai-effect.js +++ /dev/null @@ -1,39 +0,0 @@ -var doEffect = false; -var didEffect = false; - -function bar(o, p) -{ - if (doEffect) { - delete p.g; - p.__defineGetter__("g", () => { - didEffect = true; - return 42; - }); - } -} - -noInline(bar); - -function foo(o, p) { - var result = o.f + p.g; - bar(o, p); - return result + o.f + p.g; -} - -noInline(foo); - -var o = {g: 1}; -o.h = 2; - -for (var i = 0; i < 10000; ++i) { - var result = foo({f: 1}, {g: 3}); - if (result != 8) - throw "Error: bad result in loop: " + result; -} - -doEffect = true; -var result = foo({f: 1}, {g: 3}); -if (result != 47) - throw "Error: bad result at end: " + result; -if (!didEffect) - throw "Error: did not do effect"; diff --git a/implementation-contributed/javascriptcore/stress/simple-polyvariant-call-inlining-example.js b/implementation-contributed/javascriptcore/stress/simple-polyvariant-call-inlining-example.js deleted file mode 100644 index 633b276cac..0000000000 --- a/implementation-contributed/javascriptcore/stress/simple-polyvariant-call-inlining-example.js +++ /dev/null @@ -1,32 +0,0 @@ -function foo(baz) { - return bar(baz); -} - -function fuzz(baz) { - return bar(baz); -} - -function bar(baz) { - return baz(); -} - -function baz1() { - return 42; -} - -function baz2() { - return 24; -} - -noInline(foo); -noInline(fuzz); - -for (var i = 0; i < 100000; ++i) { - var result = foo(baz1); - if (result != 42) - throw "Error: bad result: " + result; - var result = fuzz(baz2); - if (result != 24) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/simple-polyvariant-get-by-id-inlining-example.js b/implementation-contributed/javascriptcore/stress/simple-polyvariant-get-by-id-inlining-example.js deleted file mode 100644 index 554ab09c73..0000000000 --- a/implementation-contributed/javascriptcore/stress/simple-polyvariant-get-by-id-inlining-example.js +++ /dev/null @@ -1,24 +0,0 @@ -function foo(o) { - return bar(o); -} - -function fuzz(o) { - return bar(o); -} - -function bar(o) { - return o.f; -} - -noInline(foo); -noInline(fuzz); - -for (var i = 0; i < 100000; ++i) { - var result = foo({f:42}); - if (result != 42) - throw "Error: bad result: " + result; - var result = fuzz({g:23, f:24}); - if (result != 24) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/simple-polyvariant-put-by-id-inlining-example.js b/implementation-contributed/javascriptcore/stress/simple-polyvariant-put-by-id-inlining-example.js deleted file mode 100644 index 8eb6272f7e..0000000000 --- a/implementation-contributed/javascriptcore/stress/simple-polyvariant-put-by-id-inlining-example.js +++ /dev/null @@ -1,26 +0,0 @@ -function foo(o) { - bar(o); -} - -function fuzz(o) { - bar(o); -} - -function bar(o) { - o.f = 42; -} - -noInline(foo); -noInline(fuzz); - -for (var i = 0; i < 100000; ++i) { - var o = {}; - foo(o); - if (o.f != 42) - throw "Error: bad result: " + o.f; - o = {f:23}; - var result = fuzz(o); - if (o.f != 42) - throw "Error: bad result: " + o.f; -} - diff --git a/implementation-contributed/javascriptcore/stress/simple-prototype-accesses.js b/implementation-contributed/javascriptcore/stress/simple-prototype-accesses.js deleted file mode 100644 index a580879df8..0000000000 --- a/implementation-contributed/javascriptcore/stress/simple-prototype-accesses.js +++ /dev/null @@ -1,20 +0,0 @@ -function Foo() { -} -Foo.prototype.f = 42; -Foo.prototype.g = 43; -Foo.prototype.h = 44; -Foo.prototype.i = 45; -Foo.prototype.j = 46; -Foo.prototype.k = 47; - -function foo(o) { - return o.f + o.k; -} - -noInline(foo); - -for (var i = 0; i < 100; ++i) { - var result = foo(new Foo()); - if (result != 89) - throw "Error: bad result for Foo: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/simple-regexp-exec-folding-fail.js b/implementation-contributed/javascriptcore/stress/simple-regexp-exec-folding-fail.js deleted file mode 100644 index 404f27b88e..0000000000 --- a/implementation-contributed/javascriptcore/stress/simple-regexp-exec-folding-fail.js +++ /dev/null @@ -1,11 +0,0 @@ -function foo() { - return /(f)(o)(o)/.exec("bar"); -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(); - if (result !== null) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/simple-regexp-exec-folding.js b/implementation-contributed/javascriptcore/stress/simple-regexp-exec-folding.js deleted file mode 100644 index 9039320227..0000000000 --- a/implementation-contributed/javascriptcore/stress/simple-regexp-exec-folding.js +++ /dev/null @@ -1,19 +0,0 @@ -function foo() { - return /(f)(o)(o)/.exec("foo"); -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(); - if (result.length != 4) - throw "Error: bad result: " + result; - if (result[0] != "foo") - throw "Error: bad result: " + result; - if (result[1] != "f") - throw "Error: bad result: " + result; - if (result[2] != "o") - throw "Error: bad result: " + result; - if (result[3] != "o") - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/simple-regexp-test-folding-fail.js b/implementation-contributed/javascriptcore/stress/simple-regexp-test-folding-fail.js deleted file mode 100644 index b7ec383f69..0000000000 --- a/implementation-contributed/javascriptcore/stress/simple-regexp-test-folding-fail.js +++ /dev/null @@ -1,11 +0,0 @@ -function foo() { - return /(f)(o)(o)/.test("bar"); -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(); - if (result != false) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/simple-regexp-test-folding.js b/implementation-contributed/javascriptcore/stress/simple-regexp-test-folding.js deleted file mode 100644 index ef9b840530..0000000000 --- a/implementation-contributed/javascriptcore/stress/simple-regexp-test-folding.js +++ /dev/null @@ -1,11 +0,0 @@ -function foo() { - return /(f)(o)(o)/.test("foo"); -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(); - if (result != true) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/simplify-varargs-mandatory-minimum-smaller-than-limit.js b/implementation-contributed/javascriptcore/stress/simplify-varargs-mandatory-minimum-smaller-than-limit.js deleted file mode 100644 index df4a352dde..0000000000 --- a/implementation-contributed/javascriptcore/stress/simplify-varargs-mandatory-minimum-smaller-than-limit.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo() { return 42; } - -function bar() { return foo.apply(this, arguments); } - -function baz() { return bar(1, 2, 3); } - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - var result = baz(); - if (result != 42) - throw "Error: bad result: " + result; -} - - diff --git a/implementation-contributed/javascriptcore/stress/singleton-scope-then-overwrite.js b/implementation-contributed/javascriptcore/stress/singleton-scope-then-overwrite.js deleted file mode 100644 index 7f87304a0b..0000000000 --- a/implementation-contributed/javascriptcore/stress/singleton-scope-then-overwrite.js +++ /dev/null @@ -1,20 +0,0 @@ -function foo(a) { - var x = a + 1; - var f = function(a) { - return x + a; - }; - noInline(f); - for (var i = 0; i < 10000; ++i) { - var result = f(i); - if (result != a + 1 + i) - throw "Error: bad result: " + result; - } - x = 999; - var result = f(1); - if (result != 999 + 1) - throw "Error: bad result: " + result; -} - -noInline(foo); -for (var i = 0; i < 3; ++i) - foo(42 + i); diff --git a/implementation-contributed/javascriptcore/stress/singleton-scope-then-realloc-and-overwrite.js b/implementation-contributed/javascriptcore/stress/singleton-scope-then-realloc-and-overwrite.js deleted file mode 100644 index d15c57935d..0000000000 --- a/implementation-contributed/javascriptcore/stress/singleton-scope-then-realloc-and-overwrite.js +++ /dev/null @@ -1,20 +0,0 @@ -function foo(a) { - var x = a + 1; - return function(a) { - return x + a; - }; -} - -var f = foo(42); -noInline(f); - -for (var i = 0; i < 10000; ++i) { - var result = f(i); - if (result != 42 + 1 + i) - throw "Error: bad result: " + result; -} - -var f = foo(43); -var result = f(1); -if (result != 43 + 1 + 1) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/singleton-scope-then-realloc.js b/implementation-contributed/javascriptcore/stress/singleton-scope-then-realloc.js deleted file mode 100644 index a6e1dccb28..0000000000 --- a/implementation-contributed/javascriptcore/stress/singleton-scope-then-realloc.js +++ /dev/null @@ -1,20 +0,0 @@ -function foo(a) { - var x = a + 1; - return function(a) { - return x += a; - }; -} - -var f = foo(42); -noInline(f); - -for (var i = 0; i < 10000; ++i) { - var result = f(1); - if (result != 42 + 1 + i + 1) - throw "Error: bad result: " + result; -} - -var f = foo(43); -var result = f(1); -if (result != 43 + 1 + 1) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check-dfg.js b/implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check-dfg.js deleted file mode 100644 index 8ee2b251d5..0000000000 --- a/implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check-dfg.js +++ /dev/null @@ -1,17 +0,0 @@ -var globalResult; -Object.prototype.valueOf = function() { globalResult = 1; } - -function foo() { - globalResult = 0; - +arguments; - return globalResult; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(); - if (result !== 1) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check-int32-dfg.js b/implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check-int32-dfg.js deleted file mode 100644 index fe645e8c94..0000000000 --- a/implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check-int32-dfg.js +++ /dev/null @@ -1,12 +0,0 @@ -function foo() { - return isInt32(arguments); -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(); - if (result !== false) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check-int32.js b/implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check-int32.js deleted file mode 100644 index 93d6cb1aaf..0000000000 --- a/implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check-int32.js +++ /dev/null @@ -1,24 +0,0 @@ -function foo(p) { - var result = 42; - var o = arguments; - if (p) - result = isInt32(o); - return result; -} - -noInline(foo); - -var result = foo(true); -if (result !== false) - throw "Error: bad result at beginning: " + result; - -for (var i = 0; i < 10000; ++i) { - var result = foo(false); - if (result !== 42) - throw "Error: bad result: " + result; -} - -var result = foo(true); -if (result !== false) - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check-sneakier.js b/implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check-sneakier.js deleted file mode 100644 index eb17c73944..0000000000 --- a/implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check-sneakier.js +++ /dev/null @@ -1,37 +0,0 @@ -function bar(o, p) { - var o2 = {f: 0}; - if (p) - o2.f = o; - return +o2.f; -} - -var globalResult; -Object.prototype.valueOf = function() { globalResult = 1; }; - -function foo(p, q) { - globalResult = 0; - var o = arguments; - if (p) - bar(o, q); - return globalResult; -} - -noInline(foo); - -foo(true, false); - -for (var i = 0; i < 10000; ++i) { - bar(1, true); - bar({}, false); -} - -for (var i = 0; i < 10000; ++i) { - var result = foo(false, true); - if (result !== 0) - throw "Error: bad result: " + result; -} - -var result = foo(true, true); -if (result !== 1) - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check.js b/implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check.js deleted file mode 100644 index 0317f94ac3..0000000000 --- a/implementation-contributed/javascriptcore/stress/sink-arguments-past-invalid-check.js +++ /dev/null @@ -1,23 +0,0 @@ -var globalResult; -Object.prototype.valueOf = function() { globalResult = 1; } - -function foo(p) { - globalResult = 0; - var o = arguments; - if (p) - +o; - return globalResult; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(false); - if (result !== 0) - throw "Error: bad result: " + result; -} - -var result = foo(true); -if (result !== 1) - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/sink-function-past-invalid-check-sneakier.js b/implementation-contributed/javascriptcore/stress/sink-function-past-invalid-check-sneakier.js deleted file mode 100644 index eff3483d8a..0000000000 --- a/implementation-contributed/javascriptcore/stress/sink-function-past-invalid-check-sneakier.js +++ /dev/null @@ -1,35 +0,0 @@ -function bar(o, p) { - if (p) - return +o.f; - return 42; -} - -var globalResult; -Function.prototype.valueOf = function() { globalResult = 1; }; - -function foo(p, q) { - globalResult = 0; - var o = function() { }; - var o2 = {f: o}; - if (p) - bar(o2, q); - return globalResult; -} - -noInline(foo); - -foo(true, false); - -for (var i = 0; i < 10000; ++i) - bar({f:42}, true); - -for (var i = 0; i < 10000; ++i) { - var result = foo(false, true); - if (result !== 0) - throw "Error: bad result: " + result; -} - -var result = foo(true, true); -if (result !== 1) - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/sink-function-past-invalid-check-sneaky.js b/implementation-contributed/javascriptcore/stress/sink-function-past-invalid-check-sneaky.js deleted file mode 100644 index 33d3ec9dd8..0000000000 --- a/implementation-contributed/javascriptcore/stress/sink-function-past-invalid-check-sneaky.js +++ /dev/null @@ -1,13 +0,0 @@ -function foo(p) { - var o = function() { }; - var q = {f: p ? o : 42}; - var tmp = q.f + 1; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) - foo(false); - -foo(true); - diff --git a/implementation-contributed/javascriptcore/stress/sink-multigetbyoffset.js b/implementation-contributed/javascriptcore/stress/sink-multigetbyoffset.js deleted file mode 100644 index 29c4dbbc65..0000000000 --- a/implementation-contributed/javascriptcore/stress/sink-multigetbyoffset.js +++ /dev/null @@ -1,27 +0,0 @@ -// Regression test for https://bugs.webkit.org/show_bug.cgi?id=147165 - -function Foo() { } -Foo.prototype.f = 42; - -function get(o, p) { - if (p) - return o.f; - return 42; -} - -for (var i = 0; i < 100000; ++i) { - get({ f: 42 }, i % 2); - get({ o: 10, f: 42 }, i % 2); -} - -function foo() { - var o = new Foo(); - return get(o, isFinalTier()); -} -noInline(foo); - -for (var i = 0; i < 1000000; ++i) { - var result = foo(); - if (result !== 42) - throw new Error("Result should be 42 but was " + result); -} diff --git a/implementation-contributed/javascriptcore/stress/sink-object-past-invalid-check-int32.js b/implementation-contributed/javascriptcore/stress/sink-object-past-invalid-check-int32.js deleted file mode 100644 index 7a20d4f278..0000000000 --- a/implementation-contributed/javascriptcore/stress/sink-object-past-invalid-check-int32.js +++ /dev/null @@ -1,24 +0,0 @@ -function foo(p) { - var result = 42; - var o = {}; - if (p) - result = isInt32(o); - return result; -} - -noInline(foo); - -var result = foo(true); -if (result !== false) - throw "Error: bad result at end: " + result; - -for (var i = 0; i < 10000; ++i) { - var result = foo(false); - if (result !== 42) - throw "Error: bad result: " + result; -} - -var result = foo(true); -if (result !== false) - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/sink-object-past-invalid-check-sneakier.js b/implementation-contributed/javascriptcore/stress/sink-object-past-invalid-check-sneakier.js deleted file mode 100644 index 147df9817b..0000000000 --- a/implementation-contributed/javascriptcore/stress/sink-object-past-invalid-check-sneakier.js +++ /dev/null @@ -1,32 +0,0 @@ -function bar(o, p) { - if (p) - return +o.f; - return 42; -} - -function foo(p, q) { - var result = 0; - var o = {valueOf: function() { result = 1; }}; - var o2 = {f: o}; - if (p) - bar(o2, q); - return result; -} - -noInline(foo); - -foo(true, false); - -for (var i = 0; i < 10000; ++i) - bar({f:42}, true); - -for (var i = 0; i < 10000; ++i) { - var result = foo(false, true); - if (result !== 0) - throw "Error: bad result: " + result; -} - -var result = foo(true, true); -if (result !== 1) - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/sink-object-past-invalid-check-sneaky.js b/implementation-contributed/javascriptcore/stress/sink-object-past-invalid-check-sneaky.js deleted file mode 100644 index 7b38cef9a4..0000000000 --- a/implementation-contributed/javascriptcore/stress/sink-object-past-invalid-check-sneaky.js +++ /dev/null @@ -1,20 +0,0 @@ -function foo(p) { - var result = 0; - var o = {valueOf: function() { result = 1; }}; - var q = {f: p ? o : 42}; - var tmp = q.f + 1; - return result; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(false); - if (result !== 0) - throw "Error: bad result: " + result; -} - -var result = foo(true); -if (result !== 1) - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/sink-object-past-invalid-check.js b/implementation-contributed/javascriptcore/stress/sink-object-past-invalid-check.js deleted file mode 100644 index 15daa8925d..0000000000 --- a/implementation-contributed/javascriptcore/stress/sink-object-past-invalid-check.js +++ /dev/null @@ -1,20 +0,0 @@ -function foo(p) { - var result = 0; - var o = {valueOf:function() { result = 1; }}; - if (p) - +o; - return result; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(false); - if (result !== 0) - throw "Error: bad result: " + result; -} - -var result = foo(true); -if (result !== 1) - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/sink-phantom-new-array-buffer-exit-ok.js b/implementation-contributed/javascriptcore/stress/sink-phantom-new-array-buffer-exit-ok.js deleted file mode 100644 index d279877050..0000000000 --- a/implementation-contributed/javascriptcore/stress/sink-phantom-new-array-buffer-exit-ok.js +++ /dev/null @@ -1,8 +0,0 @@ -function foo() { -} -function bar() { - foo(...[42]); -} -for (var i = 0; i < 400000; i++) { - bar(); -} diff --git a/implementation-contributed/javascriptcore/stress/sink-put-stack-over-kill-stack.js b/implementation-contributed/javascriptcore/stress/sink-put-stack-over-kill-stack.js deleted file mode 100644 index 151a07d93e..0000000000 --- a/implementation-contributed/javascriptcore/stress/sink-put-stack-over-kill-stack.js +++ /dev/null @@ -1,16 +0,0 @@ -function* avocado_1() {} - -function apricot_0(alpaca_0) { - if (alpaca_0) {} -} - -class __c_0 extends null {} - -function banana_2() { - apricot_0(); - avocado_1(() => null); -} - -for (let i = 0; i < 100000; i++) { - banana_2(); -} diff --git a/implementation-contributed/javascriptcore/stress/sink-to-impossible-multi-get-by-offset-on-prototypes.js b/implementation-contributed/javascriptcore/stress/sink-to-impossible-multi-get-by-offset-on-prototypes.js deleted file mode 100644 index d4340e7d04..0000000000 --- a/implementation-contributed/javascriptcore/stress/sink-to-impossible-multi-get-by-offset-on-prototypes.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; - -function ThingA() { -} - -ThingA.prototype = {bug: 42}; - -function ThingB() { -} - -ThingB.prototype = {bug: 43}; - -function ThingC() { -} - -ThingC.prototype = {bug: 44}; - -function bar(o, p) { - if (p) - return o.bug; - return null; -} - -function foo(p) { - var o = new ThingC(); - return bar(o, p); -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - bar(new ThingA(), true); - bar(new ThingB(), true); -} - -for (var i = 0; i < 10000; ++i) - foo(false); - -var result = foo(true); -if (result != 44) - throw new Error("Bad result: " + result); diff --git a/implementation-contributed/javascriptcore/stress/sink_checkstructure.js b/implementation-contributed/javascriptcore/stress/sink_checkstructure.js deleted file mode 100644 index 2427a63eb5..0000000000 --- a/implementation-contributed/javascriptcore/stress/sink_checkstructure.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo(p, q) { - var o = {}; - if (p) o.f = 42; - if (q) { o.f++; return o; } -} -noInline(foo); - -var expected = foo(false, true).f; - -for (var i = 0; i < 1000000; i++) { - foo(true, true); -} - -var result = foo(false, true).f; - -if (!Object.is(result, expected)) - throw "Error: expected " + expected + "; FTL produced " + result; diff --git a/implementation-contributed/javascriptcore/stress/slightly-more-difficult-to-fold-reflective-arguments-access.js b/implementation-contributed/javascriptcore/stress/slightly-more-difficult-to-fold-reflective-arguments-access.js deleted file mode 100644 index ef44d26362..0000000000 --- a/implementation-contributed/javascriptcore/stress/slightly-more-difficult-to-fold-reflective-arguments-access.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo() { - var a = arguments; - return a[0]; -} - -function bar(x) { - return foo(x); -} - -noInline(bar); - -for (var i = 0; i < 100000; ++i) { - var result = bar(42); - if (result != 42) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/sloppy-mode-function-hoisting.js b/implementation-contributed/javascriptcore/stress/sloppy-mode-function-hoisting.js deleted file mode 100644 index 35b78fb4b3..0000000000 --- a/implementation-contributed/javascriptcore/stress/sloppy-mode-function-hoisting.js +++ /dev/null @@ -1,743 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion."); -} - -function test(f, ...args) { - for (let i = 0; i < 500; i++) - f(...args); -} - -function falsey() { return false; } -noInline(falsey); -function truthy() { return true; } -noInline(truthy); - -test(function() { - var a; - assert(a === undefined); - { - function a() { return 20; } - } - assert(a() === 20); -}); - -test(function(a) { - var a; - assert(a === undefined); - { - function a() { return 20; } - } - assert(a === undefined); -}); - -test(function({a}) { - var a; - assert(a === undefined); - { - function a() { return 20; } - } - assert(a === undefined); -}, {}); - -test(function() { - let a; - assert(a === undefined); - { - function a() { return 20; } - } - assert(a === undefined); -}); - -test(function() { - assert(a === undefined); - function foo() { return a(); } - { - function a() { return 20; } - } - assert(a() === 20); - assert(foo() === 20); -}); - -test(function(a = 30) { - assert(a === 30); - function foo() { return a; } - assert(foo() === 30); - { - function a() { return 20; } - assert(a() === 20); - assert(foo() === 30); - } - assert(a === 30); - assert(foo() === 30); -}); - -test(function() { - let x = 15; - assert(x === 15); - assert(a === undefined); - { - let x = {x: 20}; - function a() { return x; } - assert(a() === x); - assert(a().x === 20); - } - assert(a().x === 20); - assert(x === 15); -}); - -test(function() { - let x = 15; - assert(x === 15); - assert(a === undefined); - let f; - { - let x = {x: 20}; - assert(a() === x); - assert(a().x === 20); - - function a() { throw new Error; } - function a() { return x; } - f = a; - } - assert(a().x === 20); - assert(x === 15); - assert(f().x === 20); -}); - -test(function() { - let x = 15; - let f; - assert(x === 15); - assert(a === undefined); - assert(f === undefined); - { - function a() { return f; } - f = a; - } - assert(x === 15); - assert(f() === f); -}); - -test(function() { - function a() { return 20; } - let f = a; - assert(a() === 20); - { - function a() { return 25; } - assert(a() === 25); - } - assert(f() === 20); - assert(a() === 25); -}); - -test(function() { - assert(f === undefined); - for (let i = 0; i < 10; i++) { - function f() { return i; } - assert(f() === i); - } - assert(f() === 9); -}); - -test(function() { - assert(f === undefined); - let nums = [0, 1, 2, 3]; - for (let i of nums) { - function f() { return i; } - assert(f() === i); - } - assert(f() === 3); -}); - -test(function() { - assert(f === undefined); - let obj = {0:0, 1:1, 2:2, 3:3}; - for (let i in obj) { - function f() { return i; } - assert(f() === i); - } - assert(f() === "3"); -}); - -test(function() { - assert(f === undefined); - let nums = [0, 1, 2, 3]; - let funcs = [] - for (let i of nums) { - function f() { return i; } - funcs.push(f); - assert(f() === i); - } - assert(f() === 3); - assert(funcs.length === nums.length); - for (let i = 0; i < funcs.length; i++) { - assert(funcs[i]() === nums[i]); - } -}); - -test(function() { - assert(f === undefined); - try { - throw new Error("foo"); - } catch(e) { - function f() { return 20; } - } - assert(f() === 20); -}); - -test(function() { - assert(f === undefined); - try { - ; - } catch(e) { - function f() { return 20; } - } - assert(f === undefined); -}); - -test(function() { - assert(foo === undefined); - if (falsey()) { - function foo() { return 20; } - } - assert(foo === undefined); -}); - -test(function() { - assert(foo === undefined); - if (falsey()) - function foo() { return 20; } - assert(foo === undefined); -}); - -test(function() { - assert(foo === undefined); - if (truthy()) { - function foo() { return 20; } - } - assert(foo() === 20); -}); - -test(function() { - assert(foo === undefined); - while (truthy()) { - assert(foo() === 20); - break; - - function foo() { return 20; } - } - assert(foo === undefined); -}); - -test(function() { - assert(foo === undefined); - while (truthy()) { - assert(foo() === 20); - function foo() { return 20; } - break; - } - assert(foo() === 20); -}); - -test(function() { - function bar() { return foo; } - assert(foo === undefined); - assert(bar() === undefined); - while (truthy()) { - break; - - function foo() { return 20; } - } - assert(foo === undefined); - assert(bar() === undefined); -}); - -test(function() { - function bar() { return foo; } - assert(foo === undefined); - assert(bar() === undefined); - while (truthy()) { - function foo() { return 20; } - break; - } - assert(foo() === 20); - assert(bar()() === 20); -}); - -test(function() { - function bar() { return foo; } - assert(foo === undefined); - assert(bar() === undefined); - while (falsey()) { - function foo() { return 20; } - } - assert(foo === undefined); - assert(bar() === undefined); -}); - -test(function() { - var a = "a"; - assert(a === "a"); - { - let b = 1; - assert(a === "a"); - { - let c = 2; - assert(a === "a"); - { - let d = 3; - function a() { return b + c+ d; } - assert(a() === 6); - } - assert(a() === 6); - } - assert(a() === 6); - } - assert(a() === 6); -}); - -test(function() { - assert(foo === undefined); - switch(1) { - case 0: - function foo() { return 20; } - break; - case 1: - assert(foo() === 20); - break; - } - assert(foo === undefined); -}); - -test(function() { - assert(foo === undefined); - switch(1) { - case 1: - assert(foo() === 20); - case 0: - function foo() { return 20; } - break; - } - assert(foo() === 20); -}); - -test(function() { - assert(foo === undefined); - switch(1) { - case 0:{ - function foo() { return 20; } - break; - } - } - assert(foo === undefined); -}); - -test(function() { - assert(foo === undefined); - switch(0) { - case 0:{ - function foo() { return 20; } - break; - } - } - assert(foo() === 20); -}); - -test(function() { - assert(foo === undefined); - switch(0) { - case 0: - function foo() { return bar; } - break; - case 1: - let bar = 20; - break; - } - - let threw = false; - try { - foo(); - } catch (e) { - assert(e instanceof ReferenceError); - threw = true; - } - assert(threw); -}); - -test(function() { - assert(foo === undefined); - switch(0) { - case 0: - function foo() { return bar; } - case 1: - let bar = 20; - break; - } - - assert(foo() === 20); -}); - -test(function() { - assert(foo === undefined); - switch(1) { - case 0: - function foo() { return bar; } - case 1: - let bar = 20; - assert(foo() === 20); - break; - } - - assert(foo === undefined); -}); - -test(function() { - function capFoo1() { return foo; } - assert(foo === undefined); - assert(capFoo1() === undefined); - switch(1) { - case 0: - function foo() { return bar; } - function capFoo2() { return foo; } - case 1: - let bar = 20; - assert(foo() === 20); - assert(capFoo1() === undefined); - assert(capFoo2() === foo); - assert(capFoo2()() === 20); - break; - } - - assert(foo === undefined); -}); - -test(function() { - assert(foo === undefined); - switch(1) { - case 1: - let bar = 20; - assert(foo() === 20); - case 0: - function foo() { return bar; } - } - - assert(foo() === 20); -}); - -test(function(a) { - assert(a === 25); - switch(1) { - case 0: - function a() { return bar; } - case 1: - let bar = 20; - assert(a() === 20); - break; - } - - assert(a === 25); -}, 25); - -test(function() { - let a = 25; - assert(a === 25); - switch(1) { - case 0: - function a() { return bar; } - case 1: - let bar = 20; - assert(a() === 20); - break; - } - - assert(a === 25); -}); - -test(function() { - const a = 25; - assert(a === 25); - switch(1) { - case 0: - function a() { return bar; } - case 1: - let bar = 20; - assert(a() === 20); - break; - } - - assert(a === 25); -}); - -test(function() { - let foo = {}; - class a { constructor() { return foo; } } - assert(new a === foo); - switch(1) { - case 0: - function a() { return bar; } - case 1: - let bar = 20; - assert(a() === 20); - break; - } - - assert(new a === foo); -}); - -test(function() { - assert(f === undefined); - { - if (true) - function f() { return 20; } - assert(f() === 20); - } - assert(f() === 20); -}); - -test(function() { - assert(f === undefined); - { - if (false) - function f() { return 20; } - assert(f === undefined); - } - assert(f === undefined); -}); - -test(function() { - var x; - assert(f === undefined); - if (true) - if (true) - if (true) - function f() { return 20; } - assert(f() === 20); -}); - -test(function() { - var x; - assert(f === undefined); - { - if (true) - if (false) - if (true) - function f() { return 20; } - } - assert(f === undefined); -}); - -test(function() { - var x; - assert(f === undefined); - { - while (false) - while (false) - if (true) - function f() { return 20; } - } - assert(f === undefined); -}); - -test(function() { - assert(f === undefined); - var f = 20; - assert(f === 20); - while (false) - while (false) - if (true) - function f() { return 20; } - assert(f === 20); -}); - -test(function() { - assert(f === undefined); - var f = 20; - assert(f === 20); - var i = 2; - { - while (i-- > 0) - while (i-- > 0) - if (true) - function f() { return 20; } - } - assert(f() === 20); -}); - -test(function() { - assert(f === undefined); - var f = 20; - assert(f === 20); - var i = 2; - { - while (i-- > 0) - while (i-- > 0) - if (false) - function f() { return 20; } - } - assert(f === 20); -}); - -test(function() { - assert(f === undefined); - var f = 20; - assert(f === 20); - var i = 2; - { - while (i-- > 0) - while (i-- > 0) - if (false) - function f() { return 20; } - else - function f() { return 30; } - } - assert(f() === 30); -}); - -test(function() { - assert(f === undefined); - if (true) { - label: function f() { return 20; } - } - assert(f() === 20); -}); - -test(function() { - assert(f === undefined); - if (true) { - label: label2: label3: function f() { return 20; } - } - assert(f() === 20); -}); - -test(function() { - assert(a === undefined); - assert(b === undefined); - assert(c === undefined); - assert(d === undefined); - assert(e === undefined); - assert(f === undefined); - assert(g === undefined); - assert(h === undefined); - assert(i === undefined); - assert(j === undefined); - assert(k === undefined); - assert(l === undefined); - assert(m === undefined); - assert(n === undefined); - assert(o === undefined); - assert(p === undefined); - assert(q === undefined); - assert(r === undefined); - assert(s === undefined); - assert(t === undefined); - assert(u === undefined); - assert(v === undefined); - assert(w === undefined); - assert(x === undefined); - assert(y === undefined); - assert(z === undefined); - { - function a() { } - function b() { } - function c() { } - function d() { } - function e() { } - function f() { } - function g() { } - function h() { } - function i() { } - function j() { } - function k() { } - function l() { } - function m() { } - function n() { } - function o() { } - function p() { } - function q() { } - function r() { } - function s() { } - function t() { } - function u() { } - function v() { } - function w() { } - function x() { } - function y() { } - function z() { } - } - assert(typeof a === "function"); - assert(typeof b === "function"); - assert(typeof c === "function"); - assert(typeof d === "function"); - assert(typeof e === "function"); - assert(typeof f === "function"); - assert(typeof g === "function"); - assert(typeof h === "function"); - assert(typeof i === "function"); - assert(typeof j === "function"); - assert(typeof k === "function"); - assert(typeof l === "function"); - assert(typeof m === "function"); - assert(typeof n === "function"); - assert(typeof o === "function"); - assert(typeof p === "function"); - assert(typeof q === "function"); - assert(typeof r === "function"); - assert(typeof s === "function"); - assert(typeof t === "function"); - assert(typeof u === "function"); - assert(typeof v === "function"); - assert(typeof w === "function"); - assert(typeof x === "function"); - assert(typeof y === "function"); - assert(typeof z === "function"); -}); - -test(function() { - function outer() { return f; } - assert(outer() === undefined); - { - assert(outer() === undefined); - assert(f() === 2); - f = 100 - assert(outer() === undefined); - function f() { return 1 } - assert(outer() === 100); - f = 200 - assert(outer() === 100); // 100 - function f() { return 2 } - assert(outer() === 200); - } -}); - -for (let i = 0; i < 500; i++) - assert(foo() === 25); -function foo() { return 20; } - -{ - function foo() { return 25; } - assert(foo() === 25); -} -assert(foo() === 25); - -for (let i = 0; i < 500; i++) - assert(bar() === "bar2"); -function bar() { return "bar1"; } -if (falsey()) { - { - if (falsey()) { - function bar() { return "bar2"; } - } - } -} -assert(bar() === "bar2"); - -for (let i = 0; i < 500; i++) - assert(baz() === "baz2"); -function baz() { return "baz1"; } -while (falsey()) { - if (falsey()) { - function baz() { return "baz2"; } - } -} -assert(baz() === "baz2"); diff --git a/implementation-contributed/javascriptcore/stress/sloppy-mode-hoist-arguments-function-non-simple-parameter-list.js b/implementation-contributed/javascriptcore/stress/sloppy-mode-hoist-arguments-function-non-simple-parameter-list.js deleted file mode 100644 index 682f25d6ef..0000000000 --- a/implementation-contributed/javascriptcore/stress/sloppy-mode-hoist-arguments-function-non-simple-parameter-list.js +++ /dev/null @@ -1,158 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} - -(function (x = 20) { - var a; - assert(arguments.length === 0); - assert(typeof arguments !== "function"); - { - function arguments() { - } - - function b() { - var g = 1; - a[5]; - } - } - assert(typeof arguments === "function"); -}()); - -(function (x = () => arguments) { - var a; - let originalArguments = x(); - assert(originalArguments === arguments); - let z; - { - function arguments() { return 25; } - z = arguments; - - function b() { - var g = 1; - a[5]; - } - } - assert(z !== originalArguments); - assert(x() === z); - assert(typeof z === "function"); - assert(z() === 25); -}()); - -(function ({arguments}) { - assert(arguments === 20); - - var a; - { - function arguments() { return 25; } - assert(arguments() === 25); - - function b() { - var g = 1; - a[5]; - } - } - - assert(arguments === 20); -}({arguments: 20})); - -(function (y = () => arguments, {arguments}) { - assert(y() === arguments); - var a; - { - function arguments() { return 25; } - assert(arguments() === 25); - assert(y() !== arguments); - - function b() { - var g = 1; - a[5]; - } - } - - assert(y() === arguments); -}(undefined, {arguments: {}})); - -(function (y = () => arguments, z = y(), {arguments}) { - assert(typeof z === "object"); - assert(z.length === 3); - assert(z[0] === undefined); - assert(z[1] === undefined); - assert(typeof z[2] === "object"); - assert(z[2].arguments === arguments); - assert(y() === arguments); - - var a; - { - function arguments() { return 25; } - assert(arguments() === 25); - assert(y() !== arguments); - - function b() { - var g = 1; - a[5]; - } - } - - assert(y() === arguments); -}(undefined, undefined, {arguments: {}})); - -(function (arguments) { - assert(arguments === 25); - - var a; - { - function arguments() { return 30; } - assert(arguments() === 30); - - function b() { - var g = 1; - a[5]; - } - } - - assert(arguments === 25); -}(25)); - -(function (arguments) { - assert(arguments === 25); - let foo = () => arguments; - assert(foo() === arguments); - - var a; - { - function arguments() { return 30; } - assert(arguments() === 30); - assert(foo() === 25); - - function b() { - var g = 1; - a[5]; - } - } - - assert(arguments === 25); - assert(foo() === arguments); -}(25)); - -(function () { - assert(arguments.length === 1); - assert(arguments[0] === 25); - - let outer = () => arguments; - var a; - { - assert(outer()[0] === 25); - function arguments() { return 30; } - assert(outer() === arguments); - assert(outer()() === 30); - assert(arguments() === 30); - - function b() { - var g = 1; - a[5]; - } - } - - assert(arguments() === 30); -}(25)); diff --git a/implementation-contributed/javascriptcore/stress/slow-path-generator-updating-current-node-dfg.js b/implementation-contributed/javascriptcore/stress/slow-path-generator-updating-current-node-dfg.js deleted file mode 100644 index 32e92636ab..0000000000 --- a/implementation-contributed/javascriptcore/stress/slow-path-generator-updating-current-node-dfg.js +++ /dev/null @@ -1,27 +0,0 @@ -// FIXME: Bring back something like the deferGC probability mode. -// https://bugs.webkit.org/show_bug.cgi?id=166627 -//@ skip -// //@ runFTLNoCJIT("--deferGCShouldCollectWithProbability=true", "--deferGCProbability=1.0") - -function foo(a) { - return a.push(25); -} - -function bar(a) { - for (let i = 0; i < a.length; i++) { - a[i] = i; - } - return foo(a); -} - -noInline(bar); - -for (let i = 0; i < 100; i++) { - let smallArray = [1, 2, 3, 4, 5]; - bar(smallArray); -} - -let largeArray = []; -for (let i = 0; i < 10000000; i++) - largeArray.push(i); -bar(largeArray); diff --git a/implementation-contributed/javascriptcore/stress/sort-array-with-undecided.js b/implementation-contributed/javascriptcore/stress/sort-array-with-undecided.js deleted file mode 100644 index 4a009439f0..0000000000 --- a/implementation-contributed/javascriptcore/stress/sort-array-with-undecided.js +++ /dev/null @@ -1 +0,0 @@ -new Array(100).sort(function(a, b) { return a - b; }); diff --git a/implementation-contributed/javascriptcore/stress/sorting-boolean-result-comparator.js b/implementation-contributed/javascriptcore/stress/sorting-boolean-result-comparator.js deleted file mode 100644 index 80a091c0ab..0000000000 --- a/implementation-contributed/javascriptcore/stress/sorting-boolean-result-comparator.js +++ /dev/null @@ -1,15 +0,0 @@ -function checkArray(array) { - array = array.map((value, index) => { return { value, index }; }); - array = array.sort((a, b) => b.value <= a.value); - - for (let i = 1; i < array.length; i++) { - if (array[i].value < array[i - 1].value) - throw new Error(); - - if (array[i].value == array[i - 1].value && array[i].index <= array[i - 1].index) - throw new Error(); - } -} - -checkArray([7,4,2,0,5,5,4,3,9]); -checkArray([1,0,1]); diff --git a/implementation-contributed/javascriptcore/stress/source-origin.js b/implementation-contributed/javascriptcore/stress/source-origin.js deleted file mode 100644 index 14b3aec4eb..0000000000 --- a/implementation-contributed/javascriptcore/stress/source-origin.js +++ /dev/null @@ -1,11 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -shouldBe(callerSourceOrigin().endsWith('source-origin.js'), true); -shouldBe([ 0 ].map(callerSourceOrigin)[0].endsWith('source-origin.js'), true); -shouldBe(eval(`callerSourceOrigin()`).endsWith('source-origin.js'), true); -shouldBe((0, eval)(`callerSourceOrigin()`).endsWith('source-origin.js'), true); -shouldBe((new Function(`return callerSourceOrigin()`))().endsWith('source-origin.js'), true); -shouldBe((Function(`return callerSourceOrigin()`))().endsWith('source-origin.js'), true); diff --git a/implementation-contributed/javascriptcore/stress/sparse-define-empty-descriptor.js b/implementation-contributed/javascriptcore/stress/sparse-define-empty-descriptor.js deleted file mode 100644 index 6f9de14e3e..0000000000 --- a/implementation-contributed/javascriptcore/stress/sparse-define-empty-descriptor.js +++ /dev/null @@ -1,6 +0,0 @@ -var array = []; -array[10000000] = 42; -Object.defineProperty(array, 10000000, {configurable: true, enumerable: true, writable: true}); -var result = array[10000000]; -if (result != 42) - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/sparse-map-non-overlapping.js b/implementation-contributed/javascriptcore/stress/sparse-map-non-overlapping.js deleted file mode 100644 index 4723365c82..0000000000 --- a/implementation-contributed/javascriptcore/stress/sparse-map-non-overlapping.js +++ /dev/null @@ -1,26 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testing(object) { - var value = object[1000]; - shouldBe(object[1000], 42); -} - -testing({ - 0: 0, - 1: 1, - 1000: 42 -}); - -var object = { - 0: 0, - get 1000() { - return 42; - }, - 1: 1, -}; -testing(object); -shouldBe(object[0], 0); -shouldBe(object[1], 1); diff --git a/implementation-contributed/javascriptcore/stress/sparse-map-non-skip-getter-overriding.js b/implementation-contributed/javascriptcore/stress/sparse-map-non-skip-getter-overriding.js deleted file mode 100644 index 48bf81c5a4..0000000000 --- a/implementation-contributed/javascriptcore/stress/sparse-map-non-skip-getter-overriding.js +++ /dev/null @@ -1,21 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var obj = { - 0: 0, - 1: 1, - get 1() { - return 42; - } -}; - -function testing(object) { - shouldBe(object[1], 42); - shouldBe(obj[0], 0); -} -noInline(testing); - -for (var i = 0; i < 10000; ++i) - testing(obj); diff --git a/implementation-contributed/javascriptcore/stress/sparse-map-non-skip.js b/implementation-contributed/javascriptcore/stress/sparse-map-non-skip.js deleted file mode 100644 index fb37d458c0..0000000000 --- a/implementation-contributed/javascriptcore/stress/sparse-map-non-skip.js +++ /dev/null @@ -1,44 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function testing(object) { - shouldBe(object[0], 0); - shouldBe(object[1], 1); - shouldBe(object[2], "String"); -} -noInline(testing); - -function testing2(object) { - shouldBe(object[0], 0); - shouldBe(object[1], 1); - shouldBe(object[2], "String"); -} -noInline(testing2); - -for (var i = 0; i < 10000; ++i) - testing({ - 0: 0, - 1: 1, - 2: "String" - }); - -testing({ - 0: 0, - get 1() { - return 1; - }, - 2: "String" -}); - -for (var i = 0; i < 10000; ++i) - testing2({ - 0: 0, - get 1() { - return 1; - }, - 2: "String" - }); - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/implementation-contributed/javascriptcore/stress/sparse_splice.js b/implementation-contributed/javascriptcore/stress/sparse_splice.js deleted file mode 100644 index 6565dd4e52..0000000000 --- a/implementation-contributed/javascriptcore/stress/sparse_splice.js +++ /dev/null @@ -1,12 +0,0 @@ -var myArray = Array(); -myArray[ 10000 ] = "a"; -myArray[ 10001 ] = "b"; -myArray[ 10002 ] = "c"; - -// remove element at index 1001 -myArray.splice( 10001, 1 ); - -if (myArray[10000] != "a") - throw "Splicing Error! start index changed"; -if (myArray[10001] != "c") - throw "Splicing Error! removed element not removed"; diff --git a/implementation-contributed/javascriptcore/stress/spec-empty-flows-through-cell-checks.js b/implementation-contributed/javascriptcore/stress/spec-empty-flows-through-cell-checks.js deleted file mode 100644 index ebf6019895..0000000000 --- a/implementation-contributed/javascriptcore/stress/spec-empty-flows-through-cell-checks.js +++ /dev/null @@ -1,24 +0,0 @@ -// This test shouldn't crash. - -class A { }; - -class B extends A { - constructor(a, b) { - var f = () => b ? this : {}; - if (a) { - var val = f() == super(); - } else { - super(); - var val = f(); - } - } -}; - -for (var i=0; i < 10000; i++) { - try { - new B(true, true); - } catch (e) { - } - var a = new B(false, true); - var c = new B(true, false); -} diff --git a/implementation-contributed/javascriptcore/stress/splay-flash-access-1ms.js b/implementation-contributed/javascriptcore/stress/splay-flash-access-1ms.js deleted file mode 100644 index 2010ec2c31..0000000000 --- a/implementation-contributed/javascriptcore/stress/splay-flash-access-1ms.js +++ /dev/null @@ -1,903 +0,0 @@ -//@ skip if $memoryLimited -//@ runNoisyTestDefault -//@ runNoisyTestNoCJIT - -// Copyright 2013 the V8 project authors. All rights reserved. -// Copyright (C) 2015 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: -// -// * 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. - - -// Performance.now is used in latency benchmarks, the fallback is Date.now. -var performance = performance || {}; -performance.now = (function() { - return performance.now || - performance.mozNow || - performance.msNow || - performance.oNow || - performance.webkitNow || - Date.now; -})(); - -// Simple framework for running the benchmark suites and -// computing a score based on the timing measurements. - - -// A benchmark has a name (string) and a function that will be run to -// do the performance measurement. The optional setup and tearDown -// arguments are functions that will be invoked before and after -// running the benchmark, but the running time of these functions will -// not be accounted for in the benchmark score. -function Benchmark(name, doWarmup, doDeterministic, run, setup, tearDown, latencyResult, minIterations) { - this.name = name; - this.doWarmup = doWarmup; - this.doDeterministic = doDeterministic; - this.run = run; - this.Setup = setup ? setup : function() { }; - this.TearDown = tearDown ? tearDown : function() { }; - this.latencyResult = latencyResult ? latencyResult : null; - this.minIterations = minIterations ? minIterations : 32; -} - - -// Benchmark results hold the benchmark and the measured time used to -// run the benchmark. The benchmark score is computed later once a -// full benchmark suite has run to completion. If latency is set to 0 -// then there is no latency score for this benchmark. -function BenchmarkResult(benchmark, time, latency) { - this.benchmark = benchmark; - this.time = time; - this.latency = latency; -} - - -// Automatically convert results to numbers. Used by the geometric -// mean computation. -BenchmarkResult.prototype.valueOf = function() { - return this.time; -} - - -// Suites of benchmarks consist of a name and the set of benchmarks in -// addition to the reference timing that the final score will be based -// on. This way, all scores are relative to a reference run and higher -// scores implies better performance. -function BenchmarkSuite(name, reference, benchmarks) { - this.name = name; - this.reference = reference; - this.benchmarks = benchmarks; - BenchmarkSuite.suites.push(this); -} - - -// Keep track of all declared benchmark suites. -BenchmarkSuite.suites = []; - -// Scores are not comparable across versions. Bump the version if -// you're making changes that will affect that scores, e.g. if you add -// a new benchmark or change an existing one. -BenchmarkSuite.version = '9'; - -// Override the alert function to throw an exception instead. -alert = function(s) { - throw "Alert called with argument: " + s; -}; - - -// To make the benchmark results predictable, we replace Math.random -// with a 100% deterministic alternative. -BenchmarkSuite.ResetRNG = function() { - Math.random = (function() { - var seed = 49734321; - return function() { - // Robert Jenkins' 32 bit integer hash function. - seed = ((seed + 0x7ed55d16) + (seed << 12)) & 0xffffffff; - seed = ((seed ^ 0xc761c23c) ^ (seed >>> 19)) & 0xffffffff; - seed = ((seed + 0x165667b1) + (seed << 5)) & 0xffffffff; - seed = ((seed + 0xd3a2646c) ^ (seed << 9)) & 0xffffffff; - seed = ((seed + 0xfd7046c5) + (seed << 3)) & 0xffffffff; - seed = ((seed ^ 0xb55a4f09) ^ (seed >>> 16)) & 0xffffffff; - return (seed & 0xfffffff) / 0x10000000; - }; - })(); -} - - -// Runs all registered benchmark suites and optionally yields between -// each individual benchmark to avoid running for too long in the -// context of browsers. Once done, the final score is reported to the -// runner. -BenchmarkSuite.RunSuites = function(runner) { - var continuation = null; - var suites = BenchmarkSuite.suites; - var length = suites.length; - BenchmarkSuite.scores = []; - var index = 0; - function RunStep() { - while (continuation || index < length) { - if (continuation) { - continuation = continuation(); - } else { - var suite = suites[index++]; - if (runner.NotifyStart) runner.NotifyStart(suite.name); - continuation = suite.RunStep(runner); - } - if (continuation && typeof window != 'undefined' && window.setTimeout) { - window.setTimeout(RunStep, 25); - return; - } - } - - // show final result - if (runner.NotifyScore) { - var score = BenchmarkSuite.GeometricMean(BenchmarkSuite.scores); - var formatted = BenchmarkSuite.FormatScore(100 * score); - runner.NotifyScore(formatted); - } - } - RunStep(); -} - - -// Counts the total number of registered benchmarks. Useful for -// showing progress as a percentage. -BenchmarkSuite.CountBenchmarks = function() { - var result = 0; - var suites = BenchmarkSuite.suites; - for (var i = 0; i < suites.length; i++) { - result += suites[i].benchmarks.length; - } - return result; -} - - -// Computes the geometric mean of a set of numbers. -BenchmarkSuite.GeometricMean = function(numbers) { - var log = 0; - for (var i = 0; i < numbers.length; i++) { - log += Math.log(numbers[i]); - } - return Math.pow(Math.E, log / numbers.length); -} - - -// Computes the geometric mean of a set of throughput time measurements. -BenchmarkSuite.GeometricMeanTime = function(measurements) { - var log = 0; - for (var i = 0; i < measurements.length; i++) { - log += Math.log(measurements[i].time); - } - return Math.pow(Math.E, log / measurements.length); -} - - -// Computes the average of the worst samples. For example, if percentile is 99, this will report the -// average of the worst 1% of the samples. -BenchmarkSuite.AverageAbovePercentile = function(numbers, percentile) { - // Don't change the original array. - numbers = numbers.slice(); - - // Sort in ascending order. - numbers.sort(function(a, b) { return a - b; }); - - // Now the elements we want are at the end. Keep removing them until the array size shrinks too much. - // Examples assuming percentile = 99: - // - // - numbers.length starts at 100: we will remove just the worst entry and then not remove anymore, - // since then numbers.length / originalLength = 0.99. - // - // - numbers.length starts at 1000: we will remove the ten worst. - // - // - numbers.length starts at 10: we will remove just the worst. - var numbersWeWant = []; - var originalLength = numbers.length; - while (numbers.length / originalLength > percentile / 100) - numbersWeWant.push(numbers.pop()); - - var sum = 0; - for (var i = 0; i < numbersWeWant.length; ++i) - sum += numbersWeWant[i]; - - var result = sum / numbersWeWant.length; - - // Do a sanity check. - if (numbers.length && result < numbers[numbers.length - 1]) { - throw "Sanity check fail: the worst case result is " + result + - " but we didn't take into account " + numbers; - } - - return result; -} - - -// Computes the geometric mean of a set of latency measurements. -BenchmarkSuite.GeometricMeanLatency = function(measurements) { - var log = 0; - var hasLatencyResult = false; - for (var i = 0; i < measurements.length; i++) { - if (measurements[i].latency != 0) { - log += Math.log(measurements[i].latency); - hasLatencyResult = true; - } - } - if (hasLatencyResult) { - return Math.pow(Math.E, log / measurements.length); - } else { - return 0; - } -} - - -// Converts a score value to a string with at least three significant -// digits. -BenchmarkSuite.FormatScore = function(value) { - if (value > 100) { - return value.toFixed(0); - } else { - return value.toPrecision(3); - } -} - -// Notifies the runner that we're done running a single benchmark in -// the benchmark suite. This can be useful to report progress. -BenchmarkSuite.prototype.NotifyStep = function(result) { - this.results.push(result); - if (this.runner.NotifyStep) this.runner.NotifyStep(result.benchmark.name); -} - - -// Notifies the runner that we're done with running a suite and that -// we have a result which can be reported to the user if needed. -BenchmarkSuite.prototype.NotifyResult = function() { - var mean = BenchmarkSuite.GeometricMeanTime(this.results); - var score = this.reference[0] / mean; - BenchmarkSuite.scores.push(score); - if (this.runner.NotifyResult) { - var formatted = BenchmarkSuite.FormatScore(100 * score); - this.runner.NotifyResult(this.name, formatted); - } - if (this.reference.length == 2) { - var meanLatency = BenchmarkSuite.GeometricMeanLatency(this.results); - if (meanLatency != 0) { - var scoreLatency = this.reference[1] / meanLatency; - BenchmarkSuite.scores.push(scoreLatency); - if (this.runner.NotifyResult) { - var formattedLatency = BenchmarkSuite.FormatScore(100 * scoreLatency) - this.runner.NotifyResult(this.name + "Latency", formattedLatency); - } - } - } -} - - -// Notifies the runner that running a benchmark resulted in an error. -BenchmarkSuite.prototype.NotifyError = function(error) { - if (this.runner.NotifyError) { - this.runner.NotifyError(this.name, error); - } - if (this.runner.NotifyStep) { - this.runner.NotifyStep(this.name); - } -} - - -// Runs a single benchmark for at least a second and computes the -// average time it takes to run a single iteration. -BenchmarkSuite.prototype.RunSingleBenchmark = function(benchmark, data) { - function Measure(data) { - var elapsed = 0; - var start = new Date(); - - // Run either for 1 second or for the number of iterations specified - // by minIterations, depending on the config flag doDeterministic. - for (var i = 0; (benchmark.doDeterministic ? - i<benchmark.minIterations : elapsed < 1000); i++) { - benchmark.run(); - elapsed = new Date() - start; - } - if (data != null) { - data.runs += i; - data.elapsed += elapsed; - } - } - - // Sets up data in order to skip or not the warmup phase. - if (!benchmark.doWarmup && data == null) { - data = { runs: 0, elapsed: 0 }; - } - - if (data == null) { - Measure(null); - return { runs: 0, elapsed: 0 }; - } else { - Measure(data); - // If we've run too few iterations, we continue for another second. - if (data.runs < benchmark.minIterations) return data; - var usec = (data.elapsed * 1000) / data.runs; - var latencySamples = (benchmark.latencyResult != null) ? benchmark.latencyResult() : [0]; - var percentile = 99.5; - var latency = BenchmarkSuite.AverageAbovePercentile(latencySamples, percentile) * 1000; - this.NotifyStep(new BenchmarkResult(benchmark, usec, latency)); - return null; - } -} - - -// This function starts running a suite, but stops between each -// individual benchmark in the suite and returns a continuation -// function which can be invoked to run the next benchmark. Once the -// last benchmark has been executed, null is returned. -BenchmarkSuite.prototype.RunStep = function(runner) { - BenchmarkSuite.ResetRNG(); - this.results = []; - this.runner = runner; - var length = this.benchmarks.length; - var index = 0; - var suite = this; - var data; - - // Run the setup, the actual benchmark, and the tear down in three - // separate steps to allow the framework to yield between any of the - // steps. - - function RunNextSetup() { - if (index < length) { - try { - suite.benchmarks[index].Setup(); - } catch (e) { - suite.NotifyError(e); - return null; - } - return RunNextBenchmark; - } - suite.NotifyResult(); - return null; - } - - function RunNextBenchmark() { - try { - data = suite.RunSingleBenchmark(suite.benchmarks[index], data); - } catch (e) { - suite.NotifyError(e); - return null; - } - // If data is null, we're done with this benchmark. - return (data == null) ? RunNextTearDown : RunNextBenchmark(); - } - - function RunNextTearDown() { - try { - suite.benchmarks[index++].TearDown(); - } catch (e) { - suite.NotifyError(e); - return null; - } - return RunNextSetup; - } - - // Start out running the setup. - return RunNextSetup(); -} -// Copyright 2009 the V8 project authors. All rights reserved. -// Copyright (C) 2015 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: -// -// * 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. - -// This benchmark is based on a JavaScript log processing module used -// by the V8 profiler to generate execution time profiles for runs of -// JavaScript applications, and it effectively measures how fast the -// JavaScript engine is at allocating nodes and reclaiming the memory -// used for old nodes. Because of the way splay trees work, the engine -// also has to deal with a lot of changes to the large tree object -// graph. - -var Splay = new BenchmarkSuite('Splay', [81491, 2739514], [ - new Benchmark("Splay", true, false, - SplayRun, SplaySetup, SplayTearDown, SplayLatency) -]); - - -// Configuration. -var kSplayTreeSize = 8000; -var kSplayTreeModifications = 80; -var kSplayTreePayloadDepth = 5; - -var splayTree = null; -var splaySampleTimeStart = 0.0; - -function GeneratePayloadTree(depth, tag) { - if (depth == 0) { - return { - array : [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], - string : 'String for key ' + tag + ' in leaf node' - }; - } else { - return { - left: GeneratePayloadTree(depth - 1, tag), - right: GeneratePayloadTree(depth - 1, tag) - }; - } -} - - -function GenerateKey() { - // The benchmark framework guarantees that Math.random is - // deterministic; see base.js. - return Math.random(); -} - -var splaySamples = []; - -function SplayLatency() { - return splaySamples; -} - -function SplayUpdateStats(time) { - var pause = time - splaySampleTimeStart; - splaySampleTimeStart = time; - splaySamples.push(pause); -} - -function InsertNewNode() { - // Insert new node with a unique key. - var key; - do { - key = GenerateKey(); - } while (splayTree.find(key) != null); - var payload = GeneratePayloadTree(kSplayTreePayloadDepth, String(key)); - splayTree.insert(key, payload); - return key; -} - - -function SplaySetup() { - // Check if the platform has the performance.now high resolution timer. - // If not, throw exception and quit. - if (!performance.now) { - throw "PerformanceNowUnsupported"; - } - - splayTree = new SplayTree(); - splaySampleTimeStart = performance.now() - for (var i = 0; i < kSplayTreeSize; i++) { - InsertNewNode(); - if ((i+1) % 20 == 19) { - SplayUpdateStats(performance.now()); - } - } -} - - -function SplayTearDown() { - // Allow the garbage collector to reclaim the memory - // used by the splay tree no matter how we exit the - // tear down function. - var keys = splayTree.exportKeys(); - splayTree = null; - - splaySamples = []; - - // Verify that the splay tree has the right size. - var length = keys.length; - if (length != kSplayTreeSize) { - throw new Error("Splay tree has wrong size"); - } - - // Verify that the splay tree has sorted, unique keys. - for (var i = 0; i < length - 1; i++) { - if (keys[i] >= keys[i + 1]) { - throw new Error("Splay tree not sorted"); - } - } -} - - -function SplayRun() { - // Replace a few nodes in the splay tree. - for (var i = 0; i < kSplayTreeModifications; i++) { - var key = InsertNewNode(); - var greatest = splayTree.findGreatestLessThan(key); - if (greatest == null) splayTree.remove(key); - else splayTree.remove(greatest.key); - } - SplayUpdateStats(performance.now()); -} - - -/** - * Constructs a Splay tree. A splay tree is a self-balancing binary - * search tree with the additional property that recently accessed - * elements are quick to access again. It performs basic operations - * such as insertion, look-up and removal in O(log(n)) amortized time. - * - * @constructor - */ -function SplayTree() { -}; - - -/** - * Pointer to the root node of the tree. - * - * @type {SplayTree.Node} - * @private - */ -SplayTree.prototype.root_ = null; - - -/** - * @return {boolean} Whether the tree is empty. - */ -SplayTree.prototype.isEmpty = function() { - return !this.root_; -}; - - -/** - * Inserts a node into the tree with the specified key and value if - * the tree does not already contain a node with the specified key. If - * the value is inserted, it becomes the root of the tree. - * - * @param {number} key Key to insert into the tree. - * @param {*} value Value to insert into the tree. - */ -SplayTree.prototype.insert = function(key, value) { - if (this.isEmpty()) { - this.root_ = new SplayTree.Node(key, value); - return; - } - // Splay on the key to move the last node on the search path for - // the key to the root of the tree. - this.splay_(key); - if (this.root_.key == key) { - return; - } - var node = new SplayTree.Node(key, value); - if (key > this.root_.key) { - node.left = this.root_; - node.right = this.root_.right; - this.root_.right = null; - } else { - node.right = this.root_; - node.left = this.root_.left; - this.root_.left = null; - } - this.root_ = node; -}; - - -/** - * Removes a node with the specified key from the tree if the tree - * contains a node with this key. The removed node is returned. If the - * key is not found, an exception is thrown. - * - * @param {number} key Key to find and remove from the tree. - * @return {SplayTree.Node} The removed node. - */ -SplayTree.prototype.remove = function(key) { - if (this.isEmpty()) { - throw Error('Key not found: ' + key); - } - this.splay_(key); - if (this.root_.key != key) { - throw Error('Key not found: ' + key); - } - var removed = this.root_; - if (!this.root_.left) { - this.root_ = this.root_.right; - } else { - var right = this.root_.right; - this.root_ = this.root_.left; - // Splay to make sure that the new root has an empty right child. - this.splay_(key); - // Insert the original right child as the right child of the new - // root. - this.root_.right = right; - } - return removed; -}; - - -/** - * Returns the node having the specified key or null if the tree doesn't contain - * a node with the specified key. - * - * @param {number} key Key to find in the tree. - * @return {SplayTree.Node} Node having the specified key. - */ -SplayTree.prototype.find = function(key) { - if (this.isEmpty()) { - return null; - } - this.splay_(key); - return this.root_.key == key ? this.root_ : null; -}; - - -/** - * @return {SplayTree.Node} Node having the maximum key value. - */ -SplayTree.prototype.findMax = function(opt_startNode) { - if (this.isEmpty()) { - return null; - } - var current = opt_startNode || this.root_; - while (current.right) { - current = current.right; - } - return current; -}; - - -/** - * @return {SplayTree.Node} Node having the maximum key value that - * is less than the specified key value. - */ -SplayTree.prototype.findGreatestLessThan = function(key) { - if (this.isEmpty()) { - return null; - } - // Splay on the key to move the node with the given key or the last - // node on the search path to the top of the tree. - this.splay_(key); - // Now the result is either the root node or the greatest node in - // the left subtree. - if (this.root_.key < key) { - return this.root_; - } else if (this.root_.left) { - return this.findMax(this.root_.left); - } else { - return null; - } -}; - - -/** - * @return {Array<*>} An array containing all the keys of tree's nodes. - */ -SplayTree.prototype.exportKeys = function() { - var result = []; - if (!this.isEmpty()) { - this.root_.traverse_(function(node) { result.push(node.key); }); - } - return result; -}; - - -/** - * Perform the splay operation for the given key. Moves the node with - * the given key to the top of the tree. If no node has the given - * key, the last node on the search path is moved to the top of the - * tree. This is the simplified top-down splaying algorithm from: - * "Self-adjusting Binary Search Trees" by Sleator and Tarjan - * - * @param {number} key Key to splay the tree on. - * @private - */ -SplayTree.prototype.splay_ = function(key) { - if (this.isEmpty()) { - return; - } - // Create a dummy node. The use of the dummy node is a bit - // counter-intuitive: The right child of the dummy node will hold - // the L tree of the algorithm. The left child of the dummy node - // will hold the R tree of the algorithm. Using a dummy node, left - // and right will always be nodes and we avoid special cases. - var dummy, left, right; - dummy = left = right = new SplayTree.Node(null, null); - var current = this.root_; - while (true) { - if (key < current.key) { - if (!current.left) { - break; - } - if (key < current.left.key) { - // Rotate right. - var tmp = current.left; - current.left = tmp.right; - tmp.right = current; - current = tmp; - if (!current.left) { - break; - } - } - // Link right. - right.left = current; - right = current; - current = current.left; - } else if (key > current.key) { - if (!current.right) { - break; - } - if (key > current.right.key) { - // Rotate left. - var tmp = current.right; - current.right = tmp.left; - tmp.left = current; - current = tmp; - if (!current.right) { - break; - } - } - // Link left. - left.right = current; - left = current; - current = current.right; - } else { - break; - } - } - // Assemble. - left.right = current.left; - right.left = current.right; - current.left = dummy.right; - current.right = dummy.left; - this.root_ = current; -}; - - -/** - * Constructs a Splay tree node. - * - * @param {number} key Key. - * @param {*} value Value. - */ -SplayTree.Node = function(key, value) { - this.key = key; - this.value = value; -}; - - -/** - * @type {SplayTree.Node} - */ -SplayTree.Node.prototype.left = null; - - -/** - * @type {SplayTree.Node} - */ -SplayTree.Node.prototype.right = null; - - -/** - * Performs an ordered traversal of the subtree starting at - * this SplayTree.Node. - * - * @param {function(SplayTree.Node)} f Visitor function. - * @private - */ -SplayTree.Node.prototype.traverse_ = function(f) { - var current = this; - while (current) { - var left = current.left; - if (left) left.traverse_(f); - f(current); - current = current.right; - } -}; -function jscSetUp() { - SplaySetup(); -} - -function jscTearDown() { - SplayTearDown(); -} - -function jscRun() { - SplayRun(); -} - -jscSetUp(); -var __before = preciseTime(); -var times = []; -for (var i = 0; i < 2000; ++i) { - var _before = preciseTime(); - jscRun(); - var _after = preciseTime(); - times.push(_after - _before); - flashHeapAccess(1); -} -var __after = preciseTime(); -jscTearDown(); - -function averageAbovePercentile(numbers, percentile) { - // Don't change the original array. - numbers = numbers.slice(); - - // Sort in ascending order. - numbers.sort(function(a, b) { return a - b; }); - - // Now the elements we want are at the end. Keep removing them until the array size shrinks too much. - // Examples assuming percentile = 99: - // - // - numbers.length starts at 100: we will remove just the worst entry and then not remove anymore, - // since then numbers.length / originalLength = 0.99. - // - // - numbers.length starts at 1000: we will remove the ten worst. - // - // - numbers.length starts at 10: we will remove just the worst. - var numbersWeWant = []; - var originalLength = numbers.length; - while (numbers.length / originalLength > percentile / 100) - numbersWeWant.push(numbers.pop()); - - var sum = 0; - for (var i = 0; i < numbersWeWant.length; ++i) - sum += numbersWeWant[i]; - - var result = sum / numbersWeWant.length; - - // Do a sanity check. - if (numbers.length && result < numbers[numbers.length - 1]) { - throw "Sanity check fail: the worst case result is " + result + - " but we didn't take into account " + numbers; - } - - return result; -} - -print("That took " + (__after - __before) * 1000 + " ms."); - -function printPercentile(percentile) -{ - print("Above " + percentile + "%: " + averageAbovePercentile(times, percentile) * 1000 + " ms."); -} - -printPercentile(99.9); -printPercentile(99.5); -printPercentile(99); -printPercentile(97.5); -printPercentile(95); -printPercentile(90); -printPercentile(75); -printPercentile(50); -printPercentile(0); - -gc(); diff --git a/implementation-contributed/javascriptcore/stress/splay-flash-access.js b/implementation-contributed/javascriptcore/stress/splay-flash-access.js deleted file mode 100644 index 68dcb29d7a..0000000000 --- a/implementation-contributed/javascriptcore/stress/splay-flash-access.js +++ /dev/null @@ -1,904 +0,0 @@ -//@ skip if $memoryLimited || $architecture == "x86" -//@ runNoisyTestDefault -//@ runNoisyTestNoCJIT - -// Copyright 2013 the V8 project authors. All rights reserved. -// Copyright (C) 2015 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: -// -// * 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. - - -// Performance.now is used in latency benchmarks, the fallback is Date.now. -var performance = performance || {}; -performance.now = (function() { - return performance.now || - performance.mozNow || - performance.msNow || - performance.oNow || - performance.webkitNow || - Date.now; -})(); - -// Simple framework for running the benchmark suites and -// computing a score based on the timing measurements. - - -// A benchmark has a name (string) and a function that will be run to -// do the performance measurement. The optional setup and tearDown -// arguments are functions that will be invoked before and after -// running the benchmark, but the running time of these functions will -// not be accounted for in the benchmark score. -function Benchmark(name, doWarmup, doDeterministic, run, setup, tearDown, latencyResult, minIterations) { - this.name = name; - this.doWarmup = doWarmup; - this.doDeterministic = doDeterministic; - this.run = run; - this.Setup = setup ? setup : function() { }; - this.TearDown = tearDown ? tearDown : function() { }; - this.latencyResult = latencyResult ? latencyResult : null; - this.minIterations = minIterations ? minIterations : 32; -} - - -// Benchmark results hold the benchmark and the measured time used to -// run the benchmark. The benchmark score is computed later once a -// full benchmark suite has run to completion. If latency is set to 0 -// then there is no latency score for this benchmark. -function BenchmarkResult(benchmark, time, latency) { - this.benchmark = benchmark; - this.time = time; - this.latency = latency; -} - - -// Automatically convert results to numbers. Used by the geometric -// mean computation. -BenchmarkResult.prototype.valueOf = function() { - return this.time; -} - - -// Suites of benchmarks consist of a name and the set of benchmarks in -// addition to the reference timing that the final score will be based -// on. This way, all scores are relative to a reference run and higher -// scores implies better performance. -function BenchmarkSuite(name, reference, benchmarks) { - this.name = name; - this.reference = reference; - this.benchmarks = benchmarks; - BenchmarkSuite.suites.push(this); -} - - -// Keep track of all declared benchmark suites. -BenchmarkSuite.suites = []; - -// Scores are not comparable across versions. Bump the version if -// you're making changes that will affect that scores, e.g. if you add -// a new benchmark or change an existing one. -BenchmarkSuite.version = '9'; - -// Override the alert function to throw an exception instead. -alert = function(s) { - throw "Alert called with argument: " + s; -}; - - -// To make the benchmark results predictable, we replace Math.random -// with a 100% deterministic alternative. -BenchmarkSuite.ResetRNG = function() { - Math.random = (function() { - var seed = 49734321; - return function() { - // Robert Jenkins' 32 bit integer hash function. - seed = ((seed + 0x7ed55d16) + (seed << 12)) & 0xffffffff; - seed = ((seed ^ 0xc761c23c) ^ (seed >>> 19)) & 0xffffffff; - seed = ((seed + 0x165667b1) + (seed << 5)) & 0xffffffff; - seed = ((seed + 0xd3a2646c) ^ (seed << 9)) & 0xffffffff; - seed = ((seed + 0xfd7046c5) + (seed << 3)) & 0xffffffff; - seed = ((seed ^ 0xb55a4f09) ^ (seed >>> 16)) & 0xffffffff; - return (seed & 0xfffffff) / 0x10000000; - }; - })(); -} - - -// Runs all registered benchmark suites and optionally yields between -// each individual benchmark to avoid running for too long in the -// context of browsers. Once done, the final score is reported to the -// runner. -BenchmarkSuite.RunSuites = function(runner) { - var continuation = null; - var suites = BenchmarkSuite.suites; - var length = suites.length; - BenchmarkSuite.scores = []; - var index = 0; - function RunStep() { - while (continuation || index < length) { - if (continuation) { - continuation = continuation(); - } else { - var suite = suites[index++]; - if (runner.NotifyStart) runner.NotifyStart(suite.name); - continuation = suite.RunStep(runner); - } - if (continuation && typeof window != 'undefined' && window.setTimeout) { - window.setTimeout(RunStep, 25); - return; - } - } - - // show final result - if (runner.NotifyScore) { - var score = BenchmarkSuite.GeometricMean(BenchmarkSuite.scores); - var formatted = BenchmarkSuite.FormatScore(100 * score); - runner.NotifyScore(formatted); - } - } - RunStep(); -} - - -// Counts the total number of registered benchmarks. Useful for -// showing progress as a percentage. -BenchmarkSuite.CountBenchmarks = function() { - var result = 0; - var suites = BenchmarkSuite.suites; - for (var i = 0; i < suites.length; i++) { - result += suites[i].benchmarks.length; - } - return result; -} - - -// Computes the geometric mean of a set of numbers. -BenchmarkSuite.GeometricMean = function(numbers) { - var log = 0; - for (var i = 0; i < numbers.length; i++) { - log += Math.log(numbers[i]); - } - return Math.pow(Math.E, log / numbers.length); -} - - -// Computes the geometric mean of a set of throughput time measurements. -BenchmarkSuite.GeometricMeanTime = function(measurements) { - var log = 0; - for (var i = 0; i < measurements.length; i++) { - log += Math.log(measurements[i].time); - } - return Math.pow(Math.E, log / measurements.length); -} - - -// Computes the average of the worst samples. For example, if percentile is 99, this will report the -// average of the worst 1% of the samples. -BenchmarkSuite.AverageAbovePercentile = function(numbers, percentile) { - // Don't change the original array. - numbers = numbers.slice(); - - // Sort in ascending order. - numbers.sort(function(a, b) { return a - b; }); - - // Now the elements we want are at the end. Keep removing them until the array size shrinks too much. - // Examples assuming percentile = 99: - // - // - numbers.length starts at 100: we will remove just the worst entry and then not remove anymore, - // since then numbers.length / originalLength = 0.99. - // - // - numbers.length starts at 1000: we will remove the ten worst. - // - // - numbers.length starts at 10: we will remove just the worst. - var numbersWeWant = []; - var originalLength = numbers.length; - while (numbers.length / originalLength > percentile / 100) - numbersWeWant.push(numbers.pop()); - - var sum = 0; - for (var i = 0; i < numbersWeWant.length; ++i) - sum += numbersWeWant[i]; - - var result = sum / numbersWeWant.length; - - // Do a sanity check. - if (numbers.length && result < numbers[numbers.length - 1]) { - throw "Sanity check fail: the worst case result is " + result + - " but we didn't take into account " + numbers; - } - - return result; -} - - -// Computes the geometric mean of a set of latency measurements. -BenchmarkSuite.GeometricMeanLatency = function(measurements) { - var log = 0; - var hasLatencyResult = false; - for (var i = 0; i < measurements.length; i++) { - if (measurements[i].latency != 0) { - log += Math.log(measurements[i].latency); - hasLatencyResult = true; - } - } - if (hasLatencyResult) { - return Math.pow(Math.E, log / measurements.length); - } else { - return 0; - } -} - - -// Converts a score value to a string with at least three significant -// digits. -BenchmarkSuite.FormatScore = function(value) { - if (value > 100) { - return value.toFixed(0); - } else { - return value.toPrecision(3); - } -} - -// Notifies the runner that we're done running a single benchmark in -// the benchmark suite. This can be useful to report progress. -BenchmarkSuite.prototype.NotifyStep = function(result) { - this.results.push(result); - if (this.runner.NotifyStep) this.runner.NotifyStep(result.benchmark.name); -} - - -// Notifies the runner that we're done with running a suite and that -// we have a result which can be reported to the user if needed. -BenchmarkSuite.prototype.NotifyResult = function() { - var mean = BenchmarkSuite.GeometricMeanTime(this.results); - var score = this.reference[0] / mean; - BenchmarkSuite.scores.push(score); - if (this.runner.NotifyResult) { - var formatted = BenchmarkSuite.FormatScore(100 * score); - this.runner.NotifyResult(this.name, formatted); - } - if (this.reference.length == 2) { - var meanLatency = BenchmarkSuite.GeometricMeanLatency(this.results); - if (meanLatency != 0) { - var scoreLatency = this.reference[1] / meanLatency; - BenchmarkSuite.scores.push(scoreLatency); - if (this.runner.NotifyResult) { - var formattedLatency = BenchmarkSuite.FormatScore(100 * scoreLatency) - this.runner.NotifyResult(this.name + "Latency", formattedLatency); - } - } - } -} - - -// Notifies the runner that running a benchmark resulted in an error. -BenchmarkSuite.prototype.NotifyError = function(error) { - if (this.runner.NotifyError) { - this.runner.NotifyError(this.name, error); - } - if (this.runner.NotifyStep) { - this.runner.NotifyStep(this.name); - } -} - - -// Runs a single benchmark for at least a second and computes the -// average time it takes to run a single iteration. -BenchmarkSuite.prototype.RunSingleBenchmark = function(benchmark, data) { - function Measure(data) { - var elapsed = 0; - var start = new Date(); - - // Run either for 1 second or for the number of iterations specified - // by minIterations, depending on the config flag doDeterministic. - for (var i = 0; (benchmark.doDeterministic ? - i<benchmark.minIterations : elapsed < 1000); i++) { - benchmark.run(); - elapsed = new Date() - start; - } - if (data != null) { - data.runs += i; - data.elapsed += elapsed; - } - } - - // Sets up data in order to skip or not the warmup phase. - if (!benchmark.doWarmup && data == null) { - data = { runs: 0, elapsed: 0 }; - } - - if (data == null) { - Measure(null); - return { runs: 0, elapsed: 0 }; - } else { - Measure(data); - // If we've run too few iterations, we continue for another second. - if (data.runs < benchmark.minIterations) return data; - var usec = (data.elapsed * 1000) / data.runs; - var latencySamples = (benchmark.latencyResult != null) ? benchmark.latencyResult() : [0]; - var percentile = 99.5; - var latency = BenchmarkSuite.AverageAbovePercentile(latencySamples, percentile) * 1000; - this.NotifyStep(new BenchmarkResult(benchmark, usec, latency)); - return null; - } -} - - -// This function starts running a suite, but stops between each -// individual benchmark in the suite and returns a continuation -// function which can be invoked to run the next benchmark. Once the -// last benchmark has been executed, null is returned. -BenchmarkSuite.prototype.RunStep = function(runner) { - BenchmarkSuite.ResetRNG(); - this.results = []; - this.runner = runner; - var length = this.benchmarks.length; - var index = 0; - var suite = this; - var data; - - // Run the setup, the actual benchmark, and the tear down in three - // separate steps to allow the framework to yield between any of the - // steps. - - function RunNextSetup() { - if (index < length) { - try { - suite.benchmarks[index].Setup(); - } catch (e) { - suite.NotifyError(e); - return null; - } - return RunNextBenchmark; - } - suite.NotifyResult(); - return null; - } - - function RunNextBenchmark() { - try { - data = suite.RunSingleBenchmark(suite.benchmarks[index], data); - } catch (e) { - suite.NotifyError(e); - return null; - } - // If data is null, we're done with this benchmark. - return (data == null) ? RunNextTearDown : RunNextBenchmark(); - } - - function RunNextTearDown() { - try { - suite.benchmarks[index++].TearDown(); - } catch (e) { - suite.NotifyError(e); - return null; - } - return RunNextSetup; - } - - // Start out running the setup. - return RunNextSetup(); -} -// Copyright 2009 the V8 project authors. All rights reserved. -// Copyright (C) 2015 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: -// -// * 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. - -// This benchmark is based on a JavaScript log processing module used -// by the V8 profiler to generate execution time profiles for runs of -// JavaScript applications, and it effectively measures how fast the -// JavaScript engine is at allocating nodes and reclaiming the memory -// used for old nodes. Because of the way splay trees work, the engine -// also has to deal with a lot of changes to the large tree object -// graph. - -var Splay = new BenchmarkSuite('Splay', [81491, 2739514], [ - new Benchmark("Splay", true, false, - SplayRun, SplaySetup, SplayTearDown, SplayLatency) -]); - - -// Configuration. -var kSplayTreeSize = 8000; -var kSplayTreeModifications = 80; -var kSplayTreePayloadDepth = 5; - -var splayTree = null; -var splaySampleTimeStart = 0.0; - -function GeneratePayloadTree(depth, tag) { - if (depth == 0) { - return { - array : [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], - string : 'String for key ' + tag + ' in leaf node' - }; - } else { - return { - left: GeneratePayloadTree(depth - 1, tag), - right: GeneratePayloadTree(depth - 1, tag) - }; - } -} - - -function GenerateKey() { - // The benchmark framework guarantees that Math.random is - // deterministic; see base.js. - return Math.random(); -} - -var splaySamples = []; - -function SplayLatency() { - return splaySamples; -} - -function SplayUpdateStats(time) { - var pause = time - splaySampleTimeStart; - splaySampleTimeStart = time; - splaySamples.push(pause); -} - -function InsertNewNode() { - // Insert new node with a unique key. - var key; - do { - key = GenerateKey(); - } while (splayTree.find(key) != null); - var payload = GeneratePayloadTree(kSplayTreePayloadDepth, String(key)); - splayTree.insert(key, payload); - return key; -} - - -function SplaySetup() { - // Check if the platform has the performance.now high resolution timer. - // If not, throw exception and quit. - if (!performance.now) { - throw "PerformanceNowUnsupported"; - } - - splayTree = new SplayTree(); - splaySampleTimeStart = performance.now() - for (var i = 0; i < kSplayTreeSize; i++) { - InsertNewNode(); - if ((i+1) % 20 == 19) { - SplayUpdateStats(performance.now()); - } - } -} - - -function SplayTearDown() { - // Allow the garbage collector to reclaim the memory - // used by the splay tree no matter how we exit the - // tear down function. - var keys = splayTree.exportKeys(); - splayTree = null; - - splaySamples = []; - - // Verify that the splay tree has the right size. - var length = keys.length; - if (length != kSplayTreeSize) { - throw new Error("Splay tree has wrong size"); - } - - // Verify that the splay tree has sorted, unique keys. - for (var i = 0; i < length - 1; i++) { - if (keys[i] >= keys[i + 1]) { - throw new Error("Splay tree not sorted"); - } - } -} - - -function SplayRun() { - // Replace a few nodes in the splay tree. - for (var i = 0; i < kSplayTreeModifications; i++) { - var key = InsertNewNode(); - var greatest = splayTree.findGreatestLessThan(key); - if (greatest == null) splayTree.remove(key); - else splayTree.remove(greatest.key); - } - SplayUpdateStats(performance.now()); -} - - -/** - * Constructs a Splay tree. A splay tree is a self-balancing binary - * search tree with the additional property that recently accessed - * elements are quick to access again. It performs basic operations - * such as insertion, look-up and removal in O(log(n)) amortized time. - * - * @constructor - */ -function SplayTree() { -}; - - -/** - * Pointer to the root node of the tree. - * - * @type {SplayTree.Node} - * @private - */ -SplayTree.prototype.root_ = null; - - -/** - * @return {boolean} Whether the tree is empty. - */ -SplayTree.prototype.isEmpty = function() { - return !this.root_; -}; - - -/** - * Inserts a node into the tree with the specified key and value if - * the tree does not already contain a node with the specified key. If - * the value is inserted, it becomes the root of the tree. - * - * @param {number} key Key to insert into the tree. - * @param {*} value Value to insert into the tree. - */ -SplayTree.prototype.insert = function(key, value) { - if (this.isEmpty()) { - this.root_ = new SplayTree.Node(key, value); - return; - } - // Splay on the key to move the last node on the search path for - // the key to the root of the tree. - this.splay_(key); - if (this.root_.key == key) { - return; - } - var node = new SplayTree.Node(key, value); - if (key > this.root_.key) { - node.left = this.root_; - node.right = this.root_.right; - this.root_.right = null; - } else { - node.right = this.root_; - node.left = this.root_.left; - this.root_.left = null; - } - this.root_ = node; -}; - - -/** - * Removes a node with the specified key from the tree if the tree - * contains a node with this key. The removed node is returned. If the - * key is not found, an exception is thrown. - * - * @param {number} key Key to find and remove from the tree. - * @return {SplayTree.Node} The removed node. - */ -SplayTree.prototype.remove = function(key) { - if (this.isEmpty()) { - throw Error('Key not found: ' + key); - } - this.splay_(key); - if (this.root_.key != key) { - throw Error('Key not found: ' + key); - } - var removed = this.root_; - if (!this.root_.left) { - this.root_ = this.root_.right; - } else { - var right = this.root_.right; - this.root_ = this.root_.left; - // Splay to make sure that the new root has an empty right child. - this.splay_(key); - // Insert the original right child as the right child of the new - // root. - this.root_.right = right; - } - return removed; -}; - - -/** - * Returns the node having the specified key or null if the tree doesn't contain - * a node with the specified key. - * - * @param {number} key Key to find in the tree. - * @return {SplayTree.Node} Node having the specified key. - */ -SplayTree.prototype.find = function(key) { - if (this.isEmpty()) { - return null; - } - this.splay_(key); - return this.root_.key == key ? this.root_ : null; -}; - - -/** - * @return {SplayTree.Node} Node having the maximum key value. - */ -SplayTree.prototype.findMax = function(opt_startNode) { - if (this.isEmpty()) { - return null; - } - var current = opt_startNode || this.root_; - while (current.right) { - current = current.right; - } - return current; -}; - - -/** - * @return {SplayTree.Node} Node having the maximum key value that - * is less than the specified key value. - */ -SplayTree.prototype.findGreatestLessThan = function(key) { - if (this.isEmpty()) { - return null; - } - // Splay on the key to move the node with the given key or the last - // node on the search path to the top of the tree. - this.splay_(key); - // Now the result is either the root node or the greatest node in - // the left subtree. - if (this.root_.key < key) { - return this.root_; - } else if (this.root_.left) { - return this.findMax(this.root_.left); - } else { - return null; - } -}; - - -/** - * @return {Array<*>} An array containing all the keys of tree's nodes. - */ -SplayTree.prototype.exportKeys = function() { - var result = []; - if (!this.isEmpty()) { - this.root_.traverse_(function(node) { result.push(node.key); }); - } - return result; -}; - - -/** - * Perform the splay operation for the given key. Moves the node with - * the given key to the top of the tree. If no node has the given - * key, the last node on the search path is moved to the top of the - * tree. This is the simplified top-down splaying algorithm from: - * "Self-adjusting Binary Search Trees" by Sleator and Tarjan - * - * @param {number} key Key to splay the tree on. - * @private - */ -SplayTree.prototype.splay_ = function(key) { - if (this.isEmpty()) { - return; - } - // Create a dummy node. The use of the dummy node is a bit - // counter-intuitive: The right child of the dummy node will hold - // the L tree of the algorithm. The left child of the dummy node - // will hold the R tree of the algorithm. Using a dummy node, left - // and right will always be nodes and we avoid special cases. - var dummy, left, right; - dummy = left = right = new SplayTree.Node(null, null); - var current = this.root_; - while (true) { - if (key < current.key) { - if (!current.left) { - break; - } - if (key < current.left.key) { - // Rotate right. - var tmp = current.left; - current.left = tmp.right; - tmp.right = current; - current = tmp; - if (!current.left) { - break; - } - } - // Link right. - right.left = current; - right = current; - current = current.left; - } else if (key > current.key) { - if (!current.right) { - break; - } - if (key > current.right.key) { - // Rotate left. - var tmp = current.right; - current.right = tmp.left; - tmp.left = current; - current = tmp; - if (!current.right) { - break; - } - } - // Link left. - left.right = current; - left = current; - current = current.right; - } else { - break; - } - } - // Assemble. - left.right = current.left; - right.left = current.right; - current.left = dummy.right; - current.right = dummy.left; - this.root_ = current; -}; - - -/** - * Constructs a Splay tree node. - * - * @param {number} key Key. - * @param {*} value Value. - */ -SplayTree.Node = function(key, value) { - this.key = key; - this.value = value; -}; - - -/** - * @type {SplayTree.Node} - */ -SplayTree.Node.prototype.left = null; - - -/** - * @type {SplayTree.Node} - */ -SplayTree.Node.prototype.right = null; - - -/** - * Performs an ordered traversal of the subtree starting at - * this SplayTree.Node. - * - * @param {function(SplayTree.Node)} f Visitor function. - * @private - */ -SplayTree.Node.prototype.traverse_ = function(f) { - var current = this; - while (current) { - var left = current.left; - if (left) left.traverse_(f); - f(current); - current = current.right; - } -}; -function jscSetUp() { - SplaySetup(); -} - -function jscTearDown() { - SplayTearDown(); -} - -function jscRun() { - SplayRun(); -} - -jscSetUp(); -var __before = preciseTime(); -var times = []; -for (var i = 0; i < 10000; ++i) { -//for (var i = 0; i < 1000000; ++i) { - var _before = preciseTime(); - jscRun(); - var _after = preciseTime(); - times.push(_after - _before); - flashHeapAccess(); -} -var __after = preciseTime(); -jscTearDown(); - -function averageAbovePercentile(numbers, percentile) { - // Don't change the original array. - numbers = numbers.slice(); - - // Sort in ascending order. - numbers.sort(function(a, b) { return a - b; }); - - // Now the elements we want are at the end. Keep removing them until the array size shrinks too much. - // Examples assuming percentile = 99: - // - // - numbers.length starts at 100: we will remove just the worst entry and then not remove anymore, - // since then numbers.length / originalLength = 0.99. - // - // - numbers.length starts at 1000: we will remove the ten worst. - // - // - numbers.length starts at 10: we will remove just the worst. - var numbersWeWant = []; - var originalLength = numbers.length; - while (numbers.length / originalLength > percentile / 100) - numbersWeWant.push(numbers.pop()); - - var sum = 0; - for (var i = 0; i < numbersWeWant.length; ++i) - sum += numbersWeWant[i]; - - var result = sum / numbersWeWant.length; - - // Do a sanity check. - if (numbers.length && result < numbers[numbers.length - 1]) { - throw "Sanity check fail: the worst case result is " + result + - " but we didn't take into account " + numbers; - } - - return result; -} - -print("That took " + (__after - __before) * 1000 + " ms."); - -function printPercentile(percentile) -{ - print("Above " + percentile + "%: " + averageAbovePercentile(times, percentile) * 1000 + " ms."); -} - -printPercentile(99.9); -printPercentile(99.5); -printPercentile(99); -printPercentile(97.5); -printPercentile(95); -printPercentile(90); -printPercentile(75); -printPercentile(50); -printPercentile(0); - -gc(); diff --git a/implementation-contributed/javascriptcore/stress/spread-array-iterator-watchpoint-2.js b/implementation-contributed/javascriptcore/stress/spread-array-iterator-watchpoint-2.js deleted file mode 100644 index 7dde5342d6..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-array-iterator-watchpoint-2.js +++ /dev/null @@ -1,22 +0,0 @@ -function foo(a) { - return [...a]; -} -noInline(foo); - -let arr = []; -for (let i = 0; i < 10000; i++) { - if (i % 100 === 0) - arr.push([], i); - foo(arr); -} - -let calledIterator = false; -let arrayIterator = [][Symbol.iterator]().__proto__; -arrayIterator.next = function() { - calledIterator = true; - return {done: true}; -}; - -let r = foo(arr); -if (!calledIterator || r.length) - throw new Error("Bad result"); diff --git a/implementation-contributed/javascriptcore/stress/spread-array-iterator-watchpoint.js b/implementation-contributed/javascriptcore/stress/spread-array-iterator-watchpoint.js deleted file mode 100644 index ac774535c6..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-array-iterator-watchpoint.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(a) { - return [...a]; -} -noInline(foo); - -let arr = []; -for (let i = 0; i < 10000; i++) { - if (i % 100 === 0) - arr.push([], i); - foo(arr); -} - -let calledIterator = false; -Array.prototype[Symbol.iterator] = function iterator() { - calledIterator = true; - return { - next() { - return {done: true}; - } - }; -}; - -foo(arr); -if (!calledIterator) - throw new Error("Bad result"); diff --git a/implementation-contributed/javascriptcore/stress/spread-call-convert-to-static-call.js b/implementation-contributed/javascriptcore/stress/spread-call-convert-to-static-call.js deleted file mode 100644 index f572664fd5..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-call-convert-to-static-call.js +++ /dev/null @@ -1,29 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad!"); -} -noInline(assert); - -function baz(...args) { - return args; -} -noInline(baz); -function bar(a, ...args) { - return baz(...args, 42, ...args); -} -function foo(a, b, c, d) { - return bar(a, b, c, d); -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - let r = foo(i, i+1, i+2, i+3); - assert(r.length === 7); - assert(r[0] === i+1); - assert(r[1] === i+2); - assert(r[2] === i+3); - assert(r[3] === 42); - assert(r[4] === i+1); - assert(r[5] === i+2); - assert(r[6] === i+3); -} diff --git a/implementation-contributed/javascriptcore/stress/spread-calling.js b/implementation-contributed/javascriptcore/stress/spread-calling.js deleted file mode 100644 index 592a8e7bf2..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-calling.js +++ /dev/null @@ -1,83 +0,0 @@ -function testFunction() { - if (arguments.length !== 10) - throw "wrong number of arguments expected 10 was " + arguments.length; - for (let i in arguments) { - if ((arguments[i] | 0) !== (i | 0)) - throw "argument " + i + " expected " + i + " was " + arguments[i]; - } -} - -function testEmpty() { - if (arguments.length !== 0) - throw "wrong length expected 0 was " + arguments.length; -} - -iter = Array.prototype.values; - -function makeObject(array, iterator) { - let obj = { [Symbol.iterator]: iterator, length: array.length }; - for (let i in array) - obj[i] = array[i]; - return obj; -} - -function otherIterator() { - return { - count: 6, - next: function() { - if (this.count < 10) - return { value: this.count++, done: false }; - return { done: true }; - } - }; -} - -count = 0; -function* totalIter() { - for (let i = count; i < count+5; i++) { - yield i; - } - count += 5; -} - -function throwingIter() { - return { - count: 0, - next: function() { - if (this.count < 10) - return { value: this.count++, done: false }; - throw new Error("this should have been caught"); - } - }; -} - -object1 = makeObject([1, 2, 3], iter); -object2 = makeObject([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], iter); -object3 = makeObject([], otherIterator); -object4 = makeObject([], totalIter); -objectThrow = makeObject([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], throwingIter); - -for (let i = 0; i < 3000; i++) { - count = 0; - testFunction(0, ...[1, 2, 3], ...[4], 5, 6, ...[7, 8, 9]); - testFunction(...[0, 1], 2, 3, ...[4, 5, 6, 7, 8], 9); - testFunction(...[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); - testFunction(0, ...object1, 4, 5, ...[6, 7, 8, 9]); - testFunction(...object2); - testFunction(0, ...object1, 4, 5, ...object3); - testFunction(0, ..."12345", ...object3); - testEmpty(...[]); - testFunction(...object4, ...object4); - testFunction.call(null, 0, ...[1, 2, 3], 4, 5, 6, 7, 8, 9); - testFunction.apply(null, [0, ...[1, 2, 3], 4, 5, 6, 7, 8, 9]) - let failed = false; - try { - testFunction(...objectThrow); - failed = true; - } catch (e) { - if (!e instanceof Error) - failed = true; - } - if (failed) - throw "did not throw an exeption even though it should have"; -} diff --git a/implementation-contributed/javascriptcore/stress/spread-capture-rest.js b/implementation-contributed/javascriptcore/stress/spread-capture-rest.js deleted file mode 100644 index 6ad7dbe756..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-capture-rest.js +++ /dev/null @@ -1,80 +0,0 @@ -(function () { - "use strict"; - - function shouldBe(actual, expected) - { - if (actual !== expected) - throw new Error('bad value: ' + actual); - } - noInline(shouldBe); - - function capture(arg) - { - } - noInline(capture); - - var flag = false; - - function a(...args) - { - // This makes args and Spread non-phantom. - capture(args); - if (flag) { - OSRExit(); - return args[0]; - } - return b(...args); - } - - function b(...args) - { - return Math.max(...args); - } - - for (var i = 0; i < 1e6; ++i) { - flag = i > (1e6 - 100); - var ret = a(0, 1, 2, 3, 4); - if (!flag) - shouldBe(ret, 4); - else - shouldBe(ret, 0); - } -}()); - -(function () { - "use strict"; - - function shouldBe(actual, expected) - { - if (actual !== expected) - throw new Error('bad value: ' + actual); - } - noInline(shouldBe); - - function capture(arg) - { - } - noInline(capture); - - var flag = false; - - function a(...args) - { - // This makes args and Spread non-phantom. - capture(args); - if (flag) { - OSRExit(); - return args[0]; - } - return Math.max(...args); - } - - for (var i = 0; i < 1e6; ++i) { - flag = i > (1e6 - 100); - var ret = a(0, 1, 2, 3, 4); - if (!flag) - shouldBe(ret, 4); - else - shouldBe(ret, 0); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/spread-consults-correct-global-object.js b/implementation-contributed/javascriptcore/stress/spread-consults-correct-global-object.js deleted file mode 100644 index 29b6323173..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-consults-correct-global-object.js +++ /dev/null @@ -1,18 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion"); -} -function spread(a) { - return [...a]; -} -noInline(spread); - -const foo = {}; - -let secondGlobalObject = createGlobalObject(); -secondGlobalObject.Array.prototype[0] = foo; -let x = secondGlobalObject.Function("return [, 20];")(); -let result = spread(x); -assert(result.length === 2); -assert(result[0] === foo); -assert(result[1] === 20); diff --git a/implementation-contributed/javascriptcore/stress/spread-escapes-but-create-rest-does-not.js b/implementation-contributed/javascriptcore/stress/spread-escapes-but-create-rest-does-not.js deleted file mode 100644 index 46809c9bf8..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-escapes-but-create-rest-does-not.js +++ /dev/null @@ -1,35 +0,0 @@ -function assert(b) { - if (!b) - throw new Error; -} -noInline(assert); - -function getProperties(obj) { - let properties = []; - for (let name of Object.getOwnPropertyNames(obj)) { - properties.push(name); - } - return properties; -} - -function theFunc(obj, index, ...args) { - let functions = getProperties(obj); - let func = functions[index % functions.length]; - obj[func](...args); -} - -let o = {}; -let obj = { - valueOf: function (x, y) { - assert(x === 42); - assert(y === o); - try { - } catch (e) {} - } -}; - -for (let i = 0; i < 1e5; ++i) { - for (let _i = 0; _i < 100; _i++) { - } - theFunc(obj, 897989, 42, o); -} diff --git a/implementation-contributed/javascriptcore/stress/spread-escapes-but-new-array-buffer-does-not-double.js b/implementation-contributed/javascriptcore/stress/spread-escapes-but-new-array-buffer-does-not-double.js deleted file mode 100644 index 8662b8d648..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-escapes-but-new-array-buffer-does-not-double.js +++ /dev/null @@ -1,35 +0,0 @@ -function assert(b) { - if (!b) - throw new Error; -} -noInline(assert); - -function getProperties(obj) { - let properties = []; - for (let name of Object.getOwnPropertyNames(obj)) { - properties.push(name); - } - return properties; -} - -function theFunc(obj, index) { - let args = [42.195, 20.2]; - let functions = getProperties(obj); - let func = functions[index % functions.length]; - obj[func](...args); -} - -let obj = { - valueOf: function (x, y) { - assert(x === 42.195); - assert(y === 20.2); - try { - } catch (e) {} - } -}; - -for (let i = 0; i < 1e5; ++i) { - for (let _i = 0; _i < 100; _i++) { - } - theFunc(obj, 897989); -} diff --git a/implementation-contributed/javascriptcore/stress/spread-escapes-but-new-array-buffer-does-not.js b/implementation-contributed/javascriptcore/stress/spread-escapes-but-new-array-buffer-does-not.js deleted file mode 100644 index b397677436..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-escapes-but-new-array-buffer-does-not.js +++ /dev/null @@ -1,35 +0,0 @@ -function assert(b) { - if (!b) - throw new Error; -} -noInline(assert); - -function getProperties(obj) { - let properties = []; - for (let name of Object.getOwnPropertyNames(obj)) { - properties.push(name); - } - return properties; -} - -function theFunc(obj, index) { - let args = [42, 20]; - let functions = getProperties(obj); - let func = functions[index % functions.length]; - obj[func](...args); -} - -let obj = { - valueOf: function (x, y) { - assert(x === 42); - assert(y === 20); - try { - } catch (e) {} - } -}; - -for (let i = 0; i < 1e5; ++i) { - for (let _i = 0; _i < 100; _i++) { - } - theFunc(obj, 897989); -} diff --git a/implementation-contributed/javascriptcore/stress/spread-forward-call-varargs-stack-overflow.js b/implementation-contributed/javascriptcore/stress/spread-forward-call-varargs-stack-overflow.js deleted file mode 100644 index b4957baf49..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-forward-call-varargs-stack-overflow.js +++ /dev/null @@ -1,58 +0,0 @@ -//@ skip if $architecture == "x86" -function assert(b) { - if (!b) - throw new Error("Bad assertion"); -} -noInline(assert); - -function identity(a) { return a; } -noInline(identity); - -function bar(...args) { - return args; -} -noInline(bar); - -function foo(a, ...args) { - let arg = identity(a); - try { - let r = bar(...args, ...args); - return r; - } catch(e) { - return arg; - } -} -noInline(foo); - -for (let i = 0; i < 40000; i++) { - let args = []; - for (let i = 0; i < 400; i++) { - args.push(i); - } - - let o = {}; - let r = foo(o, ...args); - let i = 0; - for (let arg of args) { - assert(r[i] === arg); - i++; - } - for (let arg of args) { - assert(r[i] === arg); - i++; - } -} - -for (let i = 0; i < 20; i++) { - let threw = false; - let o = {}; - let args = []; - let argCount = maxArguments() * (2/3); - argCount = argCount | 0; - for (let i = 0; i < argCount; i++) { - args.push(i); - } - - let r = foo(o, ...args); - assert(r === o); -} diff --git a/implementation-contributed/javascriptcore/stress/spread-forward-varargs-rest-parameter-change-iterator-protocol-2.js b/implementation-contributed/javascriptcore/stress/spread-forward-varargs-rest-parameter-change-iterator-protocol-2.js deleted file mode 100644 index 8196a5d7df..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-forward-varargs-rest-parameter-change-iterator-protocol-2.js +++ /dev/null @@ -1,46 +0,0 @@ -function assert(b, m="") { - if (!b) - throw new Error("Bad assertion: " + m); -} -noInline(assert); - -let called = false; -function baz(c) { - if (c) { - Array.prototype[Symbol.iterator] = function() { - assert(false, "should not be called!"); - let i = 0; - return { - next() { - assert(false, "should not be called!"); - } - }; - } - } -} -noInline(baz); - -function bar(...args) { - return args; -} -noInline(bar); - -function foo(c, ...args) { - args = [...args]; - baz(c); - return bar.apply(null, args); -} -noInline(foo); - -function test(c) { - const args = [{}, 20, [], 45]; - let r = foo(c, ...args); - assert(r.length === r.length); - for (let i = 0; i < r.length; i++) - assert(r[i] === args[i]); -} -noInline(test); -for (let i = 0; i < 40000; i++) { - test(false); -} -test(true); diff --git a/implementation-contributed/javascriptcore/stress/spread-forward-varargs-rest-parameter-change-iterator-protocol.js b/implementation-contributed/javascriptcore/stress/spread-forward-varargs-rest-parameter-change-iterator-protocol.js deleted file mode 100644 index 72bd04f132..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-forward-varargs-rest-parameter-change-iterator-protocol.js +++ /dev/null @@ -1,49 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion"); -} -noInline(assert); - -let called = false; -function baz(c) { - if (c) { - Array.prototype[Symbol.iterator] = function() { - let i = 0; - return { - next() { - i++; - if (i === 2) - return {done: true}; - return {value: 40, done: false}; - } - }; - } - } -} -noInline(baz); - -function bar(...args) { - return args; -} -noInline(bar); - -function foo(c, ...args) { - baz(c); - return bar(...args); -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - const c = false; - const args = [{}, 20, [], 45]; - let r = foo(c, ...args); - assert(r.length === r.length); - for (let i = 0; i < r.length; i++) - assert(r[i] === args[i]); -} - -const c = true; -const args = [{}, 20, [], 45]; -let r = foo(c, ...args); -assert(r.length === 1); -assert(r[0] === 40); diff --git a/implementation-contributed/javascriptcore/stress/spread-forward-varargs-stack-overflow.js b/implementation-contributed/javascriptcore/stress/spread-forward-varargs-stack-overflow.js deleted file mode 100644 index b11d45ed98..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-forward-varargs-stack-overflow.js +++ /dev/null @@ -1,52 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion"); -} -noInline(assert); - -function bar(...args) { - return args; -} - -function foo(a, ...args) { - try { - let r = bar(...args, ...args); - return r; - } catch(e) { - return a; - } -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - let args = []; - for (let i = 0; i < 400; i++) { - args.push(i); - } - - let o = {}; - let r = foo(o, ...args); - let i = 0; - for (let arg of args) { - assert(r[i] === arg); - i++; - } - for (let arg of args) { - assert(r[i] === arg); - i++; - } -} - -for (let i = 0; i < 20; i++) { - let threw = false; - let o = {}; - let args = []; - let argCount = maxArguments() * (2/3); - argCount = argCount | 0; - for (let i = 0; i < argCount; i++) { - args.push(i); - } - - let r = foo(o, ...args); - assert(r === o); -} diff --git a/implementation-contributed/javascriptcore/stress/spread-in-tail.js b/implementation-contributed/javascriptcore/stress/spread-in-tail.js deleted file mode 100644 index a2a8cb803b..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-in-tail.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo(b, y, d) { - // Note that when we fixed this, this simpler thing would also crash: - // var [x] = [...y]; - - var [a, x, c] = [b, ...y, d]; - return [a, x, c]; -} - -function test(args, expected) { - var actual = foo.apply(this, args); - if ("" + actual != "" + expected) - throw "Error: bad result: " + actual; -} - -test([1, [], 2], [1, 2, void 0]); -test([1, [2], 3], [1, 2, 3]); -test([1, [2, 3], 4], [1, 2, 3]); - diff --git a/implementation-contributed/javascriptcore/stress/spread-multi-layers.js b/implementation-contributed/javascriptcore/stress/spread-multi-layers.js deleted file mode 100644 index 60ae69e057..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-multi-layers.js +++ /dev/null @@ -1,47 +0,0 @@ -(function () { - "use strict"; - - function shouldBe(actual, expected) - { - if (actual !== expected) - throw new Error('bad value: ' + actual); - } - noInline(shouldBe); - - var flag = false; - - function a(...args) - { - return b(...args); - } - - function b(...args) - { - if (flag) { - OSRExit(); - return args[0]; - } - return c(...args); - } - - function c(...args) - { - return d(...args); - } - - function d(...args) - { - return Math.max(...args); - } - noInline(d); - - var array = [0, 1, 2, 3, 4, 5]; - for (var i = 0; i < 1e6; ++i) { - flag = i > (1e6 - 100); - var ret = a(...array); - if (!flag) - shouldBe(ret, 5); - else - shouldBe(ret, 0); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/spread-non-array.js b/implementation-contributed/javascriptcore/stress/spread-non-array.js deleted file mode 100644 index 124789ad2a..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-non-array.js +++ /dev/null @@ -1,62 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion."); -} -function foo(m) { - return [...m]; -} -noInline(foo); - -let map = new Map; -map.set(20, 30); -map.set(40, 50); - -let called = 0; -let customIterator = { - [Symbol.iterator]: function() { - called++; - let count = 0; - return { - next() { - called++; - count++; - if (count === 1) - return {done: false, value: [20, 30]}; - if (count === 2) - return {done: false, value: [40, 50]}; - return {done: true}; - } - }; - } -}; -for (let i = 0; i < 10000; i++) { - for (let o of [customIterator, map]) { - let [[a, b], [c, d]] = foo(o); - assert(a === 20); - assert(b === 30); - assert(c === 40); - assert(d === 50); - } - assert(called === 4); - called = 0; -} - -function bar(m) { - return [...m, ...m]; -} -noInline(bar); -for (let i = 0; i < 10000; i++) { - for (let o of [customIterator, map]) { - let [[a, b], [c, d], [e, f], [g, h]] = bar(o); - assert(a === 20); - assert(b === 30); - assert(c === 40); - assert(d === 50); - assert(e === 20); - assert(f === 30); - assert(g === 40); - assert(h === 50); - } - assert(called === 8); - called = 0; -} diff --git a/implementation-contributed/javascriptcore/stress/spread-non-varargs.js b/implementation-contributed/javascriptcore/stress/spread-non-varargs.js deleted file mode 100644 index dc26af7a7c..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-non-varargs.js +++ /dev/null @@ -1,35 +0,0 @@ -(function () { - "use strict"; - - function shouldBe(actual, expected) - { - if (actual !== expected) - throw new Error('bad value: ' + actual); - } - noInline(shouldBe); - - var flag = false; - - function a(...args) - { - if (flag) { - OSRExit(); - return args[0]; - } - return b(...args); - } - - function b(...args) - { - return Math.max(...args); - } - - for (var i = 0; i < 1e6; ++i) { - flag = i > (1e6 - 100); - var ret = a(0, 1, 2, 3, 4); - if (!flag) - shouldBe(ret, 4); - else - shouldBe(ret, 0); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/spread-optimized-properly.js b/implementation-contributed/javascriptcore/stress/spread-optimized-properly.js deleted file mode 100644 index 3c8566d80a..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-optimized-properly.js +++ /dev/null @@ -1,155 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion"); -} - -function test(f) { f(); } - -function shallowEq(a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; ++i) { - if (a[i] !== b[i]) - return false; - } - return true; -} - -function makeArrayIterator(arr, f) { - let i = 0; - return { - next() { - f(); - if (i >= arr.length) - return {done: true}; - return {value: arr[i++], done: false}; - } - }; -} - -test(function() { - let arr = [10, 20]; - arr.__proto__ = {[Symbol.iterator]: Array.prototype[Symbol.iterator]}; - function bar(a) { - a.x; - return [...a]; - } - noInline(bar); - for (let i = 0; i < 10000; i++) { - assert(shallowEq(bar(arr), arr)); - } -}); - -test(function() { - let arr = [10, 20]; - let count = 0; - function callback() { - count++; - } - - arr.__proto__ = { - [Symbol.iterator]: function() { - return makeArrayIterator(this, callback); - } - }; - - function bar(a) { - a.x; - return [...a]; - } - noInline(bar); - for (let i = 0; i < 10000; i++) { - let t = bar(arr); - assert(count === 3); - count = 0; - assert(shallowEq(t, arr)); - } -}); - -test(function() { - let arr = [10, 20]; - let count = 0; - function callback() { - count++; - } - - arr[Symbol.iterator] = function() { - return makeArrayIterator(this, callback); - }; - - function bar(a) { - a.x; - return [...a]; - } - noInline(bar); - for (let i = 0; i < 10000; i++) { - let t = bar(arr); - assert(count === 3); - count = 0; - assert(shallowEq(t, arr)); - } -}); - -test(function() { - let arr = [10, 20]; - arr[Symbol.iterator] = Array.prototype[Symbol.iterator]; - function bar(a) { - a.x; - return [...a]; - } - noInline(bar); - for (let i = 0; i < 10000; i++) { - assert(shallowEq(bar(arr), arr)); - } -}); - -test(function() { - let arr = [, 20]; - let callCount = 0; - Object.defineProperty(arr, 0, {get() { ++callCount; return 10; }}); - function bar(a) { - a.x; - return [...a]; - } - noInline(bar); - for (let i = 0; i < 10000; i++) { - let t = bar(arr); - assert(callCount === 1); - assert(shallowEq(t, arr)); - assert(callCount === 2); - callCount = 0; - } -}); - -// We run this test last since it fires watchpoints for the protocol. -test(function() { - let iter = [][Symbol.iterator](); - let iterProto = Object.getPrototypeOf(iter); - let oldNext = iterProto.next; - - function hackedNext() { - let val = oldNext.call(this); - if ("value" in val) { - val.value++; - } - return val; - } - - function test(a) { - a.x; - return [...a]; - } - - for (let i = 0; i < 10000; ++i) { - let arr = [1,,3]; - let callCount = 0; - Object.defineProperty(arr, 1, { get: function() { ++callCount; iterProto.next = hackedNext; return 2; } }); - let t = test(arr); - assert(callCount === 1); - assert(t.length === 3); - assert(t[0] === 1); - assert(t[1] === 2); - assert(t[2] === 3); - iterProto.next = oldNext; - } -}); diff --git a/implementation-contributed/javascriptcore/stress/spread-outer-create-rest.js b/implementation-contributed/javascriptcore/stress/spread-outer-create-rest.js deleted file mode 100644 index 11e881ae33..0000000000 --- a/implementation-contributed/javascriptcore/stress/spread-outer-create-rest.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; - -function assert(b) { - if (!b) - throw new Error("Bad"); -} - -function foo(...args) { - return bar(args); -} -noInline(foo); - -function bar(args) { - return baz(...args); -} - -function baz(a, b) { - return a + b; -} - -for (let i = 0; i < 10000; ++i) - assert(foo(i, i+1) === (i + (i + 1))); diff --git a/implementation-contributed/javascriptcore/stress/static-function-delete.js b/implementation-contributed/javascriptcore/stress/static-function-delete.js deleted file mode 100644 index 66ccf01457..0000000000 --- a/implementation-contributed/javascriptcore/stress/static-function-delete.js +++ /dev/null @@ -1,10 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -shouldBe(RegExp.prototype.hasOwnProperty('exec'), true); -shouldBe(delete RegExp.prototype.exec, true); -shouldBe(RegExp.prototype.hasOwnProperty('exec'), false); -shouldBe(delete RegExp.prototype.exec, true); -shouldBe(RegExp.prototype.hasOwnProperty('exec'), false); diff --git a/implementation-contributed/javascriptcore/stress/static-function-put.js b/implementation-contributed/javascriptcore/stress/static-function-put.js deleted file mode 100644 index d47d5c8080..0000000000 --- a/implementation-contributed/javascriptcore/stress/static-function-put.js +++ /dev/null @@ -1,11 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} -var exec = RegExp.prototype.exec; -var nested = Object.create(RegExp.prototype); - -nested.exec = "Hello"; -shouldBe(nested.hasOwnProperty('exec'), true); -shouldBe(nested.exec, "Hello"); -shouldBe(/hello/.exec, exec); diff --git a/implementation-contributed/javascriptcore/stress/static-getter-delete.js b/implementation-contributed/javascriptcore/stress/static-getter-delete.js deleted file mode 100644 index c88ca0a376..0000000000 --- a/implementation-contributed/javascriptcore/stress/static-getter-delete.js +++ /dev/null @@ -1,47 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -// Before static functions (& accessors) are reified. -shouldThrow(function () { - 'use strict'; - RegExp.prototype.multiline = 'ok'; -}, 'TypeError: Attempted to assign to readonly property.'); - -(function () { - 'use strict'; - shouldBe(delete RegExp.prototype.global, true); - shouldBe(RegExp.prototype.hasOwnProperty('global'), false); - RegExp.prototype.global = 'hello' - shouldBe(RegExp.prototype.global, 'hello'); -}()); - -// After static functions (& accessors) are reified. -shouldThrow(function () { - 'use strict'; - RegExp.prototype.multiline = 'ok'; -}, 'TypeError: Attempted to assign to readonly property.'); - -(function () { - 'use strict'; - shouldBe(delete RegExp.prototype.multiline, true); - shouldBe(RegExp.prototype.hasOwnProperty('multiline'), false); - RegExp.prototype.multiline = 'hello' - shouldBe(RegExp.prototype.multiline, 'hello'); -}()); diff --git a/implementation-contributed/javascriptcore/stress/static-getter-descriptors.js b/implementation-contributed/javascriptcore/stress/static-getter-descriptors.js deleted file mode 100644 index a53096dc9f..0000000000 --- a/implementation-contributed/javascriptcore/stress/static-getter-descriptors.js +++ /dev/null @@ -1,12 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, 'global'); -shouldBe(JSON.stringify(descriptor), '{"enumerable":false,"configurable":true}'); - -shouldBe(descriptor.enumerable, false); -shouldBe(descriptor.configurable, true); -shouldBe(descriptor.set, undefined); -shouldBe(typeof descriptor.get, 'function'); diff --git a/implementation-contributed/javascriptcore/stress/static-getter-enumeration.js b/implementation-contributed/javascriptcore/stress/static-getter-enumeration.js deleted file mode 100644 index c67fd15939..0000000000 --- a/implementation-contributed/javascriptcore/stress/static-getter-enumeration.js +++ /dev/null @@ -1,8 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var keys = Object.keys(/Cocoa/); - -shouldBe(JSON.stringify(keys.sort()), '[]'); // non enumerable diff --git a/implementation-contributed/javascriptcore/stress/static-getter-get.js b/implementation-contributed/javascriptcore/stress/static-getter-get.js deleted file mode 100644 index 1d6acfa38f..0000000000 --- a/implementation-contributed/javascriptcore/stress/static-getter-get.js +++ /dev/null @@ -1,22 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var reg1 = /Cocoa/gi; -shouldBe(reg1.global, true); -shouldBe(reg1.ignoreCase, true); -shouldBe(reg1.multiline, false); -shouldBe(reg1.source, 'Cocoa'); - -var reg2 = /Cocoa/im; -shouldBe(reg2.global, false); -shouldBe(reg2.ignoreCase, true); -shouldBe(reg2.multiline, true); -shouldBe(reg2.source, 'Cocoa'); - -var reg3 = /Cappuccino/gm; -shouldBe(reg3.global, true); -shouldBe(reg3.ignoreCase, false); -shouldBe(reg3.multiline, true); -shouldBe(reg3.source, 'Cappuccino'); diff --git a/implementation-contributed/javascriptcore/stress/static-getter-in-names.js b/implementation-contributed/javascriptcore/stress/static-getter-in-names.js deleted file mode 100644 index 0c44df29ce..0000000000 --- a/implementation-contributed/javascriptcore/stress/static-getter-in-names.js +++ /dev/null @@ -1,7 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -shouldBe(JSON.stringify(Object.getOwnPropertyNames(RegExp.prototype).sort()), '["compile","constructor","dotAll","exec","flags","global","ignoreCase","multiline","source","sticky","test","toString","unicode"]'); -shouldBe(JSON.stringify(Object.getOwnPropertyNames(/Cocoa/).sort()), '["lastIndex"]'); diff --git a/implementation-contributed/javascriptcore/stress/static-getter-names.js b/implementation-contributed/javascriptcore/stress/static-getter-names.js deleted file mode 100644 index 00630898ac..0000000000 --- a/implementation-contributed/javascriptcore/stress/static-getter-names.js +++ /dev/null @@ -1,16 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var names = [ - 'global', - 'ignoreCase', - 'multiline', - 'source', -]; - -for (var name of names) { - var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, name); - shouldBe(descriptor.get.name, 'get ' + name); -} diff --git a/implementation-contributed/javascriptcore/stress/static-getter-put.js b/implementation-contributed/javascriptcore/stress/static-getter-put.js deleted file mode 100644 index aac8f4f1c6..0000000000 --- a/implementation-contributed/javascriptcore/stress/static-getter-put.js +++ /dev/null @@ -1,38 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -shouldThrow(function () { - 'use strict'; - RegExp.prototype.global = 'Cocoa'; -}, 'TypeError: Attempted to assign to readonly property.'); - -// Twice. -shouldThrow(function () { - 'use strict'; - RegExp.prototype.global = 'Cocoa'; -}, 'TypeError: Attempted to assign to readonly property.'); - -(function () { - 'use strict'; - delete RegExp.prototype.global; - RegExp.prototype.global = 'Cocoa'; - shouldBe(RegExp.prototype.global, 'Cocoa'); - shouldBe(/Cappuccino/.global, 'Cocoa'); -}()); diff --git a/implementation-contributed/javascriptcore/stress/strcat-emtpy.js b/implementation-contributed/javascriptcore/stress/strcat-emtpy.js deleted file mode 100644 index bf68ea1f14..0000000000 --- a/implementation-contributed/javascriptcore/stress/strcat-emtpy.js +++ /dev/null @@ -1,14 +0,0 @@ -function foo() { - "use strict"; - let a = "hello" + a; - return a; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - try { - foo(); - } catch (e) { - } -} diff --git a/implementation-contributed/javascriptcore/stress/strict-function-structure.js b/implementation-contributed/javascriptcore/stress/strict-function-structure.js deleted file mode 100644 index 2d5ef71b1e..0000000000 --- a/implementation-contributed/javascriptcore/stress/strict-function-structure.js +++ /dev/null @@ -1,8 +0,0 @@ -function foo(f) { f.hasOwnProperty("arguments"); } -noInline(foo); - -function bar() {} -foo(bar); - -function baz() { "use strict"; } -foo(baz); diff --git a/implementation-contributed/javascriptcore/stress/strict-mode-arguments-caller.js b/implementation-contributed/javascriptcore/stress/strict-mode-arguments-caller.js deleted file mode 100644 index 4ce89e3855..0000000000 --- a/implementation-contributed/javascriptcore/stress/strict-mode-arguments-caller.js +++ /dev/null @@ -1,13 +0,0 @@ -function strictArguments() { - "use strict"; - return arguments; -} - -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -shouldBe(strictArguments().caller, undefined); -shouldBe('caller' in strictArguments(), false); -shouldBe(Object.getOwnPropertyDescriptor(strictArguments(), 'caller'), undefined); diff --git a/implementation-contributed/javascriptcore/stress/strict-nested-function-structure.js b/implementation-contributed/javascriptcore/stress/strict-nested-function-structure.js deleted file mode 100644 index ef9d23558f..0000000000 --- a/implementation-contributed/javascriptcore/stress/strict-nested-function-structure.js +++ /dev/null @@ -1,12 +0,0 @@ -function foo(f) { f.hasOwnProperty("arguments"); } -noInline(foo); - -function bar() {} -foo(bar); - -function baz() { - "use strict"; - function boo() {} - return boo; -} -foo(baz()); diff --git a/implementation-contributed/javascriptcore/stress/strict-to-this-int.js b/implementation-contributed/javascriptcore/stress/strict-to-this-int.js deleted file mode 100644 index 806ed0bd7f..0000000000 --- a/implementation-contributed/javascriptcore/stress/strict-to-this-int.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(a, b) { - var result = a + b; - if (result) - return (a + b) + result + this; - else - return this.f; -} - -noInline(foo); - -var x; -Number.prototype.valueOf = function() { return x; }; - -function test(this_, a, b, x_) { - x = x_; - var result = foo.call(this_, a, b); - if (result != (a + b) * 2 + x_) - throw "Error: bad result: " + result; -} - -for (var i = 0; i < 100000; ++i) - test(5, 1, 2, 100); - -test(5, 2000000000, 2000000000, 1); -test(5, 1073741774, 1073741774, 1000); diff --git a/implementation-contributed/javascriptcore/stress/string-compare.js b/implementation-contributed/javascriptcore/stress/string-compare.js deleted file mode 100644 index 253e7cc631..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-compare.js +++ /dev/null @@ -1,78 +0,0 @@ -let typeCases = [ - "", - "0", - "1", - "a", - "aa", -] - -let operators = ["<", "<=", ">", ">=", "==", "!=", "===", "!=="]; - -function makeRope(a) -{ - return a + a; -} -noInline(makeRope); - -function makeString(a) -{ - return makeRope(a).slice(a.length); -} -noInline(makeString); - -for (let operator of operators) { - eval(` - function compareStringIdent(a, b) - { - return a ${operator} b; - } - noInline(compareStringIdent); - - function compareStringString(a, b) - { - return a ${operator} b; - } - noInline(compareStringString); - - function compareStringIdentString(a, b) - { - return a ${operator} b; - } - noInline(compareStringIdentString); - - function compareStringStringIdent(a, b) - { - return a ${operator} b; - } - noInline(compareStringStringIdent); - `); - - for (let left of typeCases) { - for (let right of typeCases) { - let expected = eval("'" + left + "'" + operator + "'" + right + "'"); - eval(` - for (let i = 0; i < 1e3; ++i) { - let stringIdentResult = compareStringIdent('${left}', '${right}'); - if (stringIdentResult !== ${expected}) - throw "Failed compareStringIdent('${left}', '${right}'), got " + stringIdentResult + " expected ${expected}"; - let resolvedLeftString = makeString('${left}'); - let resovledRightString = makeString('${right}'); - let stringStringResult = compareStringString(resolvedLeftString, resovledRightString); - if (stringStringResult !== ${expected}) - throw "Failed compareStringString('${left}', '${right}'), got " + stringStringResult + " expected ${expected}"; - stringStringResult = compareStringString(makeString('${left}'), makeString('${right}')); - if (stringStringResult !== ${expected}) - throw "Failed compareStringString('${left}', '${right}'), got " + stringStringResult + " expected ${expected}"; - - if (compareStringIdentString(makeString('${left}'), '${right}') !== ${expected}) - throw "Failed compareStringIdentString('${left}', '${right}'), expected was ${expected}"; - if (compareStringStringIdent('${left}', makeString('${right}')) !== ${expected}) - throw "Failed compareStringStringIdent('${left}', '${right}'), expected was ${expected}"; - - if (('${left}' ${operator} '${right}') !== ${expected}) - throw "Failed constant folding of ('${left}' ${operator} '${right}'). How do you even fail constant folding?"; - } - `) - } - } -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/string-from-char-code-change-structure-not-dead.js b/implementation-contributed/javascriptcore/stress/string-from-char-code-change-structure-not-dead.js deleted file mode 100644 index 5478f73da6..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-from-char-code-change-structure-not-dead.js +++ /dev/null @@ -1,31 +0,0 @@ -var globalString; - -function foo(o, v) -{ - var x = o.f; - globalString = String.fromCharCode(v); - return x + o.f; -} - -// Break some watchpoints. -var o = {f:24}; -o.g = 43; - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo({f:42}, {valueOf: function() { return 32; }}); - if (result != 84) - throw "Error: bad result: " + result; -} - -var globalO = {f:42}; -var weirdValue = {valueOf: function() { - delete globalO.f; - globalO.__defineGetter__("f", function() { return 75; }); - return 33; -}}; -var result = foo(globalO, weirdValue); -if (result != 42 + 75) - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/string-from-char-code-change-structure.js b/implementation-contributed/javascriptcore/stress/string-from-char-code-change-structure.js deleted file mode 100644 index ab60026d7a..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-from-char-code-change-structure.js +++ /dev/null @@ -1,29 +0,0 @@ -function foo(o, v) -{ - var x = o.f; - String.fromCharCode(v); - return x + o.f; -} - -noInline(foo); - -// Break some watchpoints. -var o = {f:24}; -o.g = 43; - -for (var i = 0; i < 10000; ++i) { - var result = foo({f:42}, {valueOf: function() { return 32; }}); - if (result != 84) - throw "Error: bad result: " + result; -} - -var globalO = {f:42}; -var weirdValue = {valueOf: function() { - delete globalO.f; - globalO.__defineGetter__("f", function() { return 75; }); - return 33; -}}; -var result = foo(globalO, weirdValue); -if (result != 42 + 75) - throw "Error: bad result at end: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/string-from-char-code-slow.js b/implementation-contributed/javascriptcore/stress/string-from-char-code-slow.js deleted file mode 100644 index 0fea07b3af..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-from-char-code-slow.js +++ /dev/null @@ -1,10 +0,0 @@ -var result = (function() { - var result; - for (var i = 0; i < 1000000; ++i) - result = String.fromCharCode(1000); - return result -})(); - -if (result != "Ϩ") - throw "Error: bad result: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/string-from-code-point.js b/implementation-contributed/javascriptcore/stress/string-from-code-point.js deleted file mode 100644 index 1ae22ec716..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-from-code-point.js +++ /dev/null @@ -1,135 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error("bad value: " + String(actual)); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -function toCodePoints(string) { - var result = []; - for (var codePoint of string) { - result.push(codePoint.codePointAt(0)); - } - return result; -} - -shouldBe(String.fromCodePoint(), ""); -shouldBe(String.fromCodePoint(0), "\0"); -shouldBe(String.fromCodePoint(0, 0), "\0\0"); - -var tests = [ - "", - "Hello", - "Cocoa", - "Cappuccino Cocoa", - "日本語", - "マルãƒãƒã‚¤ãƒˆ", - "å‰é‡Žå±‹", - "𠮷野家", // Contain a surrogate pair. -]; - -for (var test of tests) { - shouldBe(String.fromCodePoint.apply(String, toCodePoints(test)), test); -} - -function passThrough(codePoint) { - var string = String.fromCodePoint(codePoint); - shouldBe(string.codePointAt(0), codePoint); -} - -var numberTests = [ - [ 0x10FFFF, "\uDBFF\uDFFF" ], - [ 0x10FFFE, "\uDBFF\uDFFE" ], - [ 0xFFFF, "\uFFFF" ], - [ 0x10000, "\uD800\uDC00" ], - [ 0x10001, "\uD800\uDC01" ], - [ -0.0, "\u0000" ], - [ 0xD800, "\uD800" ], - [ 0xDC00, "\uDC00" ], -]; - -for (var test of numberTests) { - shouldBe(String.fromCodePoint(test[0]), test[1]); -} - -shouldBe(String.fromCodePoint(0xD800, 0xDC00).codePointAt(0), 0x10000); - -// Non-character code points. -for (var i = 0; i < 17; ++i) { - var plane = 0x10000 * i; - passThrough(plane + 0xFFFE); - passThrough(plane + 0xFFFF); -} - -for (var start = 0xFDD0; start <= 0xFDEF; ++start) { - passThrough(start); -} - -var invalidTests = [ - -1, - 1.2, - 1.5, - 30.01, - -11.0, - NaN, - Number.Infinity, - -Number.Infinity, - 0x10FFFF + 1, - 0x7FFFFFFF, - 0x7FFFFFFF + 1, - 0xFFFFFFFF, - 0xFFFFFFFF + 1, - 0x100000000 + 32, // String.fromCharCode(0x100000000 + 32) produces a space, but String.fromCodePoint should throw an error. - "Hello", - undefined, - {}, -]; - -for (var test of invalidTests) { - shouldThrow(function () { - String.fromCodePoint(test); - }, "RangeError: Arguments contain a value that is out of range of code points"); -} - -// toNumber causes errors. -shouldThrow(function () { - String.fromCodePoint(Symbol.iterator); -}, "TypeError: Cannot convert a symbol to a number") - -var toNumberObject = { - valueOf() { - throw new Error("valueOf is called"); - } -}; - -shouldThrow(function () { - String.fromCodePoint(toNumberObject); -}, "Error: valueOf is called") - -shouldThrow(function () { - String.fromCodePoint(Symbol.iterator, toNumberObject); -}, "TypeError: Cannot convert a symbol to a number") - -var convertAndPassTests = [ - [ null, "\0" ], - [ [], "\0" ], - [ "0x41", "A" ], - [ "", "\0" ], - [ true, "\u0001" ], - [ false, "\u0000" ], -]; - -for (var test of convertAndPassTests) { - shouldBe(String.fromCodePoint(test[0]), test[1]); -} diff --git a/implementation-contributed/javascriptcore/stress/string-ident-to-not-string-var-equality.js b/implementation-contributed/javascriptcore/stress/string-ident-to-not-string-var-equality.js deleted file mode 100644 index 3ceb1b262f..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-ident-to-not-string-var-equality.js +++ /dev/null @@ -1,32 +0,0 @@ -function foo(a, b) { - return a === b; -} - -function bar(a, b) { - return b === a; -} - -function test(a, b, expected) { - var fooActual = foo(a, b); - var barActual = bar(a, b); - - if (fooActual != expected) - throw new Error("Bad result: " + fooActual); - if (barActual != expected) - throw new Error("Bad result: " + barActual); -} - -for (var i = 0; i < 10000; ++i) { - test("foo", "foo", true); - test("foo", "bar", false); - test("fuz", 42, false); - test("buz", {}, false); - test("bla", null, false); -} - -var fooString = ""; -fooString += "f"; -for (var i = 0; i < 2; ++i) - fooString += "o"; - -test(fooString, "foo", true); diff --git a/implementation-contributed/javascriptcore/stress/string-instanceof.js b/implementation-contributed/javascriptcore/stress/string-instanceof.js deleted file mode 100644 index 929a6c99f6..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-instanceof.js +++ /dev/null @@ -1,13 +0,0 @@ -function foo(value, proto) -{ - return value instanceof proto; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo("hello", String); - if (result) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/string-iterators.js b/implementation-contributed/javascriptcore/stress/string-iterators.js deleted file mode 100644 index f66b620031..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-iterators.js +++ /dev/null @@ -1,212 +0,0 @@ -// This test checks the behavior of the String iterator - -var testString = "Cocoa,Cappuccino"; -var stringIterator = testString[Symbol.iterator](); -var stringIteratorPrototype = stringIterator.__proto__; -var stringIteratorPrototypeNext = stringIteratorPrototype.next; - -if (stringIterator.hasOwnProperty('next')) - throw "next method should exists on %StringIteratorPrototype%"; -if (!stringIteratorPrototype.hasOwnProperty('next')) - throw "next method should exists on %StringIteratorPrototype%"; - -var iterator = testString[Symbol.iterator](); -var i = 0; -while (true) { - var {done, value} = iterator.next(); - if (done) - break; - if (value !== testString[i]) - throw "Error: bad value: " + value; - i++; -} - -if (testString.length !== i) - throw "Error: bad value: " + i; - -function testSurrogatePair(testString, expected, numberOfElements) { - if (testString.length !== numberOfElements) - throw "Error: bad value: " + testString.length; - - var iterator = testString[Symbol.iterator](); - var i = 0; - while (true) { - var {done, value} = iterator.next(); - if (done) - break; - if (value !== expected[i]) - throw "Error: bad value: " + value; - i++; - } - - if (i !== expected.length) - throw "Error: bad value: " + i; - - for (var codePoint of testString) { - if (value !== expected[i]) - throw "Error: bad value: " + value; - } -} - -// "\uD842\uDFB7\u91ce\u5bb6" -var testString = "𠮷野家"; -var expected = [ - String.fromCharCode(0xD842, 0xDFB7), - String.fromCharCode(0x91CE), - String.fromCharCode(0x5BB6), -]; -testSurrogatePair(testString, expected, 4); - -var testString = "A\uD842"; -var expected = [ - String.fromCharCode(0x0041), - String.fromCharCode(0xD842), -]; -testSurrogatePair(testString, expected, 2); - -var testString = "A\uD842A"; -var expected = [ - String.fromCharCode(0x0041), - String.fromCharCode(0xD842), - String.fromCharCode(0x0041), -]; -testSurrogatePair(testString, expected, 3); - -var testString = "A\uD842\uDFB7"; -var expected = [ - String.fromCharCode(0x0041), - String.fromCharCode(0xD842, 0xDFB7), -]; -testSurrogatePair(testString, expected, 3); - -var testString = "\uD842A\uDFB7"; -var expected = [ - String.fromCharCode(0xD842), - String.fromCharCode(0x0041), - String.fromCharCode(0xDFB7), -]; -testSurrogatePair(testString, expected, 3); - -var testString = "\uDFB7\uD842A"; -var expected = [ - String.fromCharCode(0xDFB7), - String.fromCharCode(0xD842), - String.fromCharCode(0x0041), -]; -testSurrogatePair(testString, expected, 3); - -var string1 = "Cocoa"; -var string1Iterator = string1[Symbol.iterator](); -var index = 0; -while (true) { - var result = stringIteratorPrototypeNext.call(string1Iterator); - var value = result.value; - if (result.done) { - break; - } - if (value !== string1[index++]) - throw "Error: bad value: " + value; -} -if (index !== 5) - throw "Error: bad index: " + index; - -function increment(iter) { - return stringIteratorPrototypeNext.call(iter); -} -var string1 = "Cocoa"; -var string2 = "Cocoa"; -var string1Iterator = string1[Symbol.iterator](); -var string2Iterator = string2[Symbol.iterator](); -for (var i = 0; i < 3; ++i) { - var value1 = increment(string1Iterator).value; - var value2 = increment(string2Iterator).value; - if (value1 !== value2) - throw "Error: bad value: " + value1 + " " + value2; -} - -var string1 = "Cappuccino"; -var string1Iterator = string1[Symbol.iterator](); - -var value = string1Iterator.next().value; -if (value !== "C") - throw "Error: bad value: " + value; -var value = string1Iterator.next().value; -if (value !== "a") - throw "Error: bad value: " + value; -var value = string1Iterator.next().value; -if (value !== "p") - throw "Error: bad value: " + value; -var value = stringIteratorPrototypeNext.call(string1Iterator).value; -if (value !== "p") - throw "Error: bad value: " + value; -var value = stringIteratorPrototypeNext.call(string1Iterator).value; -if (value !== "u") - throw "Error: bad value: " + value; -var value = stringIteratorPrototypeNext.call(string1Iterator).value; -if (value !== "c") - throw "Error: bad value: " + value; -var value = stringIteratorPrototypeNext.call(string1Iterator).value; -if (value !== "c") - throw "Error: bad value: " + value; -var value = stringIteratorPrototypeNext.call(string1Iterator).value; -if (value !== "i") - throw "Error: bad value: " + value; -var value = stringIteratorPrototypeNext.call(string1Iterator).value; -if (value !== "n") - throw "Error: bad value: " + value; -var value = stringIteratorPrototypeNext.call(string1Iterator).value; -if (value !== "o") - throw "Error: bad value: " + value; -var value = stringIteratorPrototypeNext.call(string1Iterator).value; -if (value !== undefined) - throw "Error: bad value: " + value; - -var primitives = [ - "string", - 42, - 0.03, - false, - true, - Symbol("Cocoa"), - null, - undefined -]; -for (var primitive of primitives) { - var didThrow = null; - try { - stringIteratorPrototypeNext.call(primitive); - } catch (e) { - didThrow = e; - } - if (!didThrow) - throw "Error: no error thrown"; - var message = 'TypeError: %StringIteratorPrototype%.next requires that |this| be a String Iterator instance'; - if (primitive == null) - message = 'TypeError: %StringIteratorPrototype%.next requires that |this| not be null or undefined' - if (String(didThrow) !== message) - throw "Error: bad error thrown: " + didThrow; -} - -var nonRelatedObjects = [ - {}, - [], - new Date(), - new Error(), - Object(Symbol()), - new String("Cappuccino"), - new Number(42), - new Boolean(false), - function () { }, -]; -for (var object of nonRelatedObjects) { - var didThrow = null; - try { - stringIteratorPrototypeNext.call(object); - } catch (e) { - didThrow = e; - } - if (!didThrow) - throw "Error: no error thrown"; - if (String(didThrow) !== 'TypeError: %StringIteratorPrototype%.next requires that |this| be a String Iterator instance') - throw "Error: bad error thrown: " + didThrow; -} diff --git a/implementation-contributed/javascriptcore/stress/string-joining-long-strings-should-not-crash.js b/implementation-contributed/javascriptcore/stress/string-joining-long-strings-should-not-crash.js deleted file mode 100644 index b300f4b838..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-joining-long-strings-should-not-crash.js +++ /dev/null @@ -1,16 +0,0 @@ -//@ skip if $memoryLimited -//@ runDefault if !$memoryLimited -// This test should not crash. - -var error; -let str = ''; -let arr = [{}, 2, 3]; -try { - for (let z = 0; z < 30; z++) - str = arr.join(str); // exponentially grow length of string. -} catch(e) { - error = e; -} - -if (!error) - throw Error("Failed"); diff --git a/implementation-contributed/javascriptcore/stress/string-normalize.js b/implementation-contributed/javascriptcore/stress/string-normalize.js deleted file mode 100644 index f9dae4948e..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-normalize.js +++ /dev/null @@ -1,120 +0,0 @@ -function unicode(value) { - return value.split('').map((val) => "\\u" + ("0000" + val.charCodeAt(0).toString(16)).slice(-4)).join(''); -} - -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${unicode(String(actual))}`); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -shouldBe(String.prototype.hasOwnProperty('normalize'), true); -shouldBe(String.prototype.hasOwnProperty.length, 1); -shouldBe(Object.getOwnPropertyDescriptor(String.prototype, 'normalize').writable, true); -shouldBe(Object.getOwnPropertyDescriptor(String.prototype, 'normalize').enumerable, false); -shouldBe(Object.getOwnPropertyDescriptor(String.prototype, 'normalize').configurable, true); - -shouldThrow(() => { - "Test".normalize("Invalid"); -}, `RangeError: argument does not match any normalization form`); - -function normalizeTest(original, defaultValue, nfc, nfd, nfkc, nfkd) { - shouldBe(original.normalize(), defaultValue); - shouldBe(original.normalize("NFC"), nfc); - shouldBe(original.normalize("NFD"), nfd); - shouldBe(original.normalize("NFKC"), nfkc); - shouldBe(original.normalize("NFKD"), nfkd); -} - -{ - let text = "Cocoa"; - normalizeTest(text, text, text, text, text, text); -} - -{ - // ã†ã•ãŽ - // \u3046\u3055\u304e - let text = "\u3046\u3055\u304e"; - normalizeTest(text, text, text, "\u3046\u3055\u304d\u3099", text, "\u3046\u3055\u304d\u3099"); -} - -{ - // é - let text = "\u00e9"; - normalizeTest(text, text, text, "\u0065\u0301", text, "\u0065\u0301"); -} - -{ - // http://unicode.org/faq/normalization.html#6 - let text = "\u03d3"; - normalizeTest(text, text, text, "\u03d2\u0301", "\u038e", "\u03a5\u0301"); -} -{ - // http://unicode.org/faq/normalization.html#6 - let text = "\u03d4"; - normalizeTest(text, text, text, "\u03d2\u0308", "\u03ab", "\u03a5\u0308"); -} -{ - // http://unicode.org/faq/normalization.html#6 - let text = "\u1e9b"; - normalizeTest(text, text, text, "\u017f\u0307", "\u1e61", "\u0073\u0307"); -} - -{ - // http://unicode.org/faq/normalization.html#6 - let text = "\u1e9b"; - normalizeTest(text, text, text, "\u017f\u0307", "\u1e61", "\u0073\u0307"); -} - -{ - // http://unicode.org/faq/normalization.html#12 - normalizeTest("\ud834\udd60", - "\ud834\udd58\ud834\udd65\ud834\udd6e", - "\ud834\udd58\ud834\udd65\ud834\udd6e", - "\ud834\udd58\ud834\udd65\ud834\udd6e", - "\ud834\udd58\ud834\udd65\ud834\udd6e", - "\ud834\udd58\ud834\udd65\ud834\udd6e"); - normalizeTest("\uFB2C", - "\u05e9\u05bc\u05c1", - "\u05e9\u05bc\u05c1", - "\u05e9\u05bc\u05c1", - "\u05e9\u05bc\u05c1", - "\u05e9\u05bc\u05c1", - "\u05e9\u05bc\u05c1" - ); - normalizeTest("\u0390", - "\u0390", - "\u0390", - "\u03b9\u0308\u0301", - "\u0390", - "\u03b9\u0308\u0301" - ); - normalizeTest("\u1F82", - "\u1f82", - "\u1f82", - "\u03b1\u0313\u0300\u0345", - "\u1f82", - "\u03b1\u0313\u0300\u0345" - ); - normalizeTest("\uFDFA", - "\ufdfa", - "\ufdfa", - "\ufdfa", - "\u0635\u0644\u0649\u0020\u0627\u0644\u0644\u0647\u0020\u0639\u0644\u064a\u0647\u0020\u0648\u0633\u0644\u0645", - "\u0635\u0644\u0649\u0020\u0627\u0644\u0644\u0647\u0020\u0639\u0644\u064a\u0647\u0020\u0648\u0633\u0644\u0645" - ); -} diff --git a/implementation-contributed/javascriptcore/stress/string-object-define-own-property.js b/implementation-contributed/javascriptcore/stress/string-object-define-own-property.js deleted file mode 100644 index 522522e8c9..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-object-define-own-property.js +++ /dev/null @@ -1,69 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var string = new String("Cocoa"); -shouldBe(Reflect.defineProperty(string, 0, { -}), true); -shouldBe(Reflect.get(string, 0), 'C'); - -shouldBe(Reflect.defineProperty(string, 0, { - configurable: false -}), true); -shouldBe(Reflect.get(string, 0), 'C'); - -shouldBe(Reflect.defineProperty(string, 0, { - configurable: true -}), false); -shouldBe(Reflect.get(string, 0), 'C'); - -shouldBe(Reflect.defineProperty(string, 0, { - enumerable: true -}), true); -shouldBe(Reflect.get(string, 0), 'C'); - -shouldBe(Reflect.defineProperty(string, 0, { - enumerable: false -}), false); -shouldBe(Reflect.get(string, 0), 'C'); - -shouldBe(Reflect.defineProperty(string, 0, { - writable: false, -}), true); -shouldBe(Reflect.get(string, 0), 'C'); - -shouldBe(Reflect.defineProperty(string, 0, { - writable: false, - value: 'C', - configurable: true -}), false); -shouldBe(Reflect.get(string, 0), 'C'); - -shouldBe(Reflect.defineProperty(string, 0, { - writable: true, - value: 52, -}), false); -shouldBe(Reflect.get(string, 0), 'C'); - -shouldBe(Reflect.defineProperty(string, 0, { - value: 52, -}), false); -shouldBe(Reflect.get(string, 0), 'C'); - -shouldBe(Reflect.defineProperty(string, 0, { - writable: false, - value: 'C', - configurable: false -}), true); -shouldBe(Reflect.get(string, 0), 'C'); - -// Out of range. -shouldBe(Reflect.defineProperty(string, 2000, { - value: 'Cappuccino' -}), true); -shouldBe(Reflect.get(string, 2000), 'Cappuccino'); -shouldBe(Reflect.defineProperty(string, "Hello", { - value: 'Cappuccino' -}), true); -shouldBe(Reflect.get(string, "Hello"), 'Cappuccino'); diff --git a/implementation-contributed/javascriptcore/stress/string-object-put-by-index.js b/implementation-contributed/javascriptcore/stress/string-object-put-by-index.js deleted file mode 100644 index fd9cbd45fe..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-object-put-by-index.js +++ /dev/null @@ -1,41 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, message) { - var error = null; - try { - func(); - } catch (e) { - error = e; - } - if (!error) - throw new Error("not thrown."); - if (String(error) !== message) - throw new Error("bad error: " + String(error)); -} - -function testSloppy(string) -{ - string[0] = 52; - shouldBe(string[0], 'C'); - - string[100] = 52; - shouldBe(string[100], 52); -} - -function testStrict(string) -{ - 'use strict'; - shouldThrow(() => { - string[0] = 52; - }, `TypeError: Attempted to assign to readonly property.`); - shouldBe(string[0], 'C'); - - string[100] = 52; - shouldBe(string[100], 52); -} - -testSloppy(new String("Cocoa")); -testStrict(new String("Cocoa")); diff --git a/implementation-contributed/javascriptcore/stress/string-out-of-bounds-negative-proto-value.js b/implementation-contributed/javascriptcore/stress/string-out-of-bounds-negative-proto-value.js deleted file mode 100644 index cb480504f3..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-out-of-bounds-negative-proto-value.js +++ /dev/null @@ -1,14 +0,0 @@ -function foo(s) { - return s[-1]; -} - -noInline(foo); - -String.prototype[-1] = "hello"; - -for (var i = 0; i < 100000; ++i) { - var result = foo("hello"); - if (result != "hello") - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/string-proto.js b/implementation-contributed/javascriptcore/stress/string-proto.js deleted file mode 100644 index ddcf012a07..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-proto.js +++ /dev/null @@ -1,12 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function target(value) -{ - return value.__proto__; -} -noInline(target); -for (var i = 0; i < 1e6; ++i) - shouldBe(target("Cocoa"), String.prototype) diff --git a/implementation-contributed/javascriptcore/stress/string-prototype-charCodeAt-on-too-long-rope.js b/implementation-contributed/javascriptcore/stress/string-prototype-charCodeAt-on-too-long-rope.js deleted file mode 100644 index 334be90bba..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-prototype-charCodeAt-on-too-long-rope.js +++ /dev/null @@ -1,33 +0,0 @@ -// Skip this test because it's slow and it tests a very narrow condition. -//@ skip - -function shouldEqual(actual, expected) { - if (actual != expected) { - throw "ERROR: expect " + expected + ", actual " + actual; - } -} - -s0 = ""; -s1 = "NaNxxxxx"; - -try { - for (var count = 0; count < 27; count++) { - var oldS1 = s1; - s1 += s1; - s0 = oldS1; - } -} catch (e) { } - -try { - s1 += s0; -} catch (e) { } - -var exception; -try { - for (var v of s1) { } -} catch (e) { - exception = e; -} - -shouldEqual(exception, "Error: Out of memory"); - diff --git a/implementation-contributed/javascriptcore/stress/string-prototype-methods-endsWith-startsWith-includes-correctness.js b/implementation-contributed/javascriptcore/stress/string-prototype-methods-endsWith-startsWith-includes-correctness.js deleted file mode 100644 index ad267aa62a..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-prototype-methods-endsWith-startsWith-includes-correctness.js +++ /dev/null @@ -1,180 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion!"); -} - -function test(f) { - for (let i = 0; i < 500; i++) - f(); -} - -test(function() { - let foo = "hello"; - let threw = false; - try { - foo.endsWith(/foo/); - } catch(e) { - assert(e.toString() === "TypeError: Argument to String.prototype.endsWith cannot be a RegExp"); - threw = true; - } - assert(threw); -}); - -test(function() { - let foo = "hello"; - let threw = false; - try { - foo.startsWith(/foo/); - } catch(e) { - assert(e.toString() === "TypeError: Argument to String.prototype.startsWith cannot be a RegExp"); - threw = true; - } - assert(threw); -}); - -test(function() { - let foo = "hello"; - let threw = false; - try { - foo.includes(/foo/); - } catch(e) { - assert(e.toString() === "TypeError: Argument to String.prototype.includes cannot be a RegExp"); - threw = true; - } - assert(threw); -}); - -test(function() { - let props = []; - let proxy = new Proxy(/foo/, { - get(theTarget, prop) { - props.push(prop); - return theTarget[prop]; - } - }); - - let foo = "hello"; - let threw = false; - try { - foo.endsWith(proxy); - } catch(e) { - assert(e.toString() === "TypeError: Argument to String.prototype.endsWith cannot be a RegExp"); - threw = true; - } - assert(threw); - assert(props.length === 1); - assert(props[0] === Symbol.match); -}); - -test(function() { - let props = []; - let proxy = new Proxy(/foo/, { - get(theTarget, prop) { - props.push(prop); - return theTarget[prop]; - } - }); - - let foo = "hello"; - let threw = false; - try { - foo.startsWith(proxy); - } catch(e) { - assert(e.toString() === "TypeError: Argument to String.prototype.startsWith cannot be a RegExp"); - threw = true; - } - assert(threw); - assert(props.length === 1); - assert(props[0] === Symbol.match); -}); - -test(function() { - let props = []; - let proxy = new Proxy(/foo/, { - get(theTarget, prop) { - props.push(prop); - return theTarget[prop]; - } - }); - - let foo = "hello"; - let threw = false; - try { - foo.includes(proxy); - } catch(e) { - assert(e.toString() === "TypeError: Argument to String.prototype.includes cannot be a RegExp"); - threw = true; - } - assert(threw); - assert(props.length === 1); - assert(props[0] === Symbol.match); -}); - -test(function() { - let props = []; - let proxy = new Proxy(/foo/, { - get(theTarget, prop) { - props.push(prop); - if (prop === Symbol.match) - return undefined; - return theTarget[prop]; - } - }); - - let foo = "/foo/"; - let threw = false; - let result = foo.includes(proxy); - assert(result); - assert(props.length === 5); - assert(props[0] === Symbol.match); - assert(props[1] === Symbol.toPrimitive); - assert(props[2] === "toString"); - assert(props[3] === "source"); - assert(props[4] === "flags"); -}); - -test(function() { - let props = []; - let proxy = new Proxy(/foo/, { - get(theTarget, prop) { - props.push(prop); - if (prop === Symbol.match) - return undefined; - return theTarget[prop]; - } - }); - - let foo = "/foo/"; - let threw = false; - let result = foo.startsWith(proxy); - assert(result); - assert(props.length === 5); - assert(props[0] === Symbol.match); - assert(props[1] === Symbol.toPrimitive); - assert(props[2] === "toString"); - assert(props[3] === "source"); - assert(props[4] === "flags"); -}); - -test(function() { - let props = []; - let proxy = new Proxy(/foo/, { - get(theTarget, prop) { - props.push(prop); - if (prop === Symbol.match) - return undefined; - return theTarget[prop]; - } - }); - - let foo = "/foo/"; - let threw = false; - let result = foo.endsWith(proxy); - assert(result); - assert(props.length === 5); - assert(props[0] === Symbol.match); - assert(props[1] === Symbol.toPrimitive); - assert(props[2] === "toString"); - assert(props[3] === "source"); - assert(props[4] === "flags"); -}); diff --git a/implementation-contributed/javascriptcore/stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js b/implementation-contributed/javascriptcore/stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js deleted file mode 100644 index 0072f8ba3c..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js +++ /dev/null @@ -1,23 +0,0 @@ -//@ skip if $memoryLimited -//@ runFTLNoCJIT("--timeoutMultiplier=1.5") if !$memoryLimited -//@ slow! -// This test should not crash or fail any assertions. - -function shouldEqual(testId, actual, expected) { - if (actual != expected) { - throw testId + ": ERROR: expect " + expected + ", actual " + actual; - } -} - -var exception = undefined; - -s2 = 'x'.repeat(0x3fffffff); -r0 = /((?=\S))/giy; - -try { - s2.replace(r0, '') -} catch (e) { - exception = e; -} - -shouldEqual(10000, exception, "Error: Out of memory"); diff --git a/implementation-contributed/javascriptcore/stress/string-prototype-scopes-global-lexical-environment-strict.js b/implementation-contributed/javascriptcore/stress/string-prototype-scopes-global-lexical-environment-strict.js deleted file mode 100644 index 665ed4b556..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-prototype-scopes-global-lexical-environment-strict.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var error = null; -let charAt = String.prototype.charAt; -try { - charAt(); -} catch (e) { - error = e; -} -shouldBe(String(error), `TypeError: Type error`); diff --git a/implementation-contributed/javascriptcore/stress/string-prototype-scopes-global-lexical-environment.js b/implementation-contributed/javascriptcore/stress/string-prototype-scopes-global-lexical-environment.js deleted file mode 100644 index 8a5ca0136d..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-prototype-scopes-global-lexical-environment.js +++ /dev/null @@ -1,13 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var error = null; -let charAt = String.prototype.charAt; -try { - charAt(); -} catch (e) { - error = e; -} -shouldBe(String(error), `TypeError: Type error`); diff --git a/implementation-contributed/javascriptcore/stress/string-prototype-scopes-strict.js b/implementation-contributed/javascriptcore/stress/string-prototype-scopes-strict.js deleted file mode 100644 index 2830646869..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-prototype-scopes-strict.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; - -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var error = null; -try { - eval(` - var charAt = String.prototype.charAt; - charAt(); - `); -} catch (e) { - error = e; -} -shouldBe(String(error), `TypeError: Type error`); - -var error = null; -try { - var charAt = String.prototype.charAt; - charAt(); -} catch (e) { - error = e; -} -shouldBe(String(error), `TypeError: Type error`); - -var error = null; -try { - let charAt = String.prototype.charAt; - charAt(); - function refer() { charAt; } -} catch (e) { - error = e; -} -shouldBe(String(error), `TypeError: Type error`); - -(function () { - var error = null; - var ok = 42; - try { - var charAt = String.prototype.charAt; - charAt(); - } catch (e) { - error = e; - } - - function refer() { charAt; } // Refer the charAt variable. - shouldBe(String(error), `TypeError: Type error`); - return ok; -}()); diff --git a/implementation-contributed/javascriptcore/stress/string-prototype-scopes.js b/implementation-contributed/javascriptcore/stress/string-prototype-scopes.js deleted file mode 100644 index 3b61e71635..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-prototype-scopes.js +++ /dev/null @@ -1,54 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var error = null; -try { - eval(` - var charAt = String.prototype.charAt; - charAt(); - `); -} catch (e) { - error = e; -} -shouldBe(String(error), `TypeError: Type error`); - -var error = null; -try { - var charAt = String.prototype.charAt; - charAt(); -} catch (e) { - error = e; -} -shouldBe(String(error), `TypeError: Type error`); - -var error = null; -try { - let charAt = String.prototype.charAt; - charAt(); - function refer() { charAt; } -} catch (e) { - error = e; -} -shouldBe(String(error), `TypeError: Type error`); - -(function () { - var error = null; - var ok = 42; - try { - var charAt = String.prototype.charAt; - charAt(); - } catch (e) { - error = e; - } - - function refer() { charAt; } // Refer the charAt variable. - shouldBe(String(error), `TypeError: Type error`); - return ok; -}()); - -var object = { __proto__: String.prototype, toString() { return "Cocoa"; } }; -with (object) { - shouldBe(charAt(0), `C`); -} diff --git a/implementation-contributed/javascriptcore/stress/string-raw.js b/implementation-contributed/javascriptcore/stress/string-raw.js deleted file mode 100644 index 17c769bb02..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-raw.js +++ /dev/null @@ -1,154 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${actual}`); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -shouldBe(String.raw.name, 'raw'); -shouldBe(String.raw.length, 1); - -shouldThrow(function () { - String.raw(); -}, "TypeError: String.raw requires template not be null or undefined"); - -shouldThrow(function () { - String.raw(undefined); -}, "TypeError: String.raw requires template not be null or undefined"); - -shouldThrow(function () { - String.raw({ raw: undefined }); -}, "TypeError: String.raw requires template.raw not be null or undefined"); - -shouldThrow(function () { - String.raw({ raw: null }); -}, "TypeError: String.raw requires template.raw not be null or undefined"); - -shouldThrow(function () { - String.raw({ - get length() { - return new Error('template.length called'); - }, - - raw: { - get length() { - throw new Error("template.raw.length called"); - } - } - }); -}, "Error: template.raw.length called"); - -shouldBe(String.raw({ - raw: { - length: -1 - } -}), ""); - -shouldBe(String.raw({ - raw: { - length: -2.5 - } -}), ""); - -shouldBe(String.raw({ - raw: { - length: -Infinity - } -}), ""); - -shouldBe(String.raw({ - raw: { - length: 0 - } -}), ""); - -shouldBe(String.raw({ - raw: { - length: NaN - } -}), ""); - -function generateTemplate() { - var cooked = []; - cooked.raw = Array.from(arguments); - return cooked; -} - -shouldBe(String.raw(generateTemplate("", ",", ",", ""), "Cocoa", "Cappuccino", "Matcha"), "Cocoa,Cappuccino,Matcha"); -shouldBe(String.raw(generateTemplate("", ",", ",", ""), "Cocoa", "Cappuccino", "Matcha", "Hello"), "Cocoa,Cappuccino,Matcha"); -shouldBe(String.raw(generateTemplate("", ",", ",", ""), "Cocoa", "Cappuccino"), "Cocoa,Cappuccino,"); -shouldBe(String.raw(generateTemplate("", ",", ",", ""), "Cocoa"), "Cocoa,,"); -shouldBe(String.raw(generateTemplate("", ",", ",", "")), ",,"); - -function Counter(p) { - var count = 0; - return { - toString() { - return count++; - } - }; -} - -var counter = Counter(); -shouldBe(String.raw(generateTemplate(counter, counter, counter, counter)), "0123"); -var counter = Counter(); -shouldBe(String.raw(generateTemplate(counter, counter, counter, counter), counter), "01234"); -var counter = Counter(); -shouldBe(String.raw(generateTemplate(counter, counter, counter, counter), counter, counter), "012345"); -var counter = Counter(); -shouldBe(String.raw(generateTemplate(counter, counter, counter, counter), counter, counter, counter), "0123456"); -var counter = Counter(); -shouldBe(String.raw(generateTemplate(counter, counter, counter, counter), counter, counter, counter, counter), "0123456"); -var counter = Counter(); -shouldBe(String.raw(generateTemplate(counter, counter, counter, counter), counter, counter, counter, counter), "0123456"); -var counter = Counter(); -shouldBe(String.raw(generateTemplate(counter, counter, counter, counter), counter, counter, counter, counter, counter), "0123456"); - - -shouldBe(String.raw({ - raw: { - length: 3.5, - 0: "a", - 1: "b", - 2: "c" - } -}, "d", "e", "f", "g"), "adbec"); - -shouldBe(String.raw({ - raw: { - length: 2.3, - 0: "a", - 1: "b", - 2: "c" - } -}, "d", "e", "f", "g"), "adb"); - -shouldBe(String.raw({ - raw: { - length: 2.3, - 0: "a", - 2: "c" - } -}, "d", "e", "f", "g"), "adundefined"); - -shouldBe(String.raw({ - raw: { - length: 2.3, - 0: "a", - 1: "b", - 2: "c" - } -}, undefined, "e", "f", "g"), "aundefinedb"); diff --git a/implementation-contributed/javascriptcore/stress/string-repeat-copy-chars-crash.js b/implementation-contributed/javascriptcore/stress/string-repeat-copy-chars-crash.js deleted file mode 100644 index 62758a3e63..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-repeat-copy-chars-crash.js +++ /dev/null @@ -1,8 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var s = 'xxxxxxxxxxxxxxAxxxxxxxxxxxxxxxxxxxxA–'; -var result = s.replace(/A/g, 'b'); -shouldBe(result, 'xxxxxxxxxxxxxxbxxxxxxxxxxxxxxxxxxxxb–'); diff --git a/implementation-contributed/javascriptcore/stress/string-repeat-edge-cases.js b/implementation-contributed/javascriptcore/stress/string-repeat-edge-cases.js deleted file mode 100644 index 8ba9e1dc17..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-repeat-edge-cases.js +++ /dev/null @@ -1,57 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: {String(actual)}`); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -{ - let object = { - toString() - { - return "C"; - } - }; - shouldBe(String.prototype.repeat.call(object, 2.5), "CC"); - shouldBe(String.prototype.repeat.call(object, -0), ""); - shouldBe(String.prototype.repeat.call(object, 1), "C"); - shouldBe(String.prototype.repeat.call(object, { - valueOf() - { - return 2.5; - } - }), "CC"); - shouldThrow(() => { - String.prototype.repeat.call(object, { - valueOf() - { - throw new Error("OK"); - } - }); - }, `Error: OK`); -} - -{ - shouldBe(String.prototype.repeat.call("", 0), ""); - shouldBe(String.prototype.repeat.call("", 0xFFFFFFFFF), ""); - shouldThrow(() => { - String.prototype.repeat.call("", Infinity); - }, `RangeError: String.prototype.repeat argument must be greater than or equal to 0 and not be Infinity`); - - shouldThrow(() => { - String.prototype.repeat.call("", -2000); - }, `RangeError: String.prototype.repeat argument must be greater than or equal to 0 and not be Infinity`); -} diff --git a/implementation-contributed/javascriptcore/stress/string-replace-constant-folding-replacer-not-string.js b/implementation-contributed/javascriptcore/stress/string-replace-constant-folding-replacer-not-string.js deleted file mode 100644 index 6c44cb33ac..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-replace-constant-folding-replacer-not-string.js +++ /dev/null @@ -1,13 +0,0 @@ -function foo() { - "foo".replace(/f/g, ""); - return "foo".replace(/f/g, 42); -} -noInline(foo); - -let result; -for (let i = 0; i < 10000; i++) { - result = foo(); - if (result !== "42oo") - throw new Error("Error: bad result: " + result); -} - diff --git a/implementation-contributed/javascriptcore/stress/string-replace-proxy.js b/implementation-contributed/javascriptcore/stress/string-replace-proxy.js deleted file mode 100644 index d0a3c3eff3..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-replace-proxy.js +++ /dev/null @@ -1,50 +0,0 @@ -function assert(assertion) { - if (typeof assertion != "string") - throw new Error("Invalid assertion."); - - let result = eval(assertion); - - if (!result) - throw new Error("Bad assertion: " + assertion); -} - -let calls = 0; -let getSet = []; - -function resetTracking() -{ - calls = 0; - getSet = []; -} - -let getSetProxyReplace = new Proxy( - { - replace: function(string, search, replaceWith) - { - calls++; - return string.replace(search, replaceWith); - } - }, { - get: function(o, k) - { - getSet.push(k); - return o[k]; - }, - set: function(o, k, v) - { - getSet.push(k); - o[k] = v; - } - }); - -resetTracking(); -let replaceResult = getSetProxyReplace.replace("This is a test", / /g, "_"); -assert('replaceResult == "This_is_a_test"'); -assert('calls === 1') -assert('getSet == "replace"'); - -resetTracking(); -replaceResult = getSetProxyReplace.replace("This is a test", " ", "_"); -assert('replaceResult == "This_is a test"'); -assert('calls === 1') -assert('getSet == "replace"'); diff --git a/implementation-contributed/javascriptcore/stress/string-rope-with-custom-valueof.js b/implementation-contributed/javascriptcore/stress/string-rope-with-custom-valueof.js deleted file mode 100644 index 0eb7f80b73..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-rope-with-custom-valueof.js +++ /dev/null @@ -1,61 +0,0 @@ -// This file tests the concatenating of known strings with different objects with overridden valueOf functions. -// Note: we intentionally do not test Symbols since they cannot be appended to strings... - -function catNumber(obj) { - return "test" + "things" + obj; -} -noInline(catNumber); - -number = { valueOf: function() { return 1; } }; - -function catBool(obj) { - return "test" + "things" + obj; -} -noInline(catBool); - -bool = { valueOf: function() { return true; } }; - -function catUndefined(obj) { - return "test" + "things" + obj; -} -noInline(catUndefined); - -undef = { valueOf: function() { return undefined; } }; - -function catRandom(obj) { - return "test" + "things" + obj; -} -noInline(catRandom); - -i = 0; -random = { valueOf: function() { - switch (i % 3) { - case 0: - return number.valueOf(); - case 1: - return bool.valueOf(); - case 2: - return undef.valueOf(); - } -} }; - -for (i = 0; i < 100000; i++) { - if (catNumber(number) !== "testthings1") - throw "bad number"; - if (catBool(bool) !== "testthingstrue") - throw "bad bool"; - if (catUndefined(undef) !== "testthingsundefined") - throw "bad undefined"; - if (catRandom(random) !== "testthings" + random.valueOf()) - throw "bad random"; -} - -// Try passing new types to each of the other functions. -for (i = 0; i < 100000; i++) { - if (catUndefined(number) !== "testthings1") - throw "bad number"; - if (catNumber(bool) !== "testthingstrue") - throw "bad bool"; - if (catBool(undef) !== "testthingsundefined") - throw "bad undefined"; -} diff --git a/implementation-contributed/javascriptcore/stress/string-symbol-customization.js b/implementation-contributed/javascriptcore/stress/string-symbol-customization.js deleted file mode 100644 index 5ecaf0c4db..0000000000 --- a/implementation-contributed/javascriptcore/stress/string-symbol-customization.js +++ /dev/null @@ -1,108 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -shouldThrow(() => { - "Cocoa".search({ - [Symbol.search]: 42 - }); -}, `TypeError: 42 is not a function`); - -shouldThrow(() => { - "Cocoa".match({ - [Symbol.match]: 42 - }); -}, `TypeError: 42 is not a function`); - -shouldThrow(() => { - "Cocoa".search({ - [Symbol.search]: {} - }); -}, `TypeError: Object is not a function`); - -shouldThrow(() => { - "Cocoa".match({ - [Symbol.match]: {} - }); -}, `TypeError: Object is not a function`); - -shouldBe("Cocoa".search({ - [Symbol.search]: null, - toString() - { - return "C" - } -}), 0); - -shouldBe("Cocoa".match({ - [Symbol.match]: null, - toString() - { - return "C" - } -})[0], "C"); - -shouldBe("Cocoa".search({ - [Symbol.search]: undefined, - toString() - { - return "C" - } -}), 0); - -shouldBe("Cocoa".match({ - [Symbol.match]: undefined, - toString() - { - return "C" - } -})[0], "C"); - -shouldBe("Cocoa".search({ - [Symbol.search]() - { - return 42; - } -}), 42); - -shouldBe("Cocoa".match({ - [Symbol.match]() - { - return 42; - } -}), 42); - -RegExp.prototype[Symbol.search] = function () { return 42; }; -RegExp.prototype[Symbol.match] = function () { return 42; }; - -shouldBe("Cocoa".search({ - [Symbol.search]: null -}), 42); - -shouldBe("Cocoa".match({ - [Symbol.match]: null -}), 42); - -shouldBe("Cocoa".search({ - [Symbol.search]: undefined -}), 42); - -shouldBe("Cocoa".match({ - [Symbol.match]: undefined -}), 42); diff --git a/implementation-contributed/javascriptcore/stress/sub-order-evaluation.js b/implementation-contributed/javascriptcore/stress/sub-order-evaluation.js deleted file mode 100644 index 21f923431b..0000000000 --- a/implementation-contributed/javascriptcore/stress/sub-order-evaluation.js +++ /dev/null @@ -1,27 +0,0 @@ -function assert(a, message) { - if (!a) - throw new Error(message); -} - -function assertThrowTypeError(a, b, message) { - try { - let n = a - b; - assert(false, message + ": Should throw TypeError, but executed without exception"); - } catch (e) { - assert(e instanceof TypeError, message + ": expected TypeError, got: " + e); - } -} - -let o = { - valueOf: function () { throw new Error("Oops"); } -}; - -assertThrowTypeError(Symbol("3"), o, "Symbol + Object should throw TypeError"); - -try { - let n = o - Symbol("3"); - assert(false, message + ": Should throw Error, but executed without exception"); -} catch (e) { - assert(e.message === "Oops","Expected Error('Oops'), got: " + e); -} - diff --git a/implementation-contributed/javascriptcore/stress/sub-overflows-after-not-equal.js b/implementation-contributed/javascriptcore/stress/sub-overflows-after-not-equal.js deleted file mode 100644 index 06c62ee096..0000000000 --- a/implementation-contributed/javascriptcore/stress/sub-overflows-after-not-equal.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a) { - if (a != 0) - return a - 1; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(42); - if (result != 41) - throw "Error: bad result in loop: " + result; -} - -var result = foo(-2147483648); -if (result != -2147483649) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/super-call-does-not-look-up-constructor.js b/implementation-contributed/javascriptcore/stress/super-call-does-not-look-up-constructor.js deleted file mode 100644 index 1a14249994..0000000000 --- a/implementation-contributed/javascriptcore/stress/super-call-does-not-look-up-constructor.js +++ /dev/null @@ -1,20 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var called = null; -class B { - constructor() { - called = 'B'; - } -} - -class C extends B { -} -B.prototype.constructor = function F() { - called = 'F'; -}; - -new C(); -shouldBe(called, 'B'); diff --git a/implementation-contributed/javascriptcore/stress/super-call-function-subclass.js b/implementation-contributed/javascriptcore/stress/super-call-function-subclass.js deleted file mode 100644 index 375c00996e..0000000000 --- a/implementation-contributed/javascriptcore/stress/super-call-function-subclass.js +++ /dev/null @@ -1,15 +0,0 @@ -function assert(a) { - if (!a) - throw new Error("Bad"); -} - -class A extends Function { - t() { - super.call(this); - return 3; - } -} - -let a = new A(); -assert(a.t() == 3); - diff --git a/implementation-contributed/javascriptcore/stress/super-dot-call-and-apply.js b/implementation-contributed/javascriptcore/stress/super-dot-call-and-apply.js deleted file mode 100644 index 0d52683ed4..0000000000 --- a/implementation-contributed/javascriptcore/stress/super-dot-call-and-apply.js +++ /dev/null @@ -1,50 +0,0 @@ -function assert(a) { - if (!a) - throw new Error("Bad Assertion!"); -} - -class A { - constructor(prop) { - this.prop = prop; - } - call() { - return this.prop; - } - apply() { - return this.prop; - } -} - -class B extends A { - testSuper() { - assert(super.call() == 'value'); - assert(super.apply() == 'value'); - } -} - -const obj = new B('value') -obj.testSuper() - -class C {} - -class D extends C { - testSuper() { - try { - super.call(); - assert(false); - } catch(e) { - assert(e.message == "super.call is not a function. (In 'super.call()', 'super.call' is undefined)"); - } - - try { - super.apply(); - assert(false); - } catch(e) { - assert(e.message == "super.apply is not a function. (In 'super.apply()', 'super.apply' is undefined)"); - } - } -} - -let d = new D(); -d.testSuper(); - diff --git a/implementation-contributed/javascriptcore/stress/super-force-ic-fail.js b/implementation-contributed/javascriptcore/stress/super-force-ic-fail.js deleted file mode 100644 index dbff88d3af..0000000000 --- a/implementation-contributed/javascriptcore/stress/super-force-ic-fail.js +++ /dev/null @@ -1,56 +0,0 @@ -let assert = (a) => { - if (!a) - throw Error("Bad Assertion"); -} - -let aObj = { - get foo() { return this.a; } -}; - -let obj = { - jaz() { - return super.foo; - } -}; -obj.a = "foo"; - -Object.setPrototypeOf(obj, aObj); - -noInline(obj.jaz); - -for (let i = 0; i < 10000; i++) { - if (i == 9999) { - delete aObj.foo; - assert(obj.jaz() === undefined); - } else { - assert(obj.jaz() == "foo"); - } - -} - -let bObj = { - get foo() { return this.a; } -}; - -let obj2 = { - foo() { - return super.foo; - } -}; -obj2.a = "foo"; - -Object.setPrototypeOf(obj2, bObj); - -noInline(obj.jaz); - -for (let i = 0; i < 10000; i++) { - if (i == 9999) { - Object.defineProperty(bObj, "foo", { - get: () => {return "boo"; } - }); - assert(obj2.foo() == "boo"); - } else { - assert(obj2.foo() == "foo"); - } -} - diff --git a/implementation-contributed/javascriptcore/stress/super-getter-reset-ic.js b/implementation-contributed/javascriptcore/stress/super-getter-reset-ic.js deleted file mode 100644 index 35c335b98b..0000000000 --- a/implementation-contributed/javascriptcore/stress/super-getter-reset-ic.js +++ /dev/null @@ -1,33 +0,0 @@ -let assert = (a) => { - if (!a) - throw "Bad!"; -} - -let n = 200; - -let A = { - c: 42 -} - -let C = { - __proto__: A -} - -let B = { - __proto__: C, - f(i) { - return super.c; - } -} - -var result = 0; -for (var i = 0; i < n; ++i) { - if (i == n / 2 ) { - // This operation is going to force op_get_by_id_with_this to be regenerated - Object.defineProperty(A, "c", {get: () => 12}); - } - result += B.f(i); -} - -assert(result, 5400); - diff --git a/implementation-contributed/javascriptcore/stress/super-in-lexical-scope.js b/implementation-contributed/javascriptcore/stress/super-in-lexical-scope.js deleted file mode 100644 index 48dee401ec..0000000000 --- a/implementation-contributed/javascriptcore/stress/super-in-lexical-scope.js +++ /dev/null @@ -1,63 +0,0 @@ -function testSyntax(script) { - try { - eval(script); - } catch (error) { - if (error instanceof SyntaxError) - throw new Error("Bad error: " + String(error)); - } -} - -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error) + "(Expected: " + message + ")"); -} - -testSyntaxError(`super()`, `SyntaxError: super is not valid in this context.`); -testSyntaxError(`super.hello()`, `SyntaxError: super is not valid in this context.`); -testSyntaxError(` -{ - super(); -} -`, `SyntaxError: super is not valid in this context.`); -testSyntaxError(` -{ - super.hello(); -} -`, `SyntaxError: super is not valid in this context.`); -testSyntaxError(` -function test() -{ - super(); -} -`, `SyntaxError: super is not valid in this context.`); -testSyntaxError(` -function test() -{ - super.hello(); -} -`, `SyntaxError: super is not valid in this context.`); -testSyntaxError(` -function test() -{ - { - super(); - } -} -`, `SyntaxError: super is not valid in this context.`); -testSyntaxError(` -function test() -{ - { - super.hello(); - } -} -`, `SyntaxError: super is not valid in this context.`); diff --git a/implementation-contributed/javascriptcore/stress/super-method-calls-check-tdz.js b/implementation-contributed/javascriptcore/stress/super-method-calls-check-tdz.js deleted file mode 100644 index 2c76c6e9b0..0000000000 --- a/implementation-contributed/javascriptcore/stress/super-method-calls-check-tdz.js +++ /dev/null @@ -1,25 +0,0 @@ -class Base {} - -class Derived extends Base { - constructor() { - super.method(); - super(); - } -}; - -function test() { - let failed = false - try { - new Derived(); - failed = true; - } catch (e) { - if (!(e instanceof ReferenceError)) - failed = true; - } - if (failed) - throw "did not throw reference error"; -} - -for (i = 0; i < 10000; i++) { - test(); -} diff --git a/implementation-contributed/javascriptcore/stress/super-property-access-exceptions.js b/implementation-contributed/javascriptcore/stress/super-property-access-exceptions.js deleted file mode 100644 index cf413c15a8..0000000000 --- a/implementation-contributed/javascriptcore/stress/super-property-access-exceptions.js +++ /dev/null @@ -1,153 +0,0 @@ -function assert(b, m = "Bad!") { - if (!b) { - throw new Error(m); - } -} - -function test(f, iters = 1000) { - for (let i = 0; i < iters; i++) - f(); -} - -test(function() { - function fooProp() { return 'foo'; } - noInline(fooProp); - - let shouldThrow = false; - class A { - get foo() { - if (shouldThrow) - throw new Error; - return 20; - } - get x() { return this._x; } - } - - class B extends A { - constructor(x) { - super(); - this._x = x; - } - - bar() { - this._x = super.foo; - } - - baz() { - this._x = super[fooProp()]; - } - } - - function foo(i) { - let b = new B(i); - noInline(b.__lookupGetter__('foo')); - let threw = false; - try { - b.bar(); - } catch(e) { - threw = true; - } - if (threw) - assert(b.x === i); - else - assert(b.x === 20); - } - function bar(i) { - let b = new B(i); - noInline(b.__lookupGetter__('foo')); - let threw = false; - try { - b.baz(); - } catch(e) { - threw = true; - } - if (threw) - assert(b.x === i); - else - assert(b.x === 20, "b.x " + b.x + " " + i); - } - noInline(bar); - - for (let i = 0; i < 10000; i++) { - foo(i); - bar(i); - } - shouldThrow = true; - foo(23); - bar(24); - -}, 1); - -test(function() { - function fooProp() { return 'foo'; } - noInline(fooProp); - - function func(i) { - if (shouldThrow) - throw new Error(); - return i; - } - noInline(func); - - let shouldThrow = false; - class A { - set foo(x) { - this._x = x; - } - get x() { return this._x; } - } - - class B extends A { - constructor(x) { - super(); - this._x = x; - } - - bar(x) { - super.foo = func(x); - } - - baz(x) { - super[fooProp()] = func(x); - } - } - - function foo(i) { - let b = new B(i); - noInline(b.__lookupGetter__('foo')); - let threw = false; - try { - b.bar(i + 1); - } catch(e) { - threw = true; - } - if (threw) - assert(b.x === i); - else - assert(b.x === i + 1); - } - function bar(i) { - let b = new B(i); - noInline(b.__lookupGetter__('foo')); - let threw = false; - try { - b.baz(i + 1); - } catch(e) { - threw = true; - } - if (threw) - assert(b.x === i); - else - assert(b.x === i + 1); - } - noInline(bar); - - for (let i = 0; i < 10000; i++) { - foo(i); - bar(i); - } - shouldThrow = true; - foo(23); - bar(24); - -}, 1); diff --git a/implementation-contributed/javascriptcore/stress/super-property-access-object-literal-to-this-2.js b/implementation-contributed/javascriptcore/stress/super-property-access-object-literal-to-this-2.js deleted file mode 100644 index 9dba44591c..0000000000 --- a/implementation-contributed/javascriptcore/stress/super-property-access-object-literal-to-this-2.js +++ /dev/null @@ -1,58 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} - -function test(f, n = 1000) { - for (let i = 0; i < n; ++i) - f(); -} - -let o1 = { - get foo() { - return this; - } -}; - -let o2 = { - __proto__: o1, - a() { - "use strict"; - return super.foo; - }, - - aa() { - "use strict"; - let arr = () => super.foo; - return arr(); - } -}; - -var A = o2.a; -var AA = o2.aa; - -let globalObj = this; - -AA(); - -test(function() { - let num = o2.a.call(25); - assert(typeof num === "object"); - assert(num instanceof Number); - - let str = o2.a.call("foo bar"); - assert(typeof str === "object"); - assert(str instanceof String); - assert(str == "foo bar"); - - let o = {}; - assert(o2.a.call(o) === o); - - assert(A() === globalObj); - assert(AA() === globalObj); - - assert(o2.a.call(undefined) === globalObj); - assert(o2.a.call(null) === globalObj); - assert(o2.aa.call(undefined) === globalObj); - assert(o2.aa.call(null) === globalObj); -}); diff --git a/implementation-contributed/javascriptcore/stress/super-property-access-object-literal-to-this.js b/implementation-contributed/javascriptcore/stress/super-property-access-object-literal-to-this.js deleted file mode 100644 index e293a290d9..0000000000 --- a/implementation-contributed/javascriptcore/stress/super-property-access-object-literal-to-this.js +++ /dev/null @@ -1,108 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} - -function test(f, n = 1000) { - for (let i = 0; i < n; ++i) - f(); -} - -let o1 = { - get foo() { - "use strict"; - return this; - } -}; - -let o2 = { - __proto__: o1, - a() { - return super.foo; - }, - - aa() { - let arr = () => super.foo; - return arr(); - }, - - b() { - "use strict"; - return super.foo; - }, - - bb() { - "use strict"; - let arr = () => super.foo; - return arr(); - } -}; - -var A = o2.a; -var AA = o2.aa; -var B = o2.b; -var BB = o2.b; - -let globalObj = this; - -test(function() { - let num = o2.a.call(25); - assert(typeof num === "object"); - assert(num instanceof Number); - - let str = o2.a.call("foo bar"); - assert(typeof str === "object"); - assert(str instanceof String); - assert(str == "foo bar"); - - let o = {}; - assert(o2.a.call(o) === o); - - assert(A() === globalObj); -}); - -test(function() { - let num = o2.aa.call(25); - assert(typeof num === "object"); - assert(num instanceof Number); - - let str = o2.aa.call("foo bar"); - assert(typeof str === "object"); - assert(str instanceof String); - assert(str == "foo bar"); - - let o = {}; - assert(o2.aa.call(o) === o); - - assert(AA() === globalObj); -}); - -test(function() { - let num = o2.b.call(25); - assert(typeof num === "number"); - assert(num === 25); - - let str = o2.b.call("foo bar"); - assert(typeof str === "string"); - assert(str === "foo bar"); - - let o = {}; - assert(o2.b.call(o) === o); - - assert(B() === undefined); -}); - -test(function() { - let num = o2.bb.call(25); - assert(typeof num === "number"); - assert(num === 25); - - let str = o2.bb.call("foo bar"); - assert(typeof str === "string"); - assert(str === "foo bar"); - - let o = {}; - assert(o2.bb.call(o) === o); - - assert(BB() === undefined); -}); diff --git a/implementation-contributed/javascriptcore/stress/super-property-access-tdz.js b/implementation-contributed/javascriptcore/stress/super-property-access-tdz.js deleted file mode 100644 index 3abbf207d0..0000000000 --- a/implementation-contributed/javascriptcore/stress/super-property-access-tdz.js +++ /dev/null @@ -1,92 +0,0 @@ -function assert(b, m = "Bad!") { - if (!b) { - throw new Error(m); - } -} - -function test(f, iters = 1000) { - for (let i = 0; i < iters; i++) - f(); -} - -function shouldThrowTDZ(f) { - let threw = false; - try { - f(); - } catch(e) { - assert(e instanceof ReferenceError); - assert(e.toString() === "ReferenceError: Cannot access uninitialized variable."); - threw = true; - } - assert(threw); -} - -test(function() { - class A { - get foo() { - return this._x; - } - set foo(x) { - this._x = x; - } - } - - function fooProp() { return 'foo'; } - - class B extends A { - constructor() { - super.foo = 20; - } - } - - class C extends A { - constructor() { - super[fooProp()] = 20; - } - } - - class D extends A { - constructor() { - super[fooProp()]; - } - } - - class E extends A { - constructor() { - super.foo; - } - } - - class F extends A { - constructor() { - (() => super.foo = 20)(); - } - } - - class G extends A { - constructor() { - (() => super[fooProp()] = 20)(); - } - } - - class H extends A { - constructor() { - (() => super[fooProp()])(); - } - } - - class I extends A { - constructor() { - (() => super.foo)(); - } - } - - shouldThrowTDZ(function() { new B; }); - shouldThrowTDZ(function() { new C; }); - shouldThrowTDZ(function() { new D; }); - shouldThrowTDZ(function() { new E; }); - shouldThrowTDZ(function() { new F; }); - shouldThrowTDZ(function() { new G; }); - shouldThrowTDZ(function() { new H; }); - shouldThrowTDZ(function() { new I; }); -}); diff --git a/implementation-contributed/javascriptcore/stress/super-property-access-to-this.js b/implementation-contributed/javascriptcore/stress/super-property-access-to-this.js deleted file mode 100644 index ab3e464303..0000000000 --- a/implementation-contributed/javascriptcore/stress/super-property-access-to-this.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} - -function test(f, n = 1000) { - for (let i = 0; i < n; ++i) - f(); -} - -class Base { - get foo() { return this; } -} - -class Child extends Base { - a() { - return super.foo; - } - - b() { - let arr = () => super.foo; - return arr(); - } -}; - -let A = Child.prototype.a; -var AA = Child.prototype.a; -this.AAA = Child.prototype.a; - -let globalObj = this; - -test(function() { - assert(Child.prototype.a.call("xyz") === "xyz"); - let obj = {}; - assert(Child.prototype.a.call(obj) === obj); - assert(Child.prototype.a.call(25) === 25); - assert(Child.prototype.a.call(globalObj) === globalObj); - - assert(Child.prototype.b.call("xyz") === "xyz"); - assert(Child.prototype.b.call(obj) === obj); - assert(Child.prototype.b.call(25) === 25); - assert(Child.prototype.b.call(globalObj) === globalObj); - - assert(A() === undefined); - assert(AA() === undefined); - assert(AAA() === undefined); -}); diff --git a/implementation-contributed/javascriptcore/stress/super-property-access.js b/implementation-contributed/javascriptcore/stress/super-property-access.js deleted file mode 100644 index 65996a7597..0000000000 --- a/implementation-contributed/javascriptcore/stress/super-property-access.js +++ /dev/null @@ -1,586 +0,0 @@ -function assert(b, m = "Bad!") { - if (!b) { - throw new Error(m); - } -} - -function test(f, iters = 1000) { - for (let i = 0; i < iters; i++) - f(); -} - -function func(x) { - return x; -} -noInline(func); - -test(function() { - class A { - constructor(x) - { - this._value = x; - } - - set value(x) { this._value = x; } - get value() { return this._value; } - } - - class B extends A { - set value(x) { super.value = x; } - get value() { return super.value; } - } - - let arr = []; - for (let i = 0; i < 1000; i++) { - arr.push(new B(20)); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === 20); - } - for (let i = 0; i < 1000; i++) { - arr[i].value = i; - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i); - } -}, 2); - -test(function() { - function value() { return 'value'; } - noInline(value); - - class A { - constructor(x, f = func) - { - this._value = x; - this._func = f; - } - - set value(x) { this._value = x; } - get value() { return this._value; } - get func() { return this._func; } - } - - class B extends A { - set value(x) { super[value()] = x; } - get value() { return super[value()]; } - inc() { return super[value()]++; } - dec() { return super[value()]--; } - preInc() { return ++super[value()]; } - preDec() { return --super[value()]; } - plusEq(x) { super[value()] += x; } - minusEq(x) { super[value()] -= x; } - timesEq(x) { super[value()] *= x; } - divEq(x) { super[value()] /= x; } - - funcDot(x) { return super.func(x); } - funcBracket(x) { return super.func(x); } - } - - let arr = []; - for (let i = 0; i < 1000; i++) { - arr.push(new B(20)); - } - for (let i = 0; i < 1000; i++) { - let t = arr[i].value; - assert(t === 20); - } - for (let i = 0; i < 1000; i++) { - arr[i].value = i; - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i); - } - - for (let i = 0; i < 1000; i++) { - let v = arr[i].inc(); - assert(v === i); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i+1); - } - - for (let i = 0; i < 1000; i++) { - let v = arr[i].dec(); - assert(v === i+1); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i); - } - - for (let i = 0; i < 1000; i++) { - let v = arr[i].preInc(); - assert(v === i+1); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i+1); - } - - for (let i = 0; i < 1000; i++) { - let v = arr[i].preDec(); - assert(v === i); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i); - } - - for (let i = 0; i < 1000; i++) { - arr[i].plusEq(i); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i+i); - } - - for (let i = 0; i < 1000; i++) { - arr[i].minusEq(i); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i); - } - - for (let i = 0; i < 1000; i++) { - arr[i].timesEq(i); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i*i); - } - - for (let i = 0; i < 1000; i++) { - if (i === 0) - arr[i].value = 0; - else - arr[i].divEq(i); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i); - } - - for (let i = 0; i < 1000; i++) { - arr[i] = new B(0, function(a) { return i + a; }); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].funcDot(i) === i + i); - assert(arr[i].funcBracket(i*2) === i + i*2); - } - -}, 2); - - -test(function() { - class A { - constructor(x, f = func) - { - this._value = x; - this._func = f; - } - - set value(x) { this._value = x; } - get value() { return this._value; } - get func() { return this._func; } - } - - class B extends A { - set value(x) { (() => super.value = x)(); } - get value() { return (() => super.value)(); } - inc() { return (() => super.value++)(); } - dec() { return (() => super.value--)(); } - preInc() { return (() => ++super.value)(); } - preDec() { return (() => --super.value)(); } - plusEq(x) { (() => super.value += x)(); } - minusEq(x) { (() => super.value -= x)(); } - timesEq(x) { (() => super.value *= x)(); } - divEq(x) { (() => super.value /= x)(); } - - funcDot(x) { return (() => super.func(x))(); } - funcBracket(x) { return (() => super.func(x))(); } - } - - let arr = []; - for (let i = 0; i < 1000; i++) { - arr.push(new B(20)); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === 20); - } - for (let i = 0; i < 1000; i++) { - arr[i].value = i; - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i); - } - - for (let i = 0; i < 1000; i++) { - let v = arr[i].inc(); - assert(v === i); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i+1); - } - - for (let i = 0; i < 1000; i++) { - let v = arr[i].dec(); - assert(v === i+1); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i); - } - - for (let i = 0; i < 1000; i++) { - let v = arr[i].preInc(); - assert(v === i+1); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i+1); - } - - for (let i = 0; i < 1000; i++) { - let v = arr[i].preDec(); - assert(v === i); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i); - } - - for (let i = 0; i < 1000; i++) { - arr[i].plusEq(i); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i+i); - } - - for (let i = 0; i < 1000; i++) { - arr[i].minusEq(i); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i); - } - - for (let i = 0; i < 1000; i++) { - arr[i].timesEq(i); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i*i); - } - - for (let i = 0; i < 1000; i++) { - if (i === 0) - arr[i].value = 0; - else - arr[i].divEq(i); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].value === i); - } - - for (let i = 0; i < 1000; i++) { - arr[i] = new B(0, function(a) { return i + a; }); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].funcDot(i) === i + i); - assert(arr[i].funcBracket(i*2) === i + i*2); - } - -}, 2); - -test(function() { - function foo() { return 'foo'; } - noInline(foo); - class A { } - let obj = {}; - A.prototype.foo = obj; - A.prototype[0] = obj; - - - class B extends A { - baz() { return super[foo()]; } - jaz() { return super.foo; } - bar() { return super[0]; } - - } - - assert((new B).baz() === obj); - assert((new B).jaz() === obj); - assert((new B).bar() === obj); -}); - -test(function() { - class A { } - for (let i = 0; i < 1000; i++) - A.prototype[i] = i; - - - class B extends A { - index(i) { return super[i]; } - } - - let b = new B; - for (let i = 0; i < 1000; i++) { - assert(b.index(i) === i); - } -}, 2); - -test(function() { - let obj = {}; - class A { constructor(r) { this._foo = r; } } - Object.defineProperty(A.prototype, '0', { get: function() { return this._foo; } }); - - class B extends A { - bar() { return super[0]; } - } - - let rand = Math.random(); - assert((new B(rand)).bar() === rand); -}); - -test(function() { class A { - constructor() { this._array = []; } - set foo(x) { - this._array.push(x); - } - get array() { return this._array; } - } - - class B extends A { - baz(i) { - let o = {x:20, y:30, [i]:i}; - for (super.foo in o) { } - } - } - let arr = []; - for (let i = 0; i < 20; i++) - arr.push(new B); - for (let i = 0; i < arr.length; i++) { - let obj = arr[i]; - obj.baz(i); - } - for (let i = 0; i < arr.length; i++) { - let obj = arr[i].array; - assert(obj.length === 3) - assert(obj[0] === '' + i); - assert(obj[1] === 'x') - assert(obj[2] === 'y') - } -}, 100); - -test(function() { - function foo() { return 'foo'; } - noInline(foo); - class A { - constructor() { this._array = []; } - set foo(x) { - this._array.push(x); - } - get array() { return this._array; } - } - - class B extends A { - baz(i) { - let o = {x:20, y:30, [i]:i}; - for (super[foo()] in o) { } - } - } - let arr = []; - for (let i = 0; i < 20; i++) - arr.push(new B); - for (let i = 0; i < arr.length; i++) { - let obj = arr[i]; - obj.baz(i); - } - for (let i = 0; i < arr.length; i++) { - let obj = arr[i].array; - assert(obj.length === 3) - assert(obj[0] === '' + i); - assert(obj[1] === 'x') - assert(obj[2] === 'y') - } -}, 100); - -test(function() { - class A { - constructor() { this._array = []; } - set foo(x) { - this._array.push(x); - } - get array() { return this._array; } - } - - class B extends A { - baz(i) { - let o = ['' + i, "x", "y"]; - for (super.foo of o) { } - } - } - let arr = []; - for (let i = 0; i < 20; i++) - arr.push(new B); - for (let i = 0; i < arr.length; i++) { - let obj = arr[i]; - obj.baz(i); - } - for (let i = 0; i < arr.length; i++) { - let obj = arr[i].array; - assert(obj.length === 3) - assert(obj[0] === '' + i); - assert(obj[1] === 'x') - assert(obj[2] === 'y') - } -}, 100); - -test(function() { - function foo() { return 'foo'; } - class A { - constructor() { this._array = []; } - set foo(x) { - this._array.push(x); - } - get array() { return this._array; } - } - - class B extends A { - baz(i) { - let o = ['' + i, "x", "y"]; - for (super[foo()] of o) { } - } - } - let arr = []; - for (let i = 0; i < 20; i++) - arr.push(new B); - for (let i = 0; i < arr.length; i++) { - let obj = arr[i]; - obj.baz(i); - } - for (let i = 0; i < arr.length; i++) { - let obj = arr[i].array; - assert(obj.length === 3) - assert(obj[0] === '' + i); - assert(obj[1] === 'x') - assert(obj[2] === 'y') - } -}, 100); - -test(function() { - class A { - constructor() { - this._foo = null; - } - set foo(x) { - this._foo = x; - } - get foo() { return this._foo; } - } - function obj(i) { return {o: i}; } - noInline(obj); - - class B extends A { - baz(i) { - ;({o: super.foo} = obj(i)); - } - } - let arr = []; - for (let i = 0; i < 1000; i++) { - arr.push((new B)); - } - for (let i = 0; i < 1000; i++) { - arr[i].baz(i); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].foo === i); - } -}, 10); - -test(function() { - function foo() { return 'foo'; } - noInline(foo); - class A { - constructor() { - this._foo = null; - } - set foo(x) { - this._foo = x; - } - get foo() { return this._foo; } - } - function obj(i) { return {o: i}; } - noInline(obj); - - class B extends A { - baz(i) { - ;({o: super[foo()]} = obj(i)); - } - } - let arr = []; - for (let i = 0; i < 1000; i++) { - arr.push((new B)); - } - for (let i = 0; i < 1000; i++) { - arr[i].baz(i); - } - for (let i = 0; i < 1000; i++) { - assert(arr[i].foo === i); - } -}, 10); - -test(function() { - class A { - constructor() { - this._foo = null; - } - get call() { - let ret = () => 'call'; - noInline(ret); - return ret; - } - get apply() { - let ret = () => 'apply'; - noInline(ret); - return ret; - } - } - - class B extends A { - foo() { - return super.call({}, 20, 30); - } - bar() { - return super.apply({}, [10, 20]); - } - } - for (let i = 0; i < 1000; i++) { - let b = new B; - assert(b.foo() === 'call'); - assert(b.bar() === 'apply'); - } -}, 2); - -test(function() { - class A { - constructor(i) { this._i = i; } - get foo() { - return function(strings, ...values) { - return [strings, values]; - } - } - get i() { return this._i; } - } - - class B extends A { - baz() { - return super.foo`hello${super.i}world`; - } - } - - let arr = []; - for (let i = 0; i < 1000; i++) { - let b = new B(i); - arr.push(b); - } - for (let i = 0; i < 1000; i++) { - let r = arr[i].baz(); - assert(r.length === 2); - assert(r[0].length === 2); - assert(r[0][0] === 'hello'); - assert(r[0][1] === 'world'); - assert(r[1].length === 1); - assert(r[1][0] === i); - } -}, 10); diff --git a/implementation-contributed/javascriptcore/stress/switch-typeof-indirect.js b/implementation-contributed/javascriptcore/stress/switch-typeof-indirect.js deleted file mode 100644 index 392b94bfed..0000000000 --- a/implementation-contributed/javascriptcore/stress/switch-typeof-indirect.js +++ /dev/null @@ -1,41 +0,0 @@ -function bar(value) { - return typeof value; -} -noInline(bar); - -function foo(value) { - switch (bar(value)) { - case "undefined": - return 0; - case "object": - return 1; - case "function": - return 2; - case "boolean": - return 3; - case "number": - return 4; - case "string": - return 5; - default: - return 6; - } -} - -noInline(foo); - -function test(value, expected) { - var result = foo(value); - if (result != expected) - throw "Error: bad type code for " + value + ": " + result + " (expected " + expected + ")"; -} - -for (var i = 0; i < 10000; ++i) { - test(void 0, 0); - test({}, 1); - test(function() { return 42; }, 2); - test(true, 3); - test(42, 4); - test(42.5, 4); - test("hello", 5); -} diff --git a/implementation-contributed/javascriptcore/stress/switch-typeof-slightly-indirect.js b/implementation-contributed/javascriptcore/stress/switch-typeof-slightly-indirect.js deleted file mode 100644 index 291f2a7589..0000000000 --- a/implementation-contributed/javascriptcore/stress/switch-typeof-slightly-indirect.js +++ /dev/null @@ -1,39 +0,0 @@ -function foo(value) { - var t = typeof value; - if (!t) - return -1; - switch (t) { - case "undefined": - return 0; - case "object": - return 1; - case "function": - return 2; - case "boolean": - return 3; - case "number": - return 4; - case "string": - return 5; - default: - return 6; - } -} - -noInline(foo); - -function test(value, expected) { - var result = foo(value); - if (result != expected) - throw "Error: bad type code for " + value + ": " + result + " (expected " + expected + ")"; -} - -for (var i = 0; i < 10000; ++i) { - test(void 0, 0); - test({}, 1); - test(function() { return 42; }, 2); - test(true, 3); - test(42, 4); - test(42.5, 4); - test("hello", 5); -} diff --git a/implementation-contributed/javascriptcore/stress/switch-typeof.js b/implementation-contributed/javascriptcore/stress/switch-typeof.js deleted file mode 100644 index 90c374bd17..0000000000 --- a/implementation-contributed/javascriptcore/stress/switch-typeof.js +++ /dev/null @@ -1,36 +0,0 @@ -function foo(value) { - switch (typeof value) { - case "undefined": - return 0; - case "object": - return 1; - case "function": - return 2; - case "boolean": - return 3; - case "number": - return 4; - case "string": - return 5; - default: - return 6; - } -} - -noInline(foo); - -function test(value, expected) { - var result = foo(value); - if (result != expected) - throw "Error: bad type code for " + value + ": " + result + " (expected " + expected + ")"; -} - -for (var i = 0; i < 10000; ++i) { - test(void 0, 0); - test({}, 1); - test(function() { return 42; }, 2); - test(true, 3); - test(42, 4); - test(42.5, 4); - test("hello", 5); -} diff --git a/implementation-contributed/javascriptcore/stress/symbol-and-string-constructor.js b/implementation-contributed/javascriptcore/stress/symbol-and-string-constructor.js deleted file mode 100644 index 4a88e863ab..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-and-string-constructor.js +++ /dev/null @@ -1,10 +0,0 @@ -function performString(value) { - return String(value); -} -noInline(performString); - -for (var i = 0; i < 10000; ++i) { - var result = performString(Symbol.iterator); - if (result !== 'Symbol(Symbol.iterator)') - throw new Error('bad value: ' + result); -} diff --git a/implementation-contributed/javascriptcore/stress/symbol-array-from.js b/implementation-contributed/javascriptcore/stress/symbol-array-from.js deleted file mode 100644 index 8fed9072fc..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-array-from.js +++ /dev/null @@ -1,26 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var called = false; -Object.defineProperty(Symbol.prototype, Symbol.iterator, { - get() { - "use strict"; - shouldBe(typeof this, "symbol"); - called = true; - return null; - } -}); - -var symbol = Symbol("Cocoa"); -{ - called =false; - Array.from(symbol); - shouldBe(called, true); -} -{ - called =false; - Uint8Array.from(symbol); - shouldBe(called, true); -} diff --git a/implementation-contributed/javascriptcore/stress/symbol-define-property.js b/implementation-contributed/javascriptcore/stress/symbol-define-property.js deleted file mode 100644 index bac3ec05f8..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-define-property.js +++ /dev/null @@ -1,33 +0,0 @@ -// This tests Object.create, Object.defineProperty, Object.defineProperties work with Symbol. - -function testSymbol(object) { - if (!object.hasOwnProperty(Symbol.iterator)) - throw "Error: object doesn't have Symbol.iterator"; - if (object.propertyIsEnumerable(Symbol.iterator)) - throw "Error: Symbol.iterator is defined as enumerable"; - if (JSON.stringify(Object.getOwnPropertyDescriptor(object, Symbol.iterator)) !== '{"value":42,"writable":false,"enumerable":false,"configurable":false}') - throw "Error: bad property descriptor " + JSON.stringify(Object.getOwnPropertyDescriptor(object, Symbol.iterator)); - if (Object.getOwnPropertySymbols(object).length !== 1) - throw "Error: bad value " + Object.getOwnPropertySymbols(object).length; - if (Object.getOwnPropertySymbols(object)[0] !== Symbol.iterator) - throw "Error: bad value " + String(Object.getOwnPropertySymbols(object)[0]); -} - -var object = Object.create(Object.prototype, { - [Symbol.iterator]: { - value: 42 - } -}); -testSymbol(object); - -var object = Object.defineProperties({}, { - [Symbol.iterator]: { - value: 42 - } -}); -testSymbol(object); - -var object = Object.defineProperty({}, Symbol.iterator, { - value: 42 -}); -testSymbol(object); diff --git a/implementation-contributed/javascriptcore/stress/symbol-description.js b/implementation-contributed/javascriptcore/stress/symbol-description.js deleted file mode 100644 index 27e39797c1..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-description.js +++ /dev/null @@ -1,83 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -var s0 = Symbol("Cocoa"); -var s1 = Symbol("Cappuccino"); - -shouldBe(s0.description, "Cocoa"); -shouldBe(s0.toString(), "Symbol(Cocoa)"); -shouldBe(s1.description, "Cappuccino"); -shouldBe(s1.toString(), "Symbol(Cappuccino)"); - -var o0 = Object(s0); -var o1 = Object(s1); - -shouldBe(o0.description, "Cocoa"); -shouldBe(o0.toString(), "Symbol(Cocoa)"); -shouldBe(o1.description, "Cappuccino"); -shouldBe(o1.toString(), "Symbol(Cappuccino)"); - -var descriptor = Object.getOwnPropertyDescriptor(Symbol.prototype, "description"); -shouldBe(descriptor.enumerable, false); -shouldBe(descriptor.configurable, true); -shouldBe(descriptor.set, undefined); -shouldBe(typeof descriptor.get, "function"); - -shouldThrow(() => { - "use strict"; - s0.description = "Matcha"; -}, `TypeError: Attempted to assign to readonly property.`); -shouldThrow(() => { - "use strict"; - o0.description = "Matcha"; -}, `TypeError: Attempted to assign to readonly property.`); - -shouldThrow(() => { - descriptor.get.call({}); -}, `TypeError: Symbol.prototype.description requires that |this| be a symbol or a symbol object`); - -shouldThrow(() => { - descriptor.get.call(null); -}, `TypeError: Symbol.prototype.description requires that |this| be a symbol or a symbol object`); - -shouldThrow(() => { - descriptor.get.call(undefined); -}, `TypeError: Symbol.prototype.description requires that |this| be a symbol or a symbol object`); - -shouldThrow(() => { - descriptor.get.call(42); -}, `TypeError: Symbol.prototype.description requires that |this| be a symbol or a symbol object`); - -shouldThrow(() => { - descriptor.get.call("Hello"); -}, `TypeError: Symbol.prototype.description requires that |this| be a symbol or a symbol object`); - -shouldThrow(() => { - descriptor.get.call(42.195); -}, `TypeError: Symbol.prototype.description requires that |this| be a symbol or a symbol object`); - -shouldThrow(() => { - descriptor.get.call(false); -}, `TypeError: Symbol.prototype.description requires that |this| be a symbol or a symbol object`); - -shouldBe(descriptor.get.call(s0), "Cocoa"); -shouldBe(descriptor.get.call(o0), "Cocoa"); -o0.__proto__ = {}; -shouldBe(descriptor.get.call(o0), "Cocoa"); diff --git a/implementation-contributed/javascriptcore/stress/symbol-equality-over-gc.js b/implementation-contributed/javascriptcore/stress/symbol-equality-over-gc.js deleted file mode 100644 index 180e2fb576..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-equality-over-gc.js +++ /dev/null @@ -1,23 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - let symbol = Symbol(); - let object1 = { - [symbol]: 42 - } - let object2 = { - [symbol]: 42 - } - symbol = null; - fullGC(); - shouldBe(Object.getOwnPropertySymbols(object1)[0], Object.getOwnPropertySymbols(object2)[0]); -} -noInline(test); - -for (let i = 0; i < 1000; ++i) - test(); diff --git a/implementation-contributed/javascriptcore/stress/symbol-equality.js b/implementation-contributed/javascriptcore/stress/symbol-equality.js deleted file mode 100644 index eb64a89d4c..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-equality.js +++ /dev/null @@ -1,34 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function equal(a, b) { - return a == b; -} -noInline(equal); - -function strictEqual(a, b) { - return a === b; -} -noInline(strictEqual); - -var s1 = Symbol() -var s2 = Symbol(); - -var list = [ - [ [ s1, s1 ], true ], - [ [ s2, s1 ], false ], - [ [ s1, s2 ], false ], - [ [ s2, s2 ], true ], - [ [ s2, 42 ], false ], -]; - -list.forEach(function (set) { - var pair = set[0]; - var result = set[1]; - for (var i = 0; i < 10000; ++i) { - shouldBe(equal(pair[0], pair[1]), result); - shouldBe(strictEqual(pair[0], pair[1]), result); - } -}); diff --git a/implementation-contributed/javascriptcore/stress/symbol-error-messages.js b/implementation-contributed/javascriptcore/stress/symbol-error-messages.js deleted file mode 100644 index 8e3531e0a6..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-error-messages.js +++ /dev/null @@ -1,46 +0,0 @@ -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -var symbol = Symbol("Cocoa"); - -shouldThrow(() => { - // ToString => error. - "" + symbol; -}, `TypeError: Cannot convert a symbol to a string`); - -shouldThrow(() => { - // ToNumber => error. - +symbol; -}, `TypeError: Cannot convert a symbol to a number`); - -shouldThrow(() => { - Symbol.keyFor("Cappuccino"); -}, `TypeError: Symbol.keyFor requires that the first argument be a symbol`); - -shouldThrow(() => { - Symbol.prototype.toString.call(null); -}, `TypeError: Symbol.prototype.toString requires that |this| be a symbol or a symbol object`); - -shouldThrow(() => { - Symbol.prototype.toString.call({}); -}, `TypeError: Symbol.prototype.toString requires that |this| be a symbol or a symbol object`); - -shouldThrow(() => { - Symbol.prototype.valueOf.call(null); -}, `TypeError: Symbol.prototype.valueOf requires that |this| be a symbol or a symbol object`); - -shouldThrow(() => { - Symbol.prototype.valueOf.call({}); -}, `TypeError: Symbol.prototype.valueOf requires that |this| be a symbol or a symbol object`); diff --git a/implementation-contributed/javascriptcore/stress/symbol-get-own-property.js b/implementation-contributed/javascriptcore/stress/symbol-get-own-property.js deleted file mode 100644 index 33b14a5de3..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-get-own-property.js +++ /dev/null @@ -1,14 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var symbol = Symbol("Cocoa"); -shouldBe(symbol[0], undefined); - -// ToObject(symbol). -symbol[0] = "Hello"; -shouldBe(symbol[0], undefined); - -Symbol.prototype[30] = 42; -shouldBe(symbol[30], 42); diff --git a/implementation-contributed/javascriptcore/stress/symbol-hasInstance.js b/implementation-contributed/javascriptcore/stress/symbol-hasInstance.js deleted file mode 100644 index 8801eb8b4d..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-hasInstance.js +++ /dev/null @@ -1,54 +0,0 @@ -// This file tests the functionality of Symbol.hasInstance. - - -// Test a custom Symbol.hasInstance on a function object. -function Constructor(x) {} -foo = new Constructor(); - -if (!(foo instanceof Constructor)) - throw "should be instanceof"; - -Object.defineProperty(Constructor, Symbol.hasInstance, {value: function(value) { - if (this !== Constructor) - throw "|this| should be Constructor"; - if (value !== foo) - throw "first argument should be foo"; - return false; -} }); - - -if (foo instanceof Constructor) - throw "should not be instanceof"; - - -// Test Symbol.hasInstance on an ordinary object. -ObjectClass = {} -ObjectClass[Symbol.hasInstance] = function (value) { - return value !== null && (typeof value === "object" || typeof value === "function"); -} - -if (!(foo instanceof ObjectClass)) - throw "foo should be an instanceof ObjectClass"; - -if (!(Constructor instanceof ObjectClass)) - throw "Constructor should be an instanceof ObjectClass"; - -NumberClass = {} -NumberClass[Symbol.hasInstance] = function (value) { - return typeof value === "number"; -} - -if (!(1 instanceof NumberClass)) - throw "1 should be an instanceof NumberClass"; - -if (foo instanceof NumberClass) - throw "foo should be an instanceof NumberClass"; - - -// Test the Function.prototype[Symbol.hasInstance] works when actually called. -descriptor = Object.getOwnPropertyDescriptor(Function.prototype, Symbol.hasInstance); -if (descriptor.writable !== false || descriptor.configurable !== false || descriptor.enumerable !== false) - throw "Function.prototype[Symbol.hasInstance] has a bad descriptor"; - -if (!Function.prototype[Symbol.hasInstance].call(Constructor, foo)) - throw "Function.prototype[Symbol.hasInstance] should claim that foo is an instanceof Constructor"; diff --git a/implementation-contributed/javascriptcore/stress/symbol-instanceof.js b/implementation-contributed/javascriptcore/stress/symbol-instanceof.js deleted file mode 100644 index 7285da8b7d..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-instanceof.js +++ /dev/null @@ -1,13 +0,0 @@ -function foo(value, proto) -{ - return value instanceof proto; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(Symbol("hello"), Symbol); - if (result) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/symbol-registry.js b/implementation-contributed/javascriptcore/stress/symbol-registry.js deleted file mode 100644 index 5ea3663111..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-registry.js +++ /dev/null @@ -1,125 +0,0 @@ -function test(actual, expected) { - if (actual !== expected) - throw new Error("bad value: " + actual); -} - -(function () { - var hello = Symbol("Hello"); - var proto = Symbol("__proto__"); - - for (var sym of [ hello, proto, Symbol.iterator ]) { - var key = Symbol.keyFor(sym); - test(key, undefined); - // twice - var key = Symbol.keyFor(sym); - test(key, undefined); - } -}()); - -(function () { - var keys = [ - "Hello", - "__proto__", - "Symbol.iterator", - '', - null, - undefined, - 42, - 20.5, - -42, - -20.5, - true, - false, - {}, - function () {}, - [], - ]; - for (var key of keys) { - var sym = Symbol.for(key); - test(typeof sym, "symbol"); - test(sym.toString(), "Symbol(" + String(key) + ")"); - - var sym2 = Symbol.for(key); - test(sym === sym2, true); - - var key = Symbol.keyFor(sym); - test(key, key); - var key = Symbol.keyFor(sym2); - test(key, key); - } -}()); - -(function () { - var error = null; - try { - var key = { - toString() { - throw new Error('toString'); - } - }; - Symbol.for(key); - } catch (e) { - error = e; - } - if (!error) - throw new Error('not thrown'); - if (String(error) !== 'Error: toString') - throw new Error('bad error: ' + String(error)); -}()); - -(function () { - var elements = [ - null, - undefined, - 42, - 20.5, - true, - false, - 'string', - {}, - function () {}, - [], - ]; - for (var item of elements) { - var error = null; - try { - Symbol.keyFor(item); - } catch (e) { - error = e; - } - if (!error) - throw new Error('not thrown'); - if (String(error) !== 'TypeError: Symbol.keyFor requires that the first argument be a symbol') - throw new Error('bad error: ' + String(error)); - } -}()); - -(function () { - for (var i = 0; i < 10000; ++i) - Symbol.for(i); - gc(); -}()); - -(function () { - for (var i = 0; i < 100; ++i) { - var symbol = Symbol.for(i); - test(String(symbol), "Symbol(" + i + ")"); - test(symbol, Symbol.for(i)); - gc(); - } - gc(); -}()); - -(function () { - var symbols = []; - for (var i = 0; i < 100; ++i) { - var symbol = Symbol.for(i); - symbols.push(symbol); - } - - for (var i = 0; i < 100; ++i) - test(Symbol.for(i), symbols[i]); - - for (var i = 0; i < 100; ++i) - test(Symbol.keyFor(Symbol(i)), undefined); -}()); diff --git a/implementation-contributed/javascriptcore/stress/symbol-seal-and-freeze.js b/implementation-contributed/javascriptcore/stress/symbol-seal-and-freeze.js deleted file mode 100644 index 4f507cd9ee..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-seal-and-freeze.js +++ /dev/null @@ -1,26 +0,0 @@ -// This tests Object.seal and Object.freeze affect on Symbol properties. - -var object = { - [Symbol.iterator]: 42 -}; - -if (!object.hasOwnProperty(Symbol.iterator)) - throw "Error: object doesn't have Symbol.iterator"; -if (JSON.stringify(Object.getOwnPropertyDescriptor(object, Symbol.iterator)) !== '{"value":42,"writable":true,"enumerable":true,"configurable":true}') - throw "Error: bad property descriptor " + JSON.stringify(Object.getOwnPropertyDescriptor(object, Symbol.iterator)); -if (Object.getOwnPropertySymbols(object).length !== 1) - throw "Error: bad value " + Object.getOwnPropertySymbols(object).length; -if (Object.getOwnPropertySymbols(object)[0] !== Symbol.iterator) - throw "Error: bad value " + String(Object.getOwnPropertySymbols(object)[0]); - -Object.seal(object); -if (!object.hasOwnProperty(Symbol.iterator)) - throw "Error: object doesn't have Symbol.iterator"; -if (JSON.stringify(Object.getOwnPropertyDescriptor(object, Symbol.iterator)) !== '{"value":42,"writable":true,"enumerable":true,"configurable":false}') - throw "Error: bad property descriptor " + JSON.stringify(Object.getOwnPropertyDescriptor(object, Symbol.iterator)); - -Object.freeze(object); -if (!object.hasOwnProperty(Symbol.iterator)) - throw "Error: object doesn't have Symbol.iterator"; -if (JSON.stringify(Object.getOwnPropertyDescriptor(object, Symbol.iterator)) !== '{"value":42,"writable":false,"enumerable":true,"configurable":false}') - throw "Error: bad property descriptor " + JSON.stringify(Object.getOwnPropertyDescriptor(object, Symbol.iterator)); diff --git a/implementation-contributed/javascriptcore/stress/symbol-should-not-break-for-in.js b/implementation-contributed/javascriptcore/stress/symbol-should-not-break-for-in.js deleted file mode 100644 index 87fb16b0f6..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-should-not-break-for-in.js +++ /dev/null @@ -1,29 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("bad assertion."); -} - -function foo(o) { - let r = []; - for (let p in o) - r.push(o[p]); - return r; -} -noInline(foo); - -let o = {}; -o[Symbol()] = "symbol"; -o.prop = "prop"; -for (let i = 0; i < 1000; i++) { - let arr = foo(o); - assert(arr.length === 1); - assert(arr[0] === "prop"); -} - -o.prop2 = "prop2"; -for (let i = 0; i < 1000; i++) { - let arr = foo(o); - assert(arr.length === 2); - assert(arr[0] === "prop"); - assert(arr[1] === "prop2"); -} diff --git a/implementation-contributed/javascriptcore/stress/symbol-species.js b/implementation-contributed/javascriptcore/stress/symbol-species.js deleted file mode 100644 index 01f756c001..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-species.js +++ /dev/null @@ -1,15 +0,0 @@ -speciesConstructors = [RegExp, Array, Int32Array.__proto__, Map, Set, ArrayBuffer, Promise]; - -function testSymbolSpeciesOnConstructor(constructor) { - if (constructor[Symbol.species] !== constructor) - throw "Symbol.species should return the constructor for " + constructor.name; - constructor[Symbol.species] = true; - if (constructor[Symbol.species] !== constructor) - throw "Symbol.species was mutable " + constructor.name; - - // Symbol.species should be configurable. - Object.defineProperty(constructor, Symbol.species, { value: true }); -} - - -speciesConstructors.forEach(testSymbolSpeciesOnConstructor); diff --git a/implementation-contributed/javascriptcore/stress/symbol-toprimitive-errors.js b/implementation-contributed/javascriptcore/stress/symbol-toprimitive-errors.js deleted file mode 100644 index 56afea2d4a..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-toprimitive-errors.js +++ /dev/null @@ -1,46 +0,0 @@ -function shouldBe(func, expected) { - let result = func(); - if (result !== expected) - throw new Error("bad value"); -} - -function shouldThrow(func, errorType, message) { - let errorThrown = false; - let error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error("not thrown"); - if (!(error instanceof errorType)) - throw new Error("wrong error type thrown: " + error); - if (error.message !== message) - throw new Error("wrong message thrown: " + error.message); -} - -shouldBe(() => isNaN({}), true); -shouldBe(() => isNaN({[Symbol.toPrimitive]: undefined}), true); -shouldBe(() => isNaN({[Symbol.toPrimitive]: null}), true); -shouldBe(() => isNaN({[Symbol.toPrimitive]() { /* empty */ } }), true); -shouldBe(() => isNaN({[Symbol.toPrimitive]() { return NaN } }), true); -shouldBe(() => isNaN({[Symbol.toPrimitive]() { return 1 } }), false); - -shouldThrow(() => { isNaN({[Symbol.toPrimitive]: 1 }) }, TypeError, "Symbol.toPrimitive is not a function, undefined, or null"); -shouldThrow(() => { isNaN({[Symbol.toPrimitive]: NaN }) }, TypeError, "Symbol.toPrimitive is not a function, undefined, or null"); -shouldThrow(() => { isNaN({[Symbol.toPrimitive]: true }) }, TypeError, "Symbol.toPrimitive is not a function, undefined, or null"); -shouldThrow(() => { isNaN({[Symbol.toPrimitive]: "string" }) }, TypeError, "Symbol.toPrimitive is not a function, undefined, or null"); -shouldThrow(() => { isNaN({[Symbol.toPrimitive]: Symbol() }) }, TypeError, "Symbol.toPrimitive is not a function, undefined, or null"); -shouldThrow(() => { isNaN({[Symbol.toPrimitive]: {} }) }, TypeError, "Symbol.toPrimitive is not a function, undefined, or null"); -shouldThrow(() => { isNaN({[Symbol.toPrimitive]: [] }) }, TypeError, "Symbol.toPrimitive is not a function, undefined, or null"); -shouldThrow(() => { isNaN({[Symbol.toPrimitive]: /regex/ }) }, TypeError, "Symbol.toPrimitive is not a function, undefined, or null"); - -shouldThrow(() => { isNaN({[Symbol.toPrimitive]() { return this } }) }, TypeError, "Symbol.toPrimitive returned an object"); -shouldThrow(() => { isNaN({[Symbol.toPrimitive]() { return {} } }) }, TypeError, "Symbol.toPrimitive returned an object"); -shouldThrow(() => { isNaN({[Symbol.toPrimitive]() { return [] } }) }, TypeError, "Symbol.toPrimitive returned an object"); -shouldThrow(() => { isNaN({[Symbol.toPrimitive]() { return /regex/ } }) }, TypeError, "Symbol.toPrimitive returned an object"); -shouldThrow(() => { isNaN({[Symbol.toPrimitive]() { return function(){} } }) }, TypeError, "Symbol.toPrimitive returned an object"); -shouldThrow(() => { isNaN({[Symbol.toPrimitive]() { return Symbol() } }) }, TypeError, "Cannot convert a symbol to a number"); -shouldThrow(() => { isNaN({[Symbol.toPrimitive]() { throw new Error("Inner Error") } }) }, Error, "Inner Error"); diff --git a/implementation-contributed/javascriptcore/stress/symbol-toprimitive.js b/implementation-contributed/javascriptcore/stress/symbol-toprimitive.js deleted file mode 100644 index fac7636459..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-toprimitive.js +++ /dev/null @@ -1,18 +0,0 @@ -// return object -let foo = { } -foo[Symbol.toPrimitive] = function() { return {} }; - -for (i = 0; i < 100000; i++) { - let failed = true; - try { - foo >= 1; - } catch (e) { - if (e instanceof TypeError) - failed = false; - } - - if (failed) - throw "should have thrown on return of object"; -} - -// The general use of Symbol.toPrimitive is covered in the ES6 tests. diff --git a/implementation-contributed/javascriptcore/stress/symbol-tostringtag-watchpoints.js b/implementation-contributed/javascriptcore/stress/symbol-tostringtag-watchpoints.js deleted file mode 100644 index 8aac693c2e..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-tostringtag-watchpoints.js +++ /dev/null @@ -1,62 +0,0 @@ -// Test changing the value of toStringTag - -// Test adding toStringTag to the base with miss. - -// SuperPrototype can't be an empty object since its transition -// watchpoint will be clobbered when assigning it to the prototype. -var SuperPrototype = { bar: 1 } -var BasePrototype = { } -Object.setPrototypeOf(BasePrototype, SuperPrototype); - -function Base() { } -Base.prototype = BasePrototype; - -var value = new Base(); - -if (value.toString() !== "[object Object]") - throw "bad miss toStringTag"; - -value[Symbol.toStringTag] = "hello"; - -if (value.toString() !== "[object hello]") - throw "bad swap on base value with miss"; - -// Test adding toStringTag to the prototype with miss. - -value = new Base(); - -if (value.toString() !== "[object Object]") - throw "bad miss toStringTag"; - -SuperPrototype[Symbol.toStringTag] = "superprototype"; - -if (value.toString() !== "[object superprototype]") - throw "bad prototype toStringTag change with miss"; - -// Test adding toStringTag to the base with a hit. - -value[Symbol.toStringTag] = "hello2"; - -if (value.toString() !== "[object hello2]") - throw "bad swap on base value with hit"; - -// Test toStringTag on the prototype. - -if (Object.getPrototypeOf(value).toString() !== "[object superprototype]") - throw "bad prototype toStringTag access"; - -// Test adding to string to the prototype with hit. - -value = new Base(); - -BasePrototype[Symbol.toStringTag] = "baseprototype"; - -if (value.toString() !== "[object baseprototype]") - throw "bad prototype toStringTag interception with hit"; - -// Test replacing the string on prototype. - -BasePrototype[Symbol.toStringTag] = "not-baseprototype!"; - -if (value.toString() !== "[object not-baseprototype!]") - throw "bad prototype toStringTag interception with hit"; diff --git a/implementation-contributed/javascriptcore/stress/symbol-tostringtag.js b/implementation-contributed/javascriptcore/stress/symbol-tostringtag.js deleted file mode 100644 index 642109cf18..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-tostringtag.js +++ /dev/null @@ -1,48 +0,0 @@ -// This file tests the names of all the classes with builtin Symbol.toStringTags and Object.prototype.toString(). - -foo = { }; -foo[Symbol.toStringTag] = "test the tag"; - -if (foo != "[object test the tag]") - throw "failed on custom toStringTag"; - -function toStr(obj) { - return Object.prototype.toString.call(obj); -} - -function strName(str) { return "[object " + str + "]"; } - -if (toStr(Symbol()) !== strName("Symbol")) - throw "failed on Symbol"; - -if (toStr(Symbol.prototype) !== strName("Symbol")) - throw "failed on Symbol.prototype"; - -objects = ["JSON", "Math"]; - -for (name of objects) { - value = eval(name) - if (toStr(value) !== strName(name)) - throw "failed on " + name; -} - -iterators = ['Array', 'Map', 'Set', 'String']; - -for (name of iterators) { - value = eval('new ' + name + '()[Symbol.iterator]()'); - if (toStr(value) !== strName(name + ' Iterator')) - throw 'failed on Iterator of ' + name; - if (toStr(Object.getPrototypeOf(value)) !== strName(name + ' Iterator')) - throw 'failed on Iterator.prototype of ' + name; -} - -classes = { "ArrayBuffer": 10, "DataView": new ArrayBuffer(10), "Promise": function() { return 1 }, "Set": undefined, "WeakMap": undefined, "WeakSet": undefined }; - -for (name in classes) { - value = eval(name); - if (toStr(new value(classes[name])) !== strName(name)) - throw "failed on new object of " + name; - if (toStr(value.prototype) !== strName(name)) - throw "failed on prototype of " + name; -} - diff --git a/implementation-contributed/javascriptcore/stress/symbol-with-json.js b/implementation-contributed/javascriptcore/stress/symbol-with-json.js deleted file mode 100644 index d9127b305b..0000000000 --- a/implementation-contributed/javascriptcore/stress/symbol-with-json.js +++ /dev/null @@ -1,29 +0,0 @@ -// This tests JSON correctly behaves with Symbol. - -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -shouldBe(JSON.stringify(Symbol('Cocoa')), undefined); - -var object = {}; -var symbol = Symbol("Cocoa"); -object[symbol] = 42; -object['Cappuccino'] = 42; -shouldBe(JSON.stringify(object), '{"Cappuccino":42}'); - -shouldBe(JSON.stringify(object, [ Symbol('Cocoa') ]), "{}"); - -// The property that value is Symbol will be ignored. -shouldBe(JSON.stringify({ cocoa: Symbol('Cocoa'), cappuccino: Symbol('Cappuccino') }), '{}'); -shouldBe(JSON.stringify({ cocoa: Symbol('Cocoa'), cappuccino: 'cappuccino', [Symbol('Matcha')]: 'matcha' }), '{"cappuccino":"cappuccino"}'); -var object = {foo: Symbol()}; -object[Symbol()] = 1; -shouldBe(JSON.stringify(object), '{}'); - -// The symbol value included in Array will be converted to null -shouldBe(JSON.stringify([ Symbol('Cocoa') ]), '[null]'); -shouldBe(JSON.stringify([ "hello", Symbol('Cocoa'), 'world' ]), '["hello",null,"world"]'); -var array = [Symbol()]; -shouldBe(JSON.stringify(array), '[null]'); diff --git a/implementation-contributed/javascriptcore/stress/tagged-template-object-collect.js b/implementation-contributed/javascriptcore/stress/tagged-template-object-collect.js deleted file mode 100644 index e1cd910819..0000000000 --- a/implementation-contributed/javascriptcore/stress/tagged-template-object-collect.js +++ /dev/null @@ -1,16 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - - -function tag(site) -{ - return site; -} - -{ - for (var i = 0; i < 1e4; ++i) - eval(`(function () { return tag\`${i}\`; })()`); -} -gc(); diff --git a/implementation-contributed/javascriptcore/stress/tagged-template-object.js b/implementation-contributed/javascriptcore/stress/tagged-template-object.js deleted file mode 100644 index f2c51142b1..0000000000 --- a/implementation-contributed/javascriptcore/stress/tagged-template-object.js +++ /dev/null @@ -1,25 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function tag(site) -{ - return site; -} - -{ - function a() { - return tag`Hello`; - } - - function b() { - return tag`Hello`; - } - - shouldBe(a() === b(), false); - gc(); - var tagA = a(); - gc(); - shouldBe(tagA === b(), false); -} diff --git a/implementation-contributed/javascriptcore/stress/tagged-template-tdz.js b/implementation-contributed/javascriptcore/stress/tagged-template-tdz.js deleted file mode 100644 index 22466c12c9..0000000000 --- a/implementation-contributed/javascriptcore/stress/tagged-template-tdz.js +++ /dev/null @@ -1,51 +0,0 @@ -function shouldThrowTDZ(func) { - let hasThrown = false; - try { - func(); - } catch(e) { - if (e.name.indexOf("ReferenceError") !== -1) - hasThrown = true; - } - if (!hasThrown) - throw new Error("Did not throw TDZ error"); -} -noInline(shouldThrowTDZ); - -function test(f) { - for (let i = 0; i < 1000; i++) - f(); -} - -test(function() { - shouldThrowTDZ(function() { - (a)``; - let a; - }); -}); - -test(function() { - shouldThrowTDZ(function() { - (a)``; - let a; - function capture() { return a; } - }); -}); - -test(function() { - shouldThrowTDZ(()=> { (a)``; }); - let a; -}); - -test(function() { - shouldThrowTDZ(()=> { eval("(a)``"); }); - let a; -}); - - -test(function() { - shouldThrowTDZ(()=> { (globalLet)``; }); -}); -test(function() { - shouldThrowTDZ(()=> { eval("(globalLet)``;")}); -}); -let globalLet; diff --git a/implementation-contributed/javascriptcore/stress/tagged-templates-identity.js b/implementation-contributed/javascriptcore/stress/tagged-templates-identity.js deleted file mode 100644 index 2ab5c7bec0..0000000000 --- a/implementation-contributed/javascriptcore/stress/tagged-templates-identity.js +++ /dev/null @@ -1,141 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + JSON.stringify(actual)); -} - -var templates = []; -function tag(siteObject) { - templates.push(siteObject); -} - -tag`Hello`; -tag`World`; -tag`Hello`; -shouldBe(templates.length, 3); -shouldBe(templates[0] !== templates[1], true); -shouldBe(templates[0] !== templates[2], true); - -templates = []; -tag`Hello\n`; -tag`Hello\r`; -tag`Hello\u2028`; -shouldBe(templates.length, 3); -shouldBe(templates[0] !== templates[1], true); -shouldBe(templates[0] !== templates[2], true); - -templates = []; -eval("tag`Hello\n`"); -eval("tag`Hello\r`"); -eval("tag`Hello\u2028`"); -shouldBe(templates.length, 3); -shouldBe(templates[0] !== templates[1], true); -shouldBe(templates[0] !== templates[2], true); - -templates = []; -eval("tag`Hello\n`"); -eval("tag`Hello\\n`"); -eval("tag`Hello\r`"); -eval("tag`Hello\\r`"); -shouldBe(templates.length, 4); -shouldBe(templates[0] !== templates[1], true); -shouldBe(templates[0] !== templates[2], true); -shouldBe(templates[0] !== templates[3], true); -shouldBe(templates[1] !== templates[2], true); -shouldBe(templates[1] !== templates[3], true); -shouldBe(templates[2] !== templates[3], true); - -var v = 0; -templates = []; -eval("tag`Hello\n${v}world`"); -eval("tag`Hello\n${v}world`"); -shouldBe(templates.length, 2); -shouldBe(templates[0] !== templates[1], true); - -var v = 0; -templates = []; -eval("tag`Hello${v}\nworld`"); -eval("tag`Hello\n${v}world`"); -shouldBe(templates.length, 2); -shouldBe(templates[0] !== templates[1], true); - -var v = 0; -templates = []; -for (v = 0; v < 3; ++v) { - tag`Hello${v}world`; - if (!v) continue; - shouldBe(templates[v] === templates[v - 1], true); -} - -templates = []; -tag`Hello${1}world`; -tag`Hello${2}world`; -shouldBe(templates[0] !== templates[1], true); - -// Disable eval caching if a tagged template occurs in eval code -var v = 0; -templates = []; -for (v = 0; v < 3; ++v) { - eval("tag`Hello${v}world`"); - if (!v) continue; - shouldBe(templates[v] !== templates[v - 1], true); -} - -templates = []; -eval("tag`Hello${1}world`"); -eval("tag`Hello${2}world`"); -eval("tag`Hello${3}world`"); -shouldBe(templates[0] !== templates[1], true); -shouldBe(templates[1] !== templates[2], true); - - -// Disable eval caching if a tagged template occurs in a nested function -var v = 0; -templates = []; -for (v = 0; v < 6; v += 2) { - eval("(function() { for (var i = 0; i < 2; ++i) tag`Hello${v}world` })()"); - shouldBe(templates[v] === templates[v + 1], true); -} - -shouldBe(templates[0] !== templates[2], true); -shouldBe(templates[0] !== templates[4], true); -shouldBe(templates[1] !== templates[3], true); -shouldBe(templates[1] !== templates[5], true); -shouldBe(templates[2] !== templates[4], true); -shouldBe(templates[3] !== templates[5], true); - -templates = []; -eval("(function() { for (var i = 0; i < 2; ++i) tag`Hello${1}world` })()"); -eval("(function() { for (var i = 0; i < 2; ++i) tag`Hello${2}world` })()"); -eval("(function() { for (var i = 0; i < 2; ++i) tag`Hello${2}world` })()"); -shouldBe(templates[0] === templates[1], true); -shouldBe(templates[0] !== templates[2], true); -shouldBe(templates[0] !== templates[4], true); -shouldBe(templates[1] !== templates[3], true); -shouldBe(templates[1] !== templates[5], true); -shouldBe(templates[2] === templates[3], true); -shouldBe(templates[2] !== templates[4], true); -shouldBe(templates[3] !== templates[5], true); -shouldBe(templates[4] === templates[5], true); - -// Disable eval caching if a tagged template occurs in an even deeper nested function -var v = 0; -templates = []; -for (v = 0; v < 3; ++v) { - eval("(function() { (function() { tag`Hello${v}world` })() })()"); - if (!v) continue; - shouldBe(templates[v] !== templates[v - 1], true); -} - -templates = []; -eval("(function() { (function() { for (var i = 0; i < 2; ++i) tag`Hello${1}world` })() })()"); -eval("(function() { (function() { for (var i = 0; i < 2; ++i) tag`Hello${2}world` })() })()"); -eval("(function() { (function() { for (var i = 0; i < 2; ++i) tag`Hello${2}world` })() })()"); -shouldBe(templates[0] === templates[1], true); -shouldBe(templates[0] !== templates[2], true); -shouldBe(templates[0] !== templates[4], true); -shouldBe(templates[1] !== templates[3], true); -shouldBe(templates[1] !== templates[5], true); -shouldBe(templates[2] === templates[3], true); -shouldBe(templates[2] !== templates[4], true); -shouldBe(templates[3] !== templates[5], true); -shouldBe(templates[4] === templates[5], true); diff --git a/implementation-contributed/javascriptcore/stress/tagged-templates-raw-strings.js b/implementation-contributed/javascriptcore/stress/tagged-templates-raw-strings.js deleted file mode 100644 index 5970b72398..0000000000 --- a/implementation-contributed/javascriptcore/stress/tagged-templates-raw-strings.js +++ /dev/null @@ -1,63 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + JSON.stringify(actual)); -} - -function tag(results) { - return function (siteObject) { - shouldBe(siteObject.raw.length, results.length); - for (var i = 0; i < siteObject.raw.length; ++i) { - shouldBe(siteObject.raw[i], results[i]); - } - }; -} - -tag([''])``; -tag(['hello'])`hello`; -tag(['hello', 'world'])`hello${0}world`; -tag(['hello\\u2028', 'world'])`hello\u2028${0}world`; -tag(['hello\\u2028\\u2029', 'world'])`hello\u2028\u2029${0}world`; -tag(['hello\\n\\r', 'world'])`hello\n\r${0}world`; - -function testEval(content, results) { - var split = 0; - var g = tag(results); - eval("g`" + content + "`"); -} - -for (var ch of [ '\'', '"', '\\', 'b', 'f', 'n', 'r', 't', 'v' ]) - testEval("\\" + ch, ["\\" + ch]); - -var evaluated = []; -for (var i = 0; i < 0x10000; ++i) { - var code = i.toString(16); - var input = "\\u" + '0'.repeat(4 - code.length) + code; - evaluated.push(input); -} -testEval(evaluated.join('${split}'), evaluated) - -testEval("Hello\rWorld", [ "Hello\nWorld" ]); -testEval("Hello\nWorld", [ "Hello\nWorld" ]); - -testEval("Hello\r\rWorld", [ "Hello\n\nWorld" ]); -testEval("Hello\r\nWorld", [ "Hello\nWorld" ]); -testEval("Hello\n\nWorld", [ "Hello\n\nWorld" ]); -testEval("Hello\n\rWorld", [ "Hello\n\nWorld" ]); - -testEval("Hello\n\r\nWorld", [ "Hello\n\nWorld" ]); -testEval("Hello\r\n\rWorld", [ "Hello\n\nWorld" ]); -testEval("Hello\n\n\nWorld", [ "Hello\n\n\nWorld" ]); - -testEval("Hello\n\r\n\rWorld", [ "Hello\n\n\nWorld" ]); -testEval("Hello\n\r\n\nWorld", [ "Hello\n\n\nWorld" ]); -testEval("Hello\r\n\n\nWorld", [ "Hello\n\n\nWorld" ]); - -testEval("Hello\\\n\r\rWorld", [ "Hello\\\n\n\nWorld" ]); -testEval("Hello\\\r\n\n\nWorld", [ "Hello\\\n\n\nWorld" ]); -testEval("Hello\\\n\r\n\nWorld", [ "Hello\\\n\n\nWorld" ]); -testEval("Hello\\\n\r\r\nWorld", [ "Hello\\\n\n\nWorld" ]); - -testEval("\u2028", [ "\u2028" ]); -testEval("\u2029", [ "\u2029" ]); -testEval("\\u2028", [ "\\u2028" ]); -testEval("\\u2029", [ "\\u2029" ]); diff --git a/implementation-contributed/javascriptcore/stress/tagged-templates-syntax.js b/implementation-contributed/javascriptcore/stress/tagged-templates-syntax.js deleted file mode 100644 index 9d1eda1012..0000000000 --- a/implementation-contributed/javascriptcore/stress/tagged-templates-syntax.js +++ /dev/null @@ -1,70 +0,0 @@ -function tag() { -} - -function testSyntax(script) { - try { - eval(script); - } catch (error) { - if (error instanceof SyntaxError) - throw new Error("Bad error: " + String(error)); - } -} - -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -testSyntax("tag``"); -testSyntax("tag`Hello`"); -testSyntax("tag`Hello${tag}`"); -testSyntax("tag`${tag}`"); -testSyntax("tag`${tag} ${tag}`"); -testSyntax("tag`${tag}${tag}`"); - -testSyntax("tag.prop``"); -testSyntax("tag.prop`Hello`"); -testSyntax("tag.prop`Hello${tag}`"); -testSyntax("tag.prop`${tag}`"); -testSyntax("tag.prop`${tag} ${tag}`"); -testSyntax("tag.prop`${tag}${tag}`"); - -testSyntax("tag[prop]``"); -testSyntax("tag[prop]`Hello`"); -testSyntax("tag[prop]`Hello${tag}`"); -testSyntax("tag[prop]`${tag}`"); -testSyntax("tag[prop]`${tag} ${tag}`"); -testSyntax("tag[prop]`${tag}${tag}`"); - -testSyntax("(tag())``"); -testSyntax("(tag())`Hello`"); -testSyntax("(tag())`Hello${tag}`"); -testSyntax("(tag())`${tag}`"); -testSyntax("(tag())`${tag} ${tag}`"); -testSyntax("(tag())`${tag}${tag}`"); - -testSyntax("(class { say() { super.tag`` } })"); -testSyntax("(class { say() { super.tag`Hello` } })"); -testSyntax("(class { say() { super.tag`Hello${tag}` } })"); -testSyntax("(class { say() { super.tag`${tag}` } })"); -testSyntax("(class { say() { super.tag`${tag} ${tag}` } })"); -testSyntax("(class { say() { super.tag`${tag}${tag}` } })"); - -testSyntax("(class extends Hello { constructor() { super()`` } })"); -testSyntax("(class extends Hello { constructor() { super()`Hello` } })"); -testSyntax("(class extends Hello { constructor() { super()`Hello${tag}` } })"); -testSyntax("(class extends Hello { constructor() { super()`${tag}` } })"); -testSyntax("(class extends Hello { constructor() { super()`${tag} ${tag}` } })"); -testSyntax("(class extends Hello { constructor() { super()`${tag}${tag}` } })"); - -testSyntaxError("super`Hello${tag}`", "SyntaxError: super is not valid in this context."); -testSyntaxError("(class { say() { super`Hello${tag}` } })", "SyntaxError: Cannot use super as tag for tagged templates."); diff --git a/implementation-contributed/javascriptcore/stress/tagged-templates-template-object.js b/implementation-contributed/javascriptcore/stress/tagged-templates-template-object.js deleted file mode 100644 index b805de9a46..0000000000 --- a/implementation-contributed/javascriptcore/stress/tagged-templates-template-object.js +++ /dev/null @@ -1,43 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function tag(elements) { - return function (siteObject) { - shouldBe(siteObject instanceof Array, true); - shouldBe(Object.isFrozen(siteObject), true); - shouldBe(siteObject.raw instanceof Array, true); - shouldBe(Object.isFrozen(siteObject.raw), true); - shouldBe(siteObject.hasOwnProperty("raw"), true); - shouldBe(siteObject.propertyIsEnumerable("raw"), false); - shouldBe(siteObject.length, arguments.length); - shouldBe(siteObject.raw.length, arguments.length); - var count = siteObject.length; - for (var i = 0; i < count; ++i) { - shouldBe(siteObject.hasOwnProperty(i), true); - var desc = Object.getOwnPropertyDescriptor(siteObject, i); - shouldBe(desc.writable, false); - shouldBe(desc.enumerable, true); - shouldBe(desc.configurable, false); - } - shouldBe(siteObject.length, elements.length + 1); - for (var i = 0; i < elements.length; ++i) - shouldBe(arguments[i + 1], elements[i]); - }; -} - -var value = { - toString() { - throw new Error('incorrect'); - }, - valueOf() { - throw new Error('incorrect'); - } -}; - -tag([])``; -tag([])`Hello`; -tag([])`Hello World`; -tag([value])`Hello ${value} World`; -tag([value, value])`Hello ${value} OK, ${value}`; diff --git a/implementation-contributed/javascriptcore/stress/tagged-templates-this.js b/implementation-contributed/javascriptcore/stress/tagged-templates-this.js deleted file mode 100644 index 24a59920cf..0000000000 --- a/implementation-contributed/javascriptcore/stress/tagged-templates-this.js +++ /dev/null @@ -1,26 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function tag() { - "use strict"; - return this; -} - -var object = { - tag() { - 'use strict'; - return this; - } -}; - -shouldBe(tag`Hello`, undefined); -shouldBe((function () { return tag }())`Hello`, undefined); -shouldBe(object.tag`Hello`, object); -shouldBe(object['tag']`Hello`, object); -shouldBe(object[(function () { return 'tag'; }())]`Hello`, object); - -with (object) { - shouldBe(tag`Hello`, object); -} diff --git a/implementation-contributed/javascriptcore/stress/tagged-templates.js b/implementation-contributed/javascriptcore/stress/tagged-templates.js deleted file mode 100644 index eb714bf33d..0000000000 --- a/implementation-contributed/javascriptcore/stress/tagged-templates.js +++ /dev/null @@ -1,67 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + JSON.stringify(actual)); -} - -function raw(siteObject) { - var result = ''; - for (var i = 0; i < siteObject.raw.length; ++i) { - result += siteObject.raw[i]; - if ((i + 1) < arguments.length) { - result += arguments[i + 1]; - } - } - return result; -} - -function cooked(siteObject) { - var result = ''; - for (var i = 0; i < siteObject.raw.length; ++i) { - result += siteObject[i]; - if ((i + 1) < arguments.length) { - result += arguments[i + 1]; - } - } - return result; -} - -function Counter() { - var count = 0; - return { - toString() { - return count++; - } - }; -} - -var c = Counter(); -shouldBe(raw`Hello ${c} World ${c}`, `Hello 0 World 1`); -var c = Counter(); -shouldBe(raw`${c}${c}${c}`, `012`); -var c = Counter(); -shouldBe(raw`${c}${ ` ${c} ` }${c}`, `1 0 2`); -var c = Counter(); -shouldBe(raw`${c}${ raw` ${c} ` }${c}`, `1 0 2`); -var c = Counter(); -shouldBe(raw`${c}${ ` ${c}${c} ` }${c}`, `2 01 3`); -var c = Counter(); -shouldBe(raw`${c}${ raw` ${c}${c} ` }${c}`, `2 01 3`); - -shouldBe(raw``, ``); -shouldBe(cooked``, ``); -shouldBe(raw`\n`, `\\n`); -shouldBe(cooked`\n`, `\n`); -shouldBe(raw`\v`, `\\v`); -shouldBe(cooked`\v`, `\v`); -shouldBe(raw` - -`, `\n\n`); -shouldBe(cooked` - -`, `\n\n`); -shouldBe(raw`\ -\ -`, `\\\n\\\n`); -shouldBe(cooked`\ -\ -`, ``); diff --git a/implementation-contributed/javascriptcore/stress/tail-call-host-call-throw.js b/implementation-contributed/javascriptcore/stress/tail-call-host-call-throw.js deleted file mode 100644 index 3e87329c98..0000000000 --- a/implementation-contributed/javascriptcore/stress/tail-call-host-call-throw.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; - -function foo(func, arg) { - return func(arg); -} - -noInline(foo); - -function a() { return 1; } -function b() { return 2; } -function c() { return 3; } -function d() { return 4; } -function e() { return 5; } -function f() { return 6; } -function g() { return 7; } -function h() { return 8; } -function i() { return 9; } -function j() { return 0; } -function k() { return 1; } -function l() { return 2; } -function m() { return 3; } - -var funcs = [a, b, c, d, e, f, g, h, i, l, m, Array]; - -for (var i = 0; i < 100000; ++i) - foo(funcs[i % funcs.length], 1); - -var result = null; -try { - result = foo(Array, -1); -} catch (e) { - if (e.toString() != "RangeError: Array size is not a small enough positive integer.") - throw "Error: bad exception at end: " + e; -} -if (result != null) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/tail-call-in-inline-cache.js b/implementation-contributed/javascriptcore/stress/tail-call-in-inline-cache.js deleted file mode 100644 index d8d64f1543..0000000000 --- a/implementation-contributed/javascriptcore/stress/tail-call-in-inline-cache.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -function tail() { } - -var obj = { - get x() { return tail(0); } -}; - -for (var i = 0; i < 10; ++i) - obj.x; diff --git a/implementation-contributed/javascriptcore/stress/tail-call-no-stack-overflow.js b/implementation-contributed/javascriptcore/stress/tail-call-no-stack-overflow.js deleted file mode 100644 index b8127372c9..0000000000 --- a/implementation-contributed/javascriptcore/stress/tail-call-no-stack-overflow.js +++ /dev/null @@ -1,45 +0,0 @@ -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -function sloppyLoop(n) { - if (n > 0) - return sloppyLoop(n - 1); -} - -function strictLoop(n) { - "use strict"; - if (n > 0) - return strictLoop(n - 1); -} - -// We have two of these so that we can test different stack alignments -function strictLoopArityFixup1(n, dummy) { - "use strict"; - if (n > 0) - return strictLoopArityFixup1(n - 1); -} - -function strictLoopArityFixup2(n, dummy1, dummy2) { - "use strict"; - if (n > 0) - return strictLoopArityFixup2(n - 1); -} - -shouldThrow(function () { sloppyLoop(100000); }, 'RangeError: Maximum call stack size exceeded.'); - -// These should not throw -strictLoop(100000); -strictLoopArityFixup1(1000000); -strictLoopArityFixup2(1000000); diff --git a/implementation-contributed/javascriptcore/stress/tail-call-profiler.js b/implementation-contributed/javascriptcore/stress/tail-call-profiler.js deleted file mode 100644 index 5733707a5a..0000000000 --- a/implementation-contributed/javascriptcore/stress/tail-call-profiler.js +++ /dev/null @@ -1,29 +0,0 @@ -//@ runProfiler -// This tests the profiler DFG node, CountExecution, plays nicely with TailCalls. - -"use strict"; - -function tail(a) { return 1; } -noInline(tail); - -function inlineTail(a) { - return tail(a); -} - -function inlineTailVarArgs(a) { - return tail(...[a]) -} - -function inlineTailTernary(a) { - return true ? tail(a) : null; -} - -function body() { - for (var i = 0; i < 10000; i++) { - inlineTail(1); - inlineTailVarArgs(1); - inlineTailTernary(1) - } -} - -body(); diff --git a/implementation-contributed/javascriptcore/stress/tail-call-recognize.js b/implementation-contributed/javascriptcore/stress/tail-call-recognize.js deleted file mode 100644 index 1681e40201..0000000000 --- a/implementation-contributed/javascriptcore/stress/tail-call-recognize.js +++ /dev/null @@ -1,183 +0,0 @@ -function callerMustBeRun() { - if (!Object.is(callerMustBeRun.caller, runTests)) - throw new Error("Wrong caller, expected run but got ", callerMustBeRun.caller); -} - -function callerMustBeStrict() { - var errorThrown = false; - try { - callerMustBeStrict.caller; - } catch (e) { - errorThrown = true; - } - if (!errorThrown) - throw Error("Wrong caller, expected strict caller but got ", callerMustBeStrict.caller); -} - -function runTests() { - // Statement tests - (function simpleTailCall() { - "use strict"; - return callerMustBeRun(); - })(); - - (function noTailCallInTry() { - "use strict"; - try { - return callerMustBeStrict(); - } catch (e) { - throw e; - } - })(); - - (function tailCallInCatch() { - "use strict"; - try { } catch (e) { return callerMustBeRun(); } - })(); - - (function tailCallInFinally() { - "use strict"; - try { } finally { return callerMustBeRun(); } - })(); - - (function tailCallInFinallyWithCatch() { - "use strict"; - try { } catch (e) { } finally { return callerMustBeRun(); } - })(); - - (function tailCallInFinallyWithCatchTaken() { - "use strict"; - try { throw null; } catch (e) { } finally { return callerMustBeRun(); } - })(); - - (function noTailCallInCatchIfFinally() { - "use strict"; - try { throw null; } catch (e) { return callerMustBeStrict(); } finally { } - })(); - - (function tailCallInFor() { - "use strict"; - for (var i = 0; i < 10; ++i) - return callerMustBeRun(); - })(); - - (function tailCallInWhile() { - "use strict"; - while (true) - return callerMustBeRun(); - })(); - - (function tailCallInDoWhile() { - "use strict"; - do - return callerMustBeRun(); - while (true); - })(); - - (function noTailCallInForIn() { - "use strict"; - for (var x in [1, 2]) - return callerMustBeStrict(); - })(); - - (function noTailCallInForOf() { - "use strict"; - for (var x of [1, 2]) - return callerMustBeStrict(); - })(); - - (function tailCallInIf() { - "use strict"; - if (true) - return callerMustBeRun(); - })(); - - (function tailCallInElse() { - "use strict"; - if (false) throw new Error("WTF"); - else return callerMustBeRun(); - })(); - - (function tailCallInSwitchCase() { - "use strict"; - switch (0) { - case 0: return callerMustBeRun(); - } - })(); - - (function tailCallInSwitchDefault() { - "use strict"; - switch (0) { - default: return callerMustBeRun(); - } - })(); - - (function tailCallWithLabel() { - "use strict"; - dummy: return callerMustBeRun(); - })(); - - (function tailCallInTaggedTemplateString() { - "use strict"; - return callerMustBeRun`test`; - })(); - - // Expression tests, we don't enumerate all the cases where there - // *shouldn't* be a tail call - - (function tailCallComma() { - "use strict"; - return callerMustBeStrict(), callerMustBeRun(); - })(); - - (function tailCallTernaryLeft() { - "use strict"; - return true ? callerMustBeRun() : unreachable(); - })(); - - (function tailCallTernaryRight() { - "use strict"; - return false ? unreachable() : callerMustBeRun(); - })(); - - (function tailCallLogicalAnd() { - "use strict"; - return true && callerMustBeRun(); - })(); - - (function tailCallLogicalOr() { - "use strict"; - return false || callerMustBeRun(); - })(); - - (function memberTailCall() { - "use strict"; - return { f: callerMustBeRun }.f(); - })(); - - (function bindTailCall() { - "use strict"; - return callerMustBeRun.bind()(); - })(); - - // Function.prototype tests - - (function applyTailCall() { - "use strict"; - return callerMustBeRun.apply(); - })(); - - (function callTailCall() { - "use strict"; - return callerMustBeRun.call(); - })(); - - // No tail call for constructors - (function noTailConstruct() { - "use strict"; - return new callerMustBeStrict(); - })(); -} - -for (var i = 0; i < 10000; ++i) - runTests(); diff --git a/implementation-contributed/javascriptcore/stress/tail-call-varargs-no-stack-overflow.js b/implementation-contributed/javascriptcore/stress/tail-call-varargs-no-stack-overflow.js deleted file mode 100644 index a29a3e03b8..0000000000 --- a/implementation-contributed/javascriptcore/stress/tail-call-varargs-no-stack-overflow.js +++ /dev/null @@ -1,28 +0,0 @@ -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -function sloppyLoop(n) { - if (n > 0) - return sloppyLoop(...[n - 1]); -} - -function strictLoop(n) { - "use strict"; - if (n > 0) - return strictLoop(...[n - 1]); -} - -shouldThrow(function () { sloppyLoop(100000); }, 'RangeError: Maximum call stack size exceeded.'); -strictLoop(100000); diff --git a/implementation-contributed/javascriptcore/stress/tail-calls-dont-overwrite-live-stack.js b/implementation-contributed/javascriptcore/stress/tail-calls-dont-overwrite-live-stack.js deleted file mode 100644 index d9563d1d28..0000000000 --- a/implementation-contributed/javascriptcore/stress/tail-calls-dont-overwrite-live-stack.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; - -function tail(a, b) { } -noInline(tail); - -var obj = { - method: function (x) { - return tail(x, x); - }, - - get fromNative() { return tail(0, 0); } -}; -noInline(obj.method); - -function getThis(x) { return this; } -noInline(getThis); - -for (var i = 0; i < 10000; ++i) { - var that = getThis(obj.method(42)); - - if (!Object.is(that, undefined)) - throw new Error("Wrong 'this' value in call, expected undefined but got " + that); - - that = getThis(obj.method(...[42])); - if (!Object.is(that, undefined)) - throw new Error("Wrong 'this' value in varargs call, expected undefined but got " + that); - - if (!Object.is(obj.fromNative, undefined)) - throw new Error("Wrong 'fromNative' value, expected undefined but got " + obj.fromNative); -} diff --git a/implementation-contributed/javascriptcore/stress/tdz-this-in-try-catch.js b/implementation-contributed/javascriptcore/stress/tdz-this-in-try-catch.js deleted file mode 100644 index 89f22baf57..0000000000 --- a/implementation-contributed/javascriptcore/stress/tdz-this-in-try-catch.js +++ /dev/null @@ -1,22 +0,0 @@ -var __v_6388 = class __c_95 { -}; -var __v_6392 = class __c_97 extends __v_6388 { - constructor() { - var __v_6407 = () => { - try { - __v_6386(); - } catch (e) {} - try { - super.foo = 'q'; - } catch (e) {} - super() - try { - this.idValue - } catch (e) {} - }; - __v_6407(); - } -}; -for (var i = 0; i < 1000; ++i) { - new __v_6392() -} diff --git a/implementation-contributed/javascriptcore/stress/template-literal-line-terminators.js b/implementation-contributed/javascriptcore/stress/template-literal-line-terminators.js deleted file mode 100644 index c4ee4a4db7..0000000000 --- a/implementation-contributed/javascriptcore/stress/template-literal-line-terminators.js +++ /dev/null @@ -1,57 +0,0 @@ - -function test(actual, expected) { - if (actual !== expected) - throw new Error("bad value: actual: " + actual + ", expected: " + expected); -} - -function testEval(script, expected) { - test(eval(script), expected); -} - -function testEvalLineNumber(script, expected, lineNum) { - testEval(script, expected); - - var error = null; - var actualLine; - try { - eval(script + ';throw new Error("line");'); - } catch (error) { - actualLine = error.line; - } - test(actualLine, lineNum); -} - -test(`Hello`, "Hello"); -test(`Hello World`, "Hello World"); -test(` -`, "\n"); -test(`Hello -World`, "Hello\nWorld"); - -testEvalLineNumber("`Hello World`", "Hello World", 1); - -testEvalLineNumber("`Hello\rWorld`", "Hello\nWorld", 2); -testEvalLineNumber("`Hello\nWorld`", "Hello\nWorld", 2); - -testEvalLineNumber("`Hello\r\rWorld`", "Hello\n\nWorld", 3); -testEvalLineNumber("`Hello\r\nWorld`", "Hello\nWorld", 2); -testEvalLineNumber("`Hello\n\nWorld`", "Hello\n\nWorld", 3); -testEvalLineNumber("`Hello\n\rWorld`", "Hello\n\nWorld", 3); - -testEvalLineNumber("`Hello\n\r\nWorld`", "Hello\n\nWorld", 3); -testEvalLineNumber("`Hello\r\n\rWorld`", "Hello\n\nWorld", 3); -testEvalLineNumber("`Hello\n\n\nWorld`", "Hello\n\n\nWorld", 4); - -testEvalLineNumber("`Hello\n\r\n\rWorld`", "Hello\n\n\nWorld", 4); -testEvalLineNumber("`Hello\n\r\n\nWorld`", "Hello\n\n\nWorld", 4); -testEvalLineNumber("`Hello\r\n\n\nWorld`", "Hello\n\n\nWorld", 4); - -testEvalLineNumber("`Hello\\\n\r\rWorld`", "Hello\n\nWorld", 4); -testEvalLineNumber("`Hello\\\r\n\n\nWorld`", "Hello\n\nWorld", 4); -testEvalLineNumber("`Hello\\\n\r\n\nWorld`", "Hello\n\nWorld", 4); -testEvalLineNumber("`Hello\\\n\r\r\nWorld`", "Hello\n\nWorld", 4); - -testEvalLineNumber("`\u2028`", "\u2028", 2); -testEvalLineNumber("`\u2029`", "\u2029", 2); -testEvalLineNumber("`\\u2028`", "\u2028", 1); -testEvalLineNumber("`\\u2029`", "\u2029", 1); diff --git a/implementation-contributed/javascriptcore/stress/template-literal-syntax.js b/implementation-contributed/javascriptcore/stress/template-literal-syntax.js deleted file mode 100644 index 346c8dd080..0000000000 --- a/implementation-contributed/javascriptcore/stress/template-literal-syntax.js +++ /dev/null @@ -1,111 +0,0 @@ - -function testSyntax(script) { - try { - eval(script); - } catch (error) { - if (error instanceof SyntaxError) - throw new Error("Bad error: " + String(error)); - } -} - -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -testSyntax("`Hello`"); -testSyntax("(`Hello`)"); -testSyntax("(`Hello`) + 42"); -testSyntax("`\nHello\nWorld`"); -testSyntax("`\nHello\n${World}`"); -testSyntax("`${World}`"); -testSyntax("`${World} Hello`"); -testSyntax("`$ {World} Hello`"); -testSyntax("`\\uFEFFtest`"); -testSyntax("`\r\n`"); -testSyntax("`\\r\\n`"); -testSyntax("`\n`"); -testSyntax("`\\n`"); -testSyntax("`\u2028`"); -testSyntax("`\\u2028`"); -testSyntax("`\u2029`"); -testSyntax("`\\u2029`"); -testSyntax("`\\0`"); -testSyntax("`\0`"); -testSyntax("`\\x7f`"); -testSyntax("(`Hello`) + 42"); -testSyntax("`\\\n`"); -testSyntax("`\\\r\n`"); -testSyntax("`\\\r`"); -testSyntax("Hello`bad escape sequence: \\unicode`"); -testSyntax("Hello`\\00`"); -testSyntax("Hello`\\01`"); -testSyntax("Hello`\\1`"); -testSyntax("Hello`\\xo`"); -testSyntax("Hello`\\x0o`"); -testSyntax("Hello`\\uo`"); -testSyntax("Hello`\\u0o`"); -testSyntax("Hello`\\u00o`"); -testSyntax("Hello`\\u000o`"); -testSyntax("Hello`\\u{o`"); -testSyntax("Hello`\\u{0o`"); -testSyntax("Hello`\\u{110000o`"); - -testSyntaxError("`Hello", "SyntaxError: Unexpected EOF"); -testSyntaxError("`Hello${expr}", "SyntaxError: Unexpected EOF"); -testSyntaxError("`Hello${}", "SyntaxError: Unexpected token '}'. Template literal expression cannot be empty."); -testSyntaxError("`Hello${expr} ${}", "SyntaxError: Unexpected token '}'. Template literal expression cannot be empty."); -testSyntaxError("`Hello${expr}", "SyntaxError: Unexpected EOF"); -testSyntaxError("`Hello${expr} ${expr}", "SyntaxError: Unexpected EOF"); -testSyntaxError("`Hello${expr`", "SyntaxError: Unexpected EOF"); -testSyntaxError("`Hello${expr} ${expr`", "SyntaxError: Unexpected EOF"); -testSyntaxError("`Hello expr${`", "SyntaxError: Unexpected EOF"); -testSyntaxError("`Hello${expr} expr${`", "SyntaxError: Unexpected EOF"); -testSyntaxError("`Hello ${}`", "SyntaxError: Unexpected token '}'. Template literal expression cannot be empty."); -testSyntaxError("`Hello${expr} ${}`", "SyntaxError: Unexpected token '}'. Template literal expression cannot be empty."); -testSyntaxError("`\\07`", "SyntaxError: The only valid numeric escape in strict mode is '\\0'"); -for (var i = 1; i < 7; ++i) { - testSyntaxError("`\\" + i + "`", "SyntaxError: The only valid numeric escape in strict mode is '\\0'"); - testSyntaxError("`${expr}\\" + i + "`", "SyntaxError: The only valid numeric escape in strict mode is '\\0'"); -} -// \8 and \9 are not allowed. -for (var i = 8; i < 9; ++i) { - testSyntaxError("`\\" + i + "`", "SyntaxError: The only valid numeric escape in strict mode is '\\0'"); - testSyntaxError("`${expr}\\" + i + "`", "SyntaxError: The only valid numeric escape in strict mode is '\\0'"); -} -testSyntaxError("`\\x7`", "SyntaxError: \\x can only be followed by a hex character sequence"); -testSyntaxError("`${expr}\\x7`", "SyntaxError: \\x can only be followed by a hex character sequence"); -testSyntaxError("`\\x`", "SyntaxError: \\x can only be followed by a hex character sequence"); -testSyntaxError("`${expr}\\x`", "SyntaxError: \\x can only be followed by a hex character sequence"); -testSyntaxError("`\\u`", "SyntaxError: \\u can only be followed by a Unicode character sequence"); -testSyntaxError("`${expr}\\u`", "SyntaxError: \\u can only be followed by a Unicode character sequence"); -testSyntaxError("`\\u2`", "SyntaxError: \\u can only be followed by a Unicode character sequence"); -testSyntaxError("`${expr}\\u2`", "SyntaxError: \\u can only be followed by a Unicode character sequence"); -testSyntaxError("`\\u20`", "SyntaxError: \\u can only be followed by a Unicode character sequence"); -testSyntaxError("`${expr}\\u20`", "SyntaxError: \\u can only be followed by a Unicode character sequence"); -testSyntaxError("`\\u202`", "SyntaxError: \\u can only be followed by a Unicode character sequence"); -testSyntaxError("`${expr}\\u202`", "SyntaxError: \\u can only be followed by a Unicode character sequence"); - -testSyntaxError("`bad escape sequence: \\unicode`", "SyntaxError: \\u can only be followed by a Unicode character sequence"); - -testSyntaxError("`\\00`", "SyntaxError: The only valid numeric escape in strict mode is '\\0'"); -testSyntaxError("`\\01`", "SyntaxError: The only valid numeric escape in strict mode is '\\0'"); -testSyntaxError("`\\1`", "SyntaxError: The only valid numeric escape in strict mode is '\\0'"); -testSyntaxError("`\\xo`", "SyntaxError: \\x can only be followed by a hex character sequence"); -testSyntaxError("`\\x0o`", "SyntaxError: \\x can only be followed by a hex character sequence"); -testSyntaxError("`\\uo`", "SyntaxError: \\u can only be followed by a Unicode character sequence"); -testSyntaxError("`\\u0o`", "SyntaxError: \\u can only be followed by a Unicode character sequence"); -testSyntaxError("`\\u00o`", "SyntaxError: \\u can only be followed by a Unicode character sequence"); -testSyntaxError("`\\u000o`", "SyntaxError: \\u can only be followed by a Unicode character sequence"); -testSyntaxError("`\\u{o`", "SyntaxError: \\u can only be followed by a Unicode character sequence"); -testSyntaxError("`\\u{0o`", "SyntaxError: \\u can only be followed by a Unicode character sequence"); -testSyntaxError("`\\u{110000o`", "SyntaxError: \\u can only be followed by a Unicode character sequence"); diff --git a/implementation-contributed/javascriptcore/stress/template-literal.js b/implementation-contributed/javascriptcore/stress/template-literal.js deleted file mode 100644 index 5f66d6d0bc..0000000000 --- a/implementation-contributed/javascriptcore/stress/template-literal.js +++ /dev/null @@ -1,239 +0,0 @@ - -function test(actual, expected) { - if (actual !== expected) - throw new Error("bad value: " + actual); -} - -function testEval(script, expected) { - test(eval(script), expected); -} - -function testEmbedded(value, expected) { - var template = `Hello ${value} World`; - test(template, expected); -} - -test(``, ""); -test(`${""}`, ""); -test(`${``}`, ""); -test(`${``}${``}${``}${""}`, ""); - -test(`Hello World`, "Hello World"); -test(`Hello - World`, "Hello\n World"); - -test(`\uFEFF`, "\uFEFF"); -testEval("`\uFEFF`", "\uFEFF"); - -test(`\x20`, "\x20"); -test(`\x2020`, "\x2020"); - -for (var ch of [ '\'', '"', '\\', 'b', 'f', 'n', 'r', 't', 'v' ]) - testEval("`\\" + ch + "`", eval("'\\" + ch + "'")); - -test(`\ -Hello World`, "Hello World"); - -test(`\ - -Hello World`, "\nHello World"); - -test(`\u2028\u2029\r\n`, "\u2028\u2029\r\n"); -test(`\u2028\u2029\n\r\n`, "\u2028\u2029\n\r\n"); -test(`\u2028200`, "\u2028200"); - -testEmbedded(42, "Hello 42 World"); -testEmbedded("ISUCA", "Hello ISUCA World"); -testEmbedded(null, "Hello null World"); -testEmbedded(undefined, "Hello undefined World"); -testEmbedded({}, "Hello [object Object] World"); - -(function () { - var object = { - name: "Cocoa", - }; - var array = [ - "Cappuccino" - ] - test(`Hello ${object.name} and ${array[0]} :D`, "Hello Cocoa and Cappuccino :D"); -}()); - -(function () { - function ok() { - return "Cocoa"; - } - test(`Hello ${ ok() }`, "Hello Cocoa"); -}()); - -(function () { - var object = { - toString() { - return 'Cocoa'; - } - }; - test(`Hello ${object} :D`, "Hello Cocoa :D"); -}()); - -// Immediately adjacent template expressions, with empty intermediate template strings. -test(`${"C"}${"o"}${"c"}${"o"}${"a"}`, "Cocoa"); -test(`${"C"}${"o"}${"c"}${"o"}${" "}`, "Coco "); - -// Nested templates. -test(`Hello ${ `Cocoa` }`, "Hello Cocoa"); -test(`Hello ${ `Co${`c`}oa` }`, "Hello Cocoa"); - -// Evaluation order -(function () { - var count = 0; - - function check(num) { - var now = count++; - test(now, num); - return now; - } - - test(`Hello ${ `${ check(0) } ${ ` ${ check(1) } ${ check(2) }` } ${ check(3) }` } ${ check(4) }`, "Hello 0 1 2 3 4") -}()); - -// Exceptions - -(function () { - function gen(num) { - return { - toString() { - throw new Error(num); - } - }; - } - - var error = null; - try { - var template = `${gen(0)} ${gen(1)} ${gen(2)}`; - } catch (e) { - error = e; - } - if (!error) - throw new Error('no error thrown'); - if (String(error) !== 'Error: 0') - throw new Error("bad error: " + String(error)); - - var error = null; - try { - var template = `${52} ${gen(0)} ${gen(1)}`; - } catch (e) { - error = e; - } - if (!error) - throw new Error('no error thrown'); - if (String(error) !== 'Error: 0') - throw new Error("bad error: " + String(error)); -}()); - - -(function () { - var stat= { - count: 0 - }; - function gen(num) { - stat[num] = { - called: true, - count: stat.count++, - toString: null - }; - return { - toString() { - stat[num].toString = { - called: true, - count: stat.count++, - }; - throw new Error(num); - } - }; - } - - var error = null; - try { - var template = `${gen(0)} ${gen(1)} ${gen(2)}`; - } catch (e) { - error = e; - } - if (!error) - throw new Error('no error thrown'); - if (String(error) !== 'Error: 0') - throw new Error("bad error: " + String(error)); - test(stat[0].count, 0); - test(stat[0].toString.called, true); - test(stat[0].toString.count, 1); - test(stat[1], undefined); - test(stat[2], undefined); -}()); - -(function () { - var stat= { - count: 0 - }; - function gen(num) { - stat[num] = { - called: true, - count: stat.count++, - toString: null - }; - return { - toString() { - stat[num].toString = { - called: true, - count: stat.count++, - }; - throw new Error(num); - } - }; - } - - var error = null; - try { - var template = `${ `${gen(0)}` } ${ `${gen(1)} ${gen(2)}` }`; - } catch (e) { - error = e; - } - if (!error) - throw new Error('no error thrown'); - if (String(error) !== 'Error: 0') - throw new Error("bad error: " + String(error)); - test(stat[0].count, 0); - test(stat[0].toString.called, true); - test(stat[0].toString.count, 1); - test(stat[1], undefined); - test(stat[2], undefined); -}()); - -dfgTests =[ - function testSingleNode() { - for (var i = 0; i < 1000; i++) - `${1}` - }, - function testPreNode() { - for (var i = 0; i < 1000; i++) - `n${1}` - }, - function testPostNode() { - for (var i = 0; i < 1000; i++) - `${1}n` - }, - function testSingleObjectNode() { - for (var i = 0; i < 1000; i++) - `${{}}` - }, - function testObjectPreNode() { - for (var i = 0; i < 1000; i++) - `n${{}}` - }, - function testObjectPostNode() { - for (var i = 0; i < 1000; i++) - `${{}}n` - }, -]; - -for(var f of dfgTests) { - noInline(f) - f(); -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/template-string-tags-eval.js b/implementation-contributed/javascriptcore/stress/template-string-tags-eval.js deleted file mode 100644 index 42bff1ea52..0000000000 --- a/implementation-contributed/javascriptcore/stress/template-string-tags-eval.js +++ /dev/null @@ -1,17 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function tag(site) -{ - return site; -} - -var site1 = eval("0, tag`Cocoa`"); -var site2 = eval("1, tag`Cappuccino`"); -var site3 = eval("2, tag`Cocoa`"); - -shouldBe(site1 !== site3, true); -shouldBe(site1 !== site2, true); diff --git a/implementation-contributed/javascriptcore/stress/test-finally.js b/implementation-contributed/javascriptcore/stress/test-finally.js deleted file mode 100644 index 07bb332a4c..0000000000 --- a/implementation-contributed/javascriptcore/stress/test-finally.js +++ /dev/null @@ -1,1446 +0,0 @@ -// This test just creates functions which exercise various permutations of control flow -// thru finally blocks. The test passes if it does not throw any exceptions or crash on -// bytecode validation. -//@ skip - -if (this.window) - print = console.log; - -var steps; -var returned; -var thrown; -var testLineNumber; - -let NothingReturned = "NothingReturned"; -let NothingThrown = "NothingThrown"; - -function assertResults(expectedSteps, expectedReturned, expectedThrown) { - let stepsMismatch = (steps != expectedSteps); - let returnedMismatch = (returned != expectedReturned); - let thrownMismatch = (thrown != expectedThrown && !("" + thrown).startsWith("" + expectedThrown)); - - if (stepsMismatch || returnedMismatch || thrownMismatch) { - print("FAILED Test @ line " + testLineNumber + ":"); - print(" Actual: steps: " + steps + ", returned: " + returned + ", thrown: '" + thrown + "'"); - print(" Expected: steps: " + expectedSteps + ", returned: " + expectedReturned + ", thrown: '" + expectedThrown + "'"); - } - if (stepsMismatch) - throw "FAILED Test @ line " + testLineNumber + ": steps do not match: expected ='" + expectedSteps + "' actual='" + steps + "'"; - if (returnedMismatch) - throw "FAILED Test @ line " + testLineNumber + ": returned value does not match: expected ='" + expectedReturned + "' actual='" + returned + "'"; - if (thrownMismatch) - throw "FAILED Test @ line " + testLineNumber + ": thrown value does does not match: expected ='" + expectedThrown + "' actual='" + thrown + "'"; -} - -function resetResults() { - steps = []; - returned = NothingReturned; - thrown = NothingThrown; -} - -function append(step) { - let next = steps.length; - steps[next] = step; -} - -function test(func, expectedSteps, expectedReturned, expectedThrown) { - testLineNumber = new Error().stack.match(/global code@.+\.js:([0-9]+)/)[1]; - resetResults(); - - try { - returned = func(); - } catch (e) { - thrown = e; - } - - assertResults(expectedSteps, expectedReturned, expectedThrown); -} - -// Test CompletionType::Normal on an empty try blocks. -test(() => { - try { - append("t2"); - for (var i = 0; i < 2; i++) { - try { - } catch(a) { - append("c1"); - } finally { - append("f1"); - } - } - } catch(b) { - append("c2"); - } finally { - append("f2"); - } - -}, "t2,f1,f1,f2", undefined, NothingThrown); - -// Test CompletionType::Normal. -test(() => { - try { - append("t2"); - for (var i = 0; i < 2; i++) { - try { - append("t1"); - } catch(a) { - append("c1"); - } finally { - append("f1"); - } - } - } catch(b) { - append("c2"); - } finally { - append("f2"); - } - -}, "t2,t1,f1,t1,f1,f2", undefined, NothingThrown); - -// Test CompletionType::Break. -test(() => { - try { - append("t2"); - for (var i = 0; i < 2; i++) { - try { - append("t1"); - break; - } catch(a) { - append("c1"); - } finally { - append("f1"); - } - } - } catch(b) { - append("c2"); - } finally { - append("f2"); - } - -}, "t2,t1,f1,f2", undefined, NothingThrown); - -// Test CompletionType::Continue. -test(() => { - try { - append("t2"); - for (var i = 0; i < 2; i++) { - try { - append("t1"); - continue; - } catch(a) { - append("c1"); - } finally { - append("f1"); - } - } - } catch(b) { - append("c2"); - } finally { - append("f2"); - } - -}, "t2,t1,f1,t1,f1,f2", undefined, NothingThrown); - -// Test CompletionType::Return. -test(() => { - try { - append("t2"); - for (var i = 0; i < 2; i++) { - try { - append("t1"); - return; - } catch(a) { - append("c1"); - } finally { - append("f1"); - } - } - } catch(b) { - append("c2"); - } finally { - append("f2"); - } - -}, "t2,t1,f1,f2", undefined, NothingThrown); - -// Test CompletionType::Throw. -test(() => { - try { - append("t2"); - for (var i = 0; i < 2; i++) { - try { - append("t1"); - throw { }; - } catch(a) { - append("c1"); - } finally { - append("f1"); - } - } - } catch(b) { - append("c2"); - } finally { - append("f2"); - } - -}, "t2,t1,c1,f1,t1,c1,f1,f2", undefined, NothingThrown); - -// Test CompletionType::Normal in a for-of loop. -test(() => { - let arr = [1, 2]; - try { - append("t2"); - for (let x of arr) { - try { - append("t1"); - } catch(a) { - append("c1"); - } finally { - append("f1"); - } - } - } catch(b) { - append("c2"); - } finally { - append("f2"); - } - -}, "t2,t1,f1,t1,f1,f2", undefined, NothingThrown); - -// Test CompletionType::Break in a for-of loop. -test(() => { - let arr = [1, 2]; - try { - append("t2"); - for (let x of arr) { - try { - append("t1"); - break; - } catch(a) { - append("c1"); - } finally { - append("f1"); - } - } - } catch(b) { - append("c2"); - } finally { - append("f2"); - } - -}, "t2,t1,f1,f2", undefined, NothingThrown); - -// Test CompletionType::Continue in a for-of loop. -test(() => { - let arr = [1, 2]; - try { - append("t2"); - for (let x of arr) { - try { - append("t1"); - continue; - } catch(a) { - append("c1"); - } finally { - append("f1"); - } - } - } catch(b) { - append("c2"); - } finally { - append("f2"); - } - -}, "t2,t1,f1,t1,f1,f2", undefined, NothingThrown); - -// Test CompletionType::Return in a for-of loop. -test(() => { - let arr = [1, 2]; - try { - append("t2"); - for (let x of arr) { - try { - append("t1"); - return; - } catch(a) { - append("c1"); - } finally { - append("f1"); - } - } - } catch(b) { - append("c2"); - } finally { - append("f2"); - } - -}, "t2,t1,f1,f2", undefined, NothingThrown); - -// Test CompletionType::Throw in a for-of loop. -test(() => { - let arr = [1, 2]; - try { - append("t2"); - for (let x of arr) { - try { - append("t1"); - throw { }; - } catch(a) { - append("c1"); - } finally { - append("f1"); - } - } - } catch(b) { - append("c2"); - } finally { - append("f2"); - } - -}, "t2,t1,c1,f1,t1,c1,f1,f2", undefined, NothingThrown); - - -// No abrupt completions. -test(() => { - append("a"); - try { - append("b"); - } finally { - append("c"); - } - append("d"); - return 400; - -}, "a,b,c,d", 400, NothingThrown); - - -// Return after a. Should not execute any finally blocks, and return a's result. -test(() => { - append("a"); - return 100; - try { - append("b"); - return 200; - try { - append("c"); - return 300; - } finally { - append("d"); - } - append("e"); - return 500; - } finally { - append("f"); - } - append("g"); - return 700; - -}, "a", 100, NothingThrown); - -// Return after b. Should execute finally block f only, and return b's result. -test(() => { - append("a"); - try { - append("b"); - return 200; - try { - append("c"); - return 300; - } finally { - append("d"); - } - append("e"); - return 500; - } finally { - append("f"); - } - append("g"); - return 700; - -}, "a,b,f", 200, NothingThrown); - -// Return after c. Should execute finally blocks d and f, and return c's result. -test(() => { - append("a"); - try { - append("b"); - try { - append("c"); - return 300; - } finally { - append("d"); - } - append("e"); - return 500; - } finally { - append("f"); - } - append("g"); - return 700; - -}, "a,b,c,d,f", 300, NothingThrown); - -// Return after c and d. Should execute finally blocks d and f, and return last return value from d. -test(() => { - append("a"); - try { - append("b"); - try { - append("c"); - return 300; - } finally { - append("d"); - return 400; - } - append("e"); - return 500; - } finally { - append("f"); - } - append("g"); - return 700; - -}, "a,b,c,d,f", 400, NothingThrown); - -// Return after c, d, and f. Should execute finally blocks d and f, and return last return value from f. -test(() => { - append("a"); - try { - append("b"); - try { - append("c"); - return 300; - } finally { - append("d"); - return 400; - } - append("e"); - return 500; - } finally { - append("f"); - return 600; - } - append("g"); - return 700; - -}, "a,b,c,d,f", 600, NothingThrown); - -// Return after g. -test(() => { - append("a"); - try { - append("b"); - try { - append("c"); - } finally { - append("d"); - } - append("e"); - } finally { - append("f"); - } - append("g"); - return 700; - -}, "a,b,c,d,e,f,g", 700, NothingThrown); - -// Throw after a. -test(() => { - append("a"); - throw 100; - try { - append("b"); - throw 200; - try { - append("c"); - throw 300; - } finally { - append("d"); - } - append("e"); - throw 500; - } finally { - append("f"); - } - append("g"); - throw 700; - -}, "a", NothingReturned, 100); - -// Throw after b. -test(() => { - append("a"); - try { - append("b"); - throw 200; - try { - append("c"); - throw 300; - } finally { - append("d"); - } - append("e"); - throw 500; - } finally { - append("f"); - } - append("g"); - throw 700; - -}, "a,b,f", NothingReturned, 200); - -// Throw after c. -test(() => { - append("a"); - try { - append("b"); - try { - append("c"); - throw 300; - } finally { - append("d"); - } - append("e"); - throw 500; - } finally { - append("f"); - } - append("g"); - throw 700; - -}, "a,b,c,d,f", NothingReturned, 300); - -// Throw after c and d. -test(() => { - append("a"); - try { - append("b"); - try { - append("c"); - throw 300; - } finally { - append("d"); - throw 400; - } - append("e"); - throw 500; - } finally { - append("f"); - } - append("g"); - throw 700; - -}, "a,b,c,d,f", NothingReturned, 400); - -// Throw after c, d, and f. -test(() => { - append("a"); - try { - append("b"); - try { - append("c"); - throw 300; - } finally { - append("d"); - throw 400; - } - append("e"); - throw 500; - } finally { - append("f"); - throw 600; - } - append("g"); - return 700; - -}, "a,b,c,d,f", NothingReturned, 600); - -// Throw after g. -test(() => { - append("a"); - try { - append("b"); - try { - append("c"); - } finally { - append("d"); - } - append("e"); - } finally { - append("f"); - } - append("g"); - throw 700; - -}, "a,b,c,d,e,f,g", NothingReturned, 700); - -// Throw after b with catch at z. -test(() => { - append("a"); - try { - append("b"); - throw 200; - try { - append("c"); - throw 300; - } finally { - append("d"); - } - append("e"); - throw 500; - } catch (e) { - append("z"); - } finally { - append("f"); - } - append("g"); - return 700; - -}, "a,b,z,f,g", 700, NothingThrown); - -// Throw after b with catch at z and rethrow at z. -test(() => { - append("a"); - try { - append("b"); - throw 200; - try { - append("c"); - throw 300; - } finally { - append("d"); - } - append("e"); - throw 500; - } catch (e) { - append("z"); - throw 5000; - } finally { - append("f"); - } - append("g"); - return 700; - -}, "a,b,z,f", NothingReturned, 5000); - -// Throw after c with catch at y and z. -test(() => { - append("a"); - try { - append("b"); - try { - append("c"); - throw 300; - } catch (e) { - append("y"); - } finally { - append("d"); - } - append("e"); - } catch (e) { - append("z"); - } finally { - append("f"); - } - append("g"); - return 700; - -}, "a,b,c,y,d,e,f,g", 700, NothingThrown); - -// Throw after c with catch at y and z, and rethrow at y. -test(() => { - append("a"); - try { - append("b"); - try { - append("c"); - throw 300; - } catch (e) { - append("y"); - throw 3000; - } finally { - append("d"); - } - append("e"); - } catch (e) { - append("z"); - } finally { - append("f"); - } - append("g"); - return 700; - -}, "a,b,c,y,d,z,f,g", 700, NothingThrown); - -// Throw after c with catch at y and z, and rethrow at y and z. -test(() => { - append("a"); - try { - append("b"); - try { - append("c"); - throw 300; - } catch (e) { - append("y"); - throw 3000; - } finally { - append("d"); - } - append("e"); - } catch (e) { - append("z"); - throw 5000; - } finally { - append("f"); - } - append("g"); - return 700; - -}, "a,b,c,y,d,z,f", NothingReturned, 5000); - -// Throw after c with catch at y and z, and rethrow at y, z, and f. -test(() => { - append("a"); - try { - append("b"); - try { - append("c"); - throw 300; - } catch (e) { - append("y"); - throw 3000; - } finally { - append("d"); - } - append("e"); - } catch (e) { - append("z"); - throw 5000; - } finally { - append("f"); - throw 600; - } - append("g"); - return 700; - -}, "a,b,c,y,d,z,f", NothingReturned, 600); - -// No throw or return in for-of loop. -test(() => { - class TestIterator { - constructor() { - append("c"); - this.i = 0; - } - next() { - append("n"); - let done = (this.i == 3); - return { done, value: this.i++ }; - } - return() { - append("r"); - return { } - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new TestIterator(); - } - - for (var element of arr) { - append(element); - } - append("x"); - return 200; - -}, "c,n,0,n,1,n,2,n,x", 200, NothingThrown); - -// Break in for-of loop. -test(() => { - class TestIterator { - constructor() { - append("c"); - this.i = 0; - } - next() { - append("n"); - let done = (this.i == 3); - return { done, value: this.i++ }; - } - return() { - append("r"); - return { } - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new TestIterator(); - } - - for (var element of arr) { - append(element); - if (element == 1) - break; - } - append("x"); - return 200; - -}, "c,n,0,n,1,r,x", 200, NothingThrown); - -// Break in for-of loop with throw in Iterator.return(). -test(() => { - class Iterator { - constructor() { - append("c"); - this.i = 0; - } - next() { - append("n"); - let done = (this.i == 3); - return { done, value: this.i++ }; - } - return() { - append("r"); - throw 300; - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new Iterator(); - } - - for (var element of arr) { - append(element); - if (element == 1) - break; - } - append("x"); - return 200; - -}, "c,n,0,n,1,r", NothingReturned, 300); - -// Break in for-of loop with Iterator.return() returning a non object. -test(() => { - class Iterator { - constructor() { - append("c"); - this.i = 0; - } - next() { - append("n"); - let done = (this.i == 3); - return { done, value: this.i++ }; - } - return() { - append("r"); - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new Iterator(); - } - - for (var element of arr) { - append(element); - if (element == 1) - break; - } - append("x"); - return 200; - -}, "c,n,0,n,1,r", NothingReturned, 'TypeError'); - -// Return in for-of loop. -test(() => { - class TestIterator { - constructor() { - append("c"); - this.i = 0; - } - next() { - append("n"); - let done = (this.i == 3); - return { done, value: this.i++ }; - } - return() { - append("r"); - return { } - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new TestIterator(); - } - - for (var element of arr) { - append(element); - if (element == 1) - return 100; - } - append("x"); - return 200; - -}, "c,n,0,n,1,r", 100, NothingThrown); - -// Return in for-of loop with throw in Iterator.return(). -test(() => { - class Iterator { - constructor() { - append("c"); - this.i = 0; - } - next() { - append("n"); - let done = (this.i == 3); - return { done, value: this.i++ }; - } - return() { - append("r"); - throw 300; - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new Iterator(); - } - - for (var element of arr) { - append(element); - if (element == 1) - return 100; - } - append("x"); - return 200; - -}, "c,n,0,n,1,r", NothingReturned, 300); - -// Return in for-of loop with Iterator.return() returning a non object. -test(() => { - class Iterator { - constructor() { - append("c"); - this.i = 0; - } - next() { - append("n"); - let done = (this.i == 3); - return { done, value: this.i++ }; - } - return() { - append("r"); - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new Iterator(); - } - - for (var element of arr) { - append(element); - if (element == 1) - return 100; - } - append("x"); - return 200; - -}, "c,n,0,n,1,r", NothingReturned, 'TypeError'); - - -// Throw in for-of loop. -test(() => { - class Iterator { - constructor() { - append("c"); - this.i = 0; - } - next() { - append("n"); - let done = (this.i == 3); - return { done, value: this.i++ }; - } - return() { - append("r"); - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new Iterator(); - } - - for (var element of arr) { - append(element); - if (element == 1) - throw 100; - } - append("x"); - return 200; - -}, "c,n,0,n,1,r", NothingReturned, 100); - -// Throw in for-of loop with throw in Iterator.return(). -test(() => { - class Iterator { - constructor() { - append("c"); - this.i = 0; - } - next() { - append("n"); - let done = (this.i == 3); - return { done, value: this.i++ }; - } - return() { - append("r"); - throw 300; - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new Iterator(); - } - - for (var element of arr) { - append(element); - if (element == 1) - throw 100; - } - append("x"); - return 200; - -}, "c,n,0,n,1,r", NothingReturned, 100); - -// Handling return in finally block F1 with try-finally in F1's body. -test(() => { - try { - append("t1a"); - return "r1"; - append("t1b"); - } catch(e) { - append("c1"); - } finally { - append("f1a"); - - try { - append("t2"); - } catch (e) { - append("c2"); - } finally { - append("f2"); - } - append("f1b"); - } - -}, "t1a,f1a,t2,f2,f1b", "r1", NothingThrown); - -// Handling return in finally block F1 with try-finally in F1's body, with F1 in a for-of loop. -test(() => { - class TestIterator { - constructor() { - append("ci"); - this.i = 0; - } - next() { - append("ni"); - let done = (this.i == 3); - return { done, value: this.i++ }; - } - return() { - append("ri"); - return { } - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new TestIterator(); - } - - for (var element of arr) { - append(element); - try { - append("t1a"); - return "r1"; - append("t1b"); - } catch(e) { - append("c1"); - } finally { - append("f1a"); - - try { - append("t2"); - } catch (e) { - append("c2"); - } finally { - append("f2"); - } - append("f1b"); - } - } - append("x"); - -}, "ci,ni,0,t1a,f1a,t2,f2,f1b,ri", "r1", NothingThrown); - -// Handling break in finally block F1 with try-finally in F1's body, with F1 in a for-of loop. -test(() => { - class TestIterator { - constructor() { - append("ci"); - this.i = 0; - } - next() { - append("ni"); - let done = (this.i == 3); - return { done, value: this.i++ }; - } - return() { - append("ri"); - return { } - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new TestIterator(); - } - - for (var element of arr) { - append(element); - try { - append("t1a"); - break; - append("t1b"); - } catch(e) { - append("c1"); - } finally { - append("f1a"); - - try { - append("t2"); - } catch (e) { - append("c2"); - } finally { - append("f2"); - } - append("f1b"); - } - } - append("x"); - -}, "ci,ni,0,t1a,f1a,t2,f2,f1b,ri,x", undefined, NothingThrown); - -// Handling return in a for-of loop in finally block F1 with try-finally in F1's body. -test(() => { - class TestIterator { - constructor() { - append("ci"); - this.i = 0; - } - next() { - append("ni"); - let done = (this.i == 3); - return { done, value: this.i++ }; - } - return() { - append("ri"); - return { } - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new TestIterator(); - } - - try { - append("t1a"); - for (var element of arr) { - append(element); - return "r1"; - } - append("t1b"); - } catch(e) { - append("c1"); - } finally { - append("f1a"); - - try { - append("t2"); - } catch (e) { - append("c2"); - } finally { - append("f2"); - } - append("f1b"); - } - append("x"); - -}, "t1a,ci,ni,0,ri,f1a,t2,f2,f1b", "r1", NothingThrown); - -// Handling break in a for-of loop in finally block F1 with try-finally in F1's body. -test(() => { - class TestIterator { - constructor() { - append("ci"); - this.i = 0; - } - next() { - append("ni"); - let done = (this.i == 3); - return { done, value: this.i++ }; - } - return() { - append("ri"); - return { } - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new TestIterator(); - } - - try { - append("t1a"); - for (var element of arr) { - append(element); - break; - } - append("t1b"); - } catch(e) { - append("c1"); - } finally { - append("f1a"); - - try { - append("t2"); - } catch (e) { - append("c2"); - } finally { - append("f2"); - } - append("f1b"); - } - append("x"); - -}, "t1a,ci,ni,0,ri,t1b,f1a,t2,f2,f1b,x", undefined, NothingThrown); - -// Handling return in finally block F1 with a for-of loop in F1's body. -test(() => { - class TestIterator { - constructor() { - append("ci"); - this.i = 0; - } - next() { - append("ni"); - let done = (this.i == 2); - return { done, value: this.i++ }; - } - return() { - append("ri"); - return { } - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new TestIterator(); - } - - try { - append("t1a"); - return "r1"; - append("t1b"); - } catch(e) { - append("c1"); - } finally { - append("f1a"); - - for (var element of arr) { - append(element); - } - append("f1b"); - } - - append("x"); - -}, "t1a,f1a,ci,ni,0,ni,1,ni,f1b", "r1", NothingThrown); - -// Handling return in finally block F1 with a for-of loop nesting a try-finally in F1's body. -test(() => { - class TestIterator { - constructor() { - append("ci"); - this.i = 0; - } - next() { - append("ni"); - let done = (this.i == 2); - return { done, value: this.i++ }; - } - return() { - append("ri"); - return { } - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new TestIterator(); - } - - try { - append("t1a"); - return "r1"; - append("t1b"); - } catch(e) { - append("c1"); - } finally { - append("f1a"); - - for (var element of arr) { - append(element); - try { - append("t2"); - } catch (e) { - append("c2"); - } finally { - append("f2"); - } - } - append("f1b"); - } - - append("x"); - -}, "t1a,f1a,ci,ni,0,t2,f2,ni,1,t2,f2,ni,f1b", "r1", NothingThrown); - -// Handling return in finally block F1 with a for-of loop in F1's body + break in for-of loop. -test(() => { - class TestIterator { - constructor() { - append("ci"); - this.i = 0; - } - next() { - append("ni"); - let done = (this.i == 2); - return { done, value: this.i++ }; - } - return() { - append("ri"); - return { } - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new TestIterator(); - } - - try { - append("t1a"); - return "r1"; - append("t1b"); - } catch(e) { - append("c1"); - } finally { - append("f1a"); - - for (var element of arr) { - append(element); - break; - } - append("f1b"); - } - - append("x"); - -}, "t1a,f1a,ci,ni,0,ri,f1b", "r1", NothingThrown); - -// Handling return in finally block F1 with a for-of loop nesting a try-finally in F1's body + break in for-of loop. -test(() => { - class TestIterator { - constructor() { - append("ci"); - this.i = 0; - } - next() { - append("ni"); - let done = (this.i == 2); - return { done, value: this.i++ }; - } - return() { - append("ri"); - return { } - } - } - - var arr = []; - arr[Symbol.iterator] = function() { - return new TestIterator(); - } - - try { - append("t1a"); - return "r1"; - append("t1b"); - } catch(e) { - append("c1"); - } finally { - append("f1a"); - - for (var element of arr) { - append(element); - try { - append("t2"); - } catch (e) { - append("c2"); - } finally { - append("f2"); - } - break; - } - append("f1b"); - } - - append("x"); - -}, "t1a,f1a,ci,ni,0,t2,f2,ri,f1b", "r1", NothingThrown); - -// Handling return in finally block F1 with try-finally in F1's body. -test(() => { - try { - append("t1a"); - return "r1"; - append("t1b"); - } catch(e) { - append("c1"); - } finally { - append("f1a"); - - try { - append("t2"); - throw "t2"; - } catch (e) { - append("c2"); - // t2 caught here, and completion type set back to normal. - } finally { - append("f2"); - } - append("f1b"); - } - -}, "t1a,f1a,t2,c2,f2,f1b", "r1", NothingThrown); - -if (this.window) - print("PASSED"); diff --git a/implementation-contributed/javascriptcore/stress/throw-from-ftl-call-ic-slow-path-cells.js b/implementation-contributed/javascriptcore/stress/throw-from-ftl-call-ic-slow-path-cells.js deleted file mode 100644 index 58c2e5e9d2..0000000000 --- a/implementation-contributed/javascriptcore/stress/throw-from-ftl-call-ic-slow-path-cells.js +++ /dev/null @@ -1,192 +0,0 @@ -// Attempts to induce a crash resulting from the FTL emitting code that clobbers the tag registers and then -// throwing an exception without restoring those tag registers' values. - -function ftlFunction(array, callee) { - // Gotta use lots of gprs. - var x0 = array[0]; - var x1 = array[1]; - var x2 = array[2]; - var x3 = array[3]; - var x4 = array[4]; - var x5 = array[5]; - var x6 = array[6]; - var x7 = array[7]; - var x8 = array[8]; - var x9 = array[9]; - var x10 = array[10]; - var x11 = array[11]; - var x12 = array[12]; - var x13 = array[13]; - var x14 = array[14]; - var x15 = array[15]; - var x16 = array[16]; - var x17 = array[17]; - var x18 = array[18]; - var x19 = array[19]; - var x20 = array[20]; - var x21 = array[21]; - var x22 = array[22]; - var x23 = array[23]; - var x24 = array[24]; - var x25 = array[25]; - var x26 = array[26]; - var x27 = array[27]; - var x28 = array[28]; - var x29 = array[29]; - var x30 = array[30]; - var x31 = array[31]; - var x32 = array[32]; - var x33 = array[33]; - var x34 = array[34]; - var x35 = array[35]; - var x36 = array[36]; - var x37 = array[37]; - var x38 = array[38]; - var x39 = array[39]; - var x40 = array[40]; - var x41 = array[41]; - var x42 = array[42]; - var x43 = array[43]; - var x44 = array[44]; - var x45 = array[45]; - var x46 = array[46]; - var x47 = array[47]; - var x48 = array[48]; - var x49 = array[49]; - var x50 = array[50]; - var x51 = array[51]; - var x52 = array[52]; - var x53 = array[53]; - var x54 = array[54]; - var x55 = array[55]; - var x56 = array[56]; - var x57 = array[57]; - var x58 = array[58]; - var x59 = array[59]; - var x60 = array[60]; - var x61 = array[61]; - var x62 = array[62]; - var x63 = array[63]; - - // Make a call that will throw, when we ask it to. - callee("hello"); - - // Use all of those crazy values. - return [x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x60, x61, x62, x63] -} - -noInline(ftlFunction); - -// Create some callees that are too crazy to get inlined or devirtualized, but that don't have effects. - -function happyCallee0() { return 0 }; -function happyCallee1() { return 1 }; -function happyCallee2() { return 2 }; -function happyCallee3() { return 3 }; -function happyCallee4() { return 4 }; -function happyCallee5() { return 5 }; -function happyCallee6() { return 6 }; -function happyCallee7() { return 7 }; -function happyCallee8() { return 8 }; -function happyCallee9() { return 9 }; -function happyCallee10() { return 10 }; -function happyCallee11() { return 11 }; -function happyCallee12() { return 12 }; -function happyCallee13() { return 13 }; -function happyCallee14() { return 14 }; -function happyCallee15() { return 15 }; -function happyCallee16() { return 16 }; -function happyCallee17() { return 17 }; -function happyCallee18() { return 18 }; -function happyCallee19() { return 19 }; -function happyCallee20() { return 20 }; -function happyCallee21() { return 21 }; -function happyCallee22() { return 22 }; -function happyCallee23() { return 23 }; -function happyCallee24() { return 24 }; -function happyCallee25() { return 25 }; -function happyCallee26() { return 26 }; -function happyCallee27() { return 27 }; -function happyCallee28() { return 28 }; -function happyCallee29() { return 29 }; -function happyCallee30() { return 30 }; -function happyCallee31() { return 31 }; -function happyCallee32() { return 32 }; -function happyCallee33() { return 33 }; -function happyCallee34() { return 34 }; -function happyCallee35() { return 35 }; -function happyCallee36() { return 36 }; -function happyCallee37() { return 37 }; -function happyCallee38() { return 38 }; -function happyCallee39() { return 39 }; -function happyCallee40() { return 40 }; -function happyCallee41() { return 41 }; -function happyCallee42() { return 42 }; -function happyCallee43() { return 43 }; -function happyCallee44() { return 44 }; -function happyCallee45() { return 45 }; -function happyCallee46() { return 46 }; -function happyCallee47() { return 47 }; -function happyCallee48() { return 48 }; -function happyCallee49() { return 49 }; -function happyCallee50() { return 50 }; -function happyCallee51() { return 51 }; -function happyCallee52() { return 52 }; -function happyCallee53() { return 53 }; -function happyCallee54() { return 54 }; -function happyCallee55() { return 55 }; -function happyCallee56() { return 56 }; -function happyCallee57() { return 57 }; -function happyCallee58() { return 58 }; -function happyCallee59() { return 59 }; -function happyCallee60() { return 60 }; -function happyCallee61() { return 61 }; -function happyCallee62() { return 62 }; -function happyCallee63() { return 63 }; - -var happyCallees = [happyCallee0, happyCallee1, happyCallee2, happyCallee3, happyCallee4, happyCallee5, happyCallee6, happyCallee7, happyCallee8, happyCallee9, happyCallee10, happyCallee11, happyCallee12, happyCallee13, happyCallee14, happyCallee15, happyCallee16, happyCallee17, happyCallee18, happyCallee19, happyCallee20, happyCallee21, happyCallee22, happyCallee23, happyCallee24, happyCallee25, happyCallee26, happyCallee27, happyCallee28, happyCallee29, happyCallee30, happyCallee31, happyCallee32, happyCallee33, happyCallee34, happyCallee35, happyCallee36, happyCallee37, happyCallee38, happyCallee39, happyCallee40, happyCallee41, happyCallee42, happyCallee43, happyCallee44, happyCallee45, happyCallee46, happyCallee47, happyCallee48, happyCallee49, happyCallee50, happyCallee51, happyCallee52, happyCallee53, happyCallee54, happyCallee55, happyCallee56, happyCallee57, happyCallee58, happyCallee59, happyCallee60, happyCallee61, happyCallee62, happyCallee63]; - -for (var i = 0; i < happyCallees.length; ++i) - noInline(happyCallees[i]); - -// Unlike the other test (throw-from-ftl-call-ic-slow-path.js), we want to populate the registers with cells in -// this test. -var array = new Array(); -for (var i = 0; i < 64; ++i) - array[i] = new Object(); - -// Now, do some warming up. -for (var i = 0; i < 100000; ++i) { - var result = ftlFunction(array, happyCallees[i % happyCallees.length]); - if (result.length != array.length) - throw "Error: bad length: " + result; - for (var j = 0; j < result.length; ++j) { - if (result[j] != array[j]) - throw "Error: bad entry at j = " + j + ": " + result; - } -} - -// Finally, attempt to trigger the bug. -var notACell = 42; -for (var i = 0; i < 100; ++i) { - try { - ftlFunction(array, Int8Array); - } catch (e) { - if (e.message.indexOf("constructor without new is invalid") < 0) - throw "Error: bad exception message: " + e.message; - var result = notACell.f; - if (result !== void 0) { - print("Bad outcome of accessing f on notACell."); - print("Here's notACell:", notACell, describe(notACell)); - print("Here's the result:", result, describe(result)); - throw "Error: bad outcome of accessing f on " + notACell + ": " + result; - } - var result2 = result + 5; - var result3 = notACell + 5; - if ("" + result2 != "NaN") - throw "Error: bad outcome of adding 5 to result: " + result2; - if (result3 != 47) - throw "Error: bad outcome of adding 5 to 42: " + result3; - } -} - diff --git a/implementation-contributed/javascriptcore/stress/throw-from-ftl-call-ic-slow-path-undefined.js b/implementation-contributed/javascriptcore/stress/throw-from-ftl-call-ic-slow-path-undefined.js deleted file mode 100644 index 64c6f3129a..0000000000 --- a/implementation-contributed/javascriptcore/stress/throw-from-ftl-call-ic-slow-path-undefined.js +++ /dev/null @@ -1,192 +0,0 @@ -// Attempts to induce a crash resulting from the FTL emitting code that clobbers the tag registers and then -// throwing an exception without restoring those tag registers' values. - -function ftlFunction(array, callee) { - // Gotta use lots of gprs. - var x0 = array[0]; - var x1 = array[1]; - var x2 = array[2]; - var x3 = array[3]; - var x4 = array[4]; - var x5 = array[5]; - var x6 = array[6]; - var x7 = array[7]; - var x8 = array[8]; - var x9 = array[9]; - var x10 = array[10]; - var x11 = array[11]; - var x12 = array[12]; - var x13 = array[13]; - var x14 = array[14]; - var x15 = array[15]; - var x16 = array[16]; - var x17 = array[17]; - var x18 = array[18]; - var x19 = array[19]; - var x20 = array[20]; - var x21 = array[21]; - var x22 = array[22]; - var x23 = array[23]; - var x24 = array[24]; - var x25 = array[25]; - var x26 = array[26]; - var x27 = array[27]; - var x28 = array[28]; - var x29 = array[29]; - var x30 = array[30]; - var x31 = array[31]; - var x32 = array[32]; - var x33 = array[33]; - var x34 = array[34]; - var x35 = array[35]; - var x36 = array[36]; - var x37 = array[37]; - var x38 = array[38]; - var x39 = array[39]; - var x40 = array[40]; - var x41 = array[41]; - var x42 = array[42]; - var x43 = array[43]; - var x44 = array[44]; - var x45 = array[45]; - var x46 = array[46]; - var x47 = array[47]; - var x48 = array[48]; - var x49 = array[49]; - var x50 = array[50]; - var x51 = array[51]; - var x52 = array[52]; - var x53 = array[53]; - var x54 = array[54]; - var x55 = array[55]; - var x56 = array[56]; - var x57 = array[57]; - var x58 = array[58]; - var x59 = array[59]; - var x60 = array[60]; - var x61 = array[61]; - var x62 = array[62]; - var x63 = array[63]; - - // Make a call that will throw, when we ask it to. - callee("hello"); - - // Use all of those crazy values. - return [x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x60, x61, x62, x63] -} - -noInline(ftlFunction); - -// Create some callees that are too crazy to get inlined or devirtualized, but that don't have effects. - -function happyCallee0() { return 0 }; -function happyCallee1() { return 1 }; -function happyCallee2() { return 2 }; -function happyCallee3() { return 3 }; -function happyCallee4() { return 4 }; -function happyCallee5() { return 5 }; -function happyCallee6() { return 6 }; -function happyCallee7() { return 7 }; -function happyCallee8() { return 8 }; -function happyCallee9() { return 9 }; -function happyCallee10() { return 10 }; -function happyCallee11() { return 11 }; -function happyCallee12() { return 12 }; -function happyCallee13() { return 13 }; -function happyCallee14() { return 14 }; -function happyCallee15() { return 15 }; -function happyCallee16() { return 16 }; -function happyCallee17() { return 17 }; -function happyCallee18() { return 18 }; -function happyCallee19() { return 19 }; -function happyCallee20() { return 20 }; -function happyCallee21() { return 21 }; -function happyCallee22() { return 22 }; -function happyCallee23() { return 23 }; -function happyCallee24() { return 24 }; -function happyCallee25() { return 25 }; -function happyCallee26() { return 26 }; -function happyCallee27() { return 27 }; -function happyCallee28() { return 28 }; -function happyCallee29() { return 29 }; -function happyCallee30() { return 30 }; -function happyCallee31() { return 31 }; -function happyCallee32() { return 32 }; -function happyCallee33() { return 33 }; -function happyCallee34() { return 34 }; -function happyCallee35() { return 35 }; -function happyCallee36() { return 36 }; -function happyCallee37() { return 37 }; -function happyCallee38() { return 38 }; -function happyCallee39() { return 39 }; -function happyCallee40() { return 40 }; -function happyCallee41() { return 41 }; -function happyCallee42() { return 42 }; -function happyCallee43() { return 43 }; -function happyCallee44() { return 44 }; -function happyCallee45() { return 45 }; -function happyCallee46() { return 46 }; -function happyCallee47() { return 47 }; -function happyCallee48() { return 48 }; -function happyCallee49() { return 49 }; -function happyCallee50() { return 50 }; -function happyCallee51() { return 51 }; -function happyCallee52() { return 52 }; -function happyCallee53() { return 53 }; -function happyCallee54() { return 54 }; -function happyCallee55() { return 55 }; -function happyCallee56() { return 56 }; -function happyCallee57() { return 57 }; -function happyCallee58() { return 58 }; -function happyCallee59() { return 59 }; -function happyCallee60() { return 60 }; -function happyCallee61() { return 61 }; -function happyCallee62() { return 62 }; -function happyCallee63() { return 63 }; - -var happyCallees = [happyCallee0, happyCallee1, happyCallee2, happyCallee3, happyCallee4, happyCallee5, happyCallee6, happyCallee7, happyCallee8, happyCallee9, happyCallee10, happyCallee11, happyCallee12, happyCallee13, happyCallee14, happyCallee15, happyCallee16, happyCallee17, happyCallee18, happyCallee19, happyCallee20, happyCallee21, happyCallee22, happyCallee23, happyCallee24, happyCallee25, happyCallee26, happyCallee27, happyCallee28, happyCallee29, happyCallee30, happyCallee31, happyCallee32, happyCallee33, happyCallee34, happyCallee35, happyCallee36, happyCallee37, happyCallee38, happyCallee39, happyCallee40, happyCallee41, happyCallee42, happyCallee43, happyCallee44, happyCallee45, happyCallee46, happyCallee47, happyCallee48, happyCallee49, happyCallee50, happyCallee51, happyCallee52, happyCallee53, happyCallee54, happyCallee55, happyCallee56, happyCallee57, happyCallee58, happyCallee59, happyCallee60, happyCallee61, happyCallee62, happyCallee63]; - -for (var i = 0; i < happyCallees.length; ++i) - noInline(happyCallees[i]); - -// Unlike the other test (throw-from-ftl-call-ic-slow-path.js), we want to populate the registers with undefined -// in this test. -var array = new Array(); -for (var i = 0; i < 64; ++i) - array[i] = void 0; - -// Now, do some warming up. -for (var i = 0; i < 100000; ++i) { - var result = ftlFunction(array, happyCallees[i % happyCallees.length]); - if (result.length != array.length) - throw "Error: bad length: " + result; - for (var j = 0; j < result.length; ++j) { - if (result[j] != array[j]) - throw "Error: bad entry at j = " + j + ": " + result; - } -} - -// Finally, attempt to trigger the bug. -var notACell = 42; -for (var i = 0; i < 100; ++i) { - try { - ftlFunction(array, Int8Array); - } catch (e) { - if (e.message.indexOf("constructor without new is invalid") < 0) - throw "Error: bad exception message: " + e.message; - var result = notACell.f; - if (result !== void 0) { - print("Bad outcome of accessing f on notACell."); - print("Here's notACell:", notACell, describe(notACell)); - print("Here's the result:", result, describe(result)); - throw "Error: bad outcome of accessing f on " + notACell + ": " + result; - } - var result2 = result + 5; - var result3 = notACell + 5; - if ("" + result2 != "NaN") - throw "Error: bad outcome of adding 5 to result: " + result2; - if (result3 != 47) - throw "Error: bad outcome of adding 5 to 42: " + result3; - } -} - diff --git a/implementation-contributed/javascriptcore/stress/throw-from-ftl-call-ic-slow-path.js b/implementation-contributed/javascriptcore/stress/throw-from-ftl-call-ic-slow-path.js deleted file mode 100644 index 259c2528b2..0000000000 --- a/implementation-contributed/javascriptcore/stress/throw-from-ftl-call-ic-slow-path.js +++ /dev/null @@ -1,192 +0,0 @@ -// Attempts to induce a crash resulting from the FTL emitting code that clobbers the tag registers and then -// throwing an exception without restoring those tag registers' values. - -function ftlFunction(array, callee) { - // Gotta use lots of gprs. - var x0 = array[0]; - var x1 = array[1]; - var x2 = array[2]; - var x3 = array[3]; - var x4 = array[4]; - var x5 = array[5]; - var x6 = array[6]; - var x7 = array[7]; - var x8 = array[8]; - var x9 = array[9]; - var x10 = array[10]; - var x11 = array[11]; - var x12 = array[12]; - var x13 = array[13]; - var x14 = array[14]; - var x15 = array[15]; - var x16 = array[16]; - var x17 = array[17]; - var x18 = array[18]; - var x19 = array[19]; - var x20 = array[20]; - var x21 = array[21]; - var x22 = array[22]; - var x23 = array[23]; - var x24 = array[24]; - var x25 = array[25]; - var x26 = array[26]; - var x27 = array[27]; - var x28 = array[28]; - var x29 = array[29]; - var x30 = array[30]; - var x31 = array[31]; - var x32 = array[32]; - var x33 = array[33]; - var x34 = array[34]; - var x35 = array[35]; - var x36 = array[36]; - var x37 = array[37]; - var x38 = array[38]; - var x39 = array[39]; - var x40 = array[40]; - var x41 = array[41]; - var x42 = array[42]; - var x43 = array[43]; - var x44 = array[44]; - var x45 = array[45]; - var x46 = array[46]; - var x47 = array[47]; - var x48 = array[48]; - var x49 = array[49]; - var x50 = array[50]; - var x51 = array[51]; - var x52 = array[52]; - var x53 = array[53]; - var x54 = array[54]; - var x55 = array[55]; - var x56 = array[56]; - var x57 = array[57]; - var x58 = array[58]; - var x59 = array[59]; - var x60 = array[60]; - var x61 = array[61]; - var x62 = array[62]; - var x63 = array[63]; - - // Make a call that will throw, when we ask it to. - callee("hello"); - - // Use all of those crazy values. - return [x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x40, x41, x42, x43, x44, x45, x46, x47, x48, x49, x50, x51, x52, x53, x54, x55, x56, x57, x58, x59, x60, x61, x62, x63] -} - -noInline(ftlFunction); - -// Create some callees that are too crazy to get inlined or devirtualized, but that don't have effects. - -function happyCallee0() { return 0 }; -function happyCallee1() { return 1 }; -function happyCallee2() { return 2 }; -function happyCallee3() { return 3 }; -function happyCallee4() { return 4 }; -function happyCallee5() { return 5 }; -function happyCallee6() { return 6 }; -function happyCallee7() { return 7 }; -function happyCallee8() { return 8 }; -function happyCallee9() { return 9 }; -function happyCallee10() { return 10 }; -function happyCallee11() { return 11 }; -function happyCallee12() { return 12 }; -function happyCallee13() { return 13 }; -function happyCallee14() { return 14 }; -function happyCallee15() { return 15 }; -function happyCallee16() { return 16 }; -function happyCallee17() { return 17 }; -function happyCallee18() { return 18 }; -function happyCallee19() { return 19 }; -function happyCallee20() { return 20 }; -function happyCallee21() { return 21 }; -function happyCallee22() { return 22 }; -function happyCallee23() { return 23 }; -function happyCallee24() { return 24 }; -function happyCallee25() { return 25 }; -function happyCallee26() { return 26 }; -function happyCallee27() { return 27 }; -function happyCallee28() { return 28 }; -function happyCallee29() { return 29 }; -function happyCallee30() { return 30 }; -function happyCallee31() { return 31 }; -function happyCallee32() { return 32 }; -function happyCallee33() { return 33 }; -function happyCallee34() { return 34 }; -function happyCallee35() { return 35 }; -function happyCallee36() { return 36 }; -function happyCallee37() { return 37 }; -function happyCallee38() { return 38 }; -function happyCallee39() { return 39 }; -function happyCallee40() { return 40 }; -function happyCallee41() { return 41 }; -function happyCallee42() { return 42 }; -function happyCallee43() { return 43 }; -function happyCallee44() { return 44 }; -function happyCallee45() { return 45 }; -function happyCallee46() { return 46 }; -function happyCallee47() { return 47 }; -function happyCallee48() { return 48 }; -function happyCallee49() { return 49 }; -function happyCallee50() { return 50 }; -function happyCallee51() { return 51 }; -function happyCallee52() { return 52 }; -function happyCallee53() { return 53 }; -function happyCallee54() { return 54 }; -function happyCallee55() { return 55 }; -function happyCallee56() { return 56 }; -function happyCallee57() { return 57 }; -function happyCallee58() { return 58 }; -function happyCallee59() { return 59 }; -function happyCallee60() { return 60 }; -function happyCallee61() { return 61 }; -function happyCallee62() { return 62 }; -function happyCallee63() { return 63 }; - -var happyCallees = [happyCallee0, happyCallee1, happyCallee2, happyCallee3, happyCallee4, happyCallee5, happyCallee6, happyCallee7, happyCallee8, happyCallee9, happyCallee10, happyCallee11, happyCallee12, happyCallee13, happyCallee14, happyCallee15, happyCallee16, happyCallee17, happyCallee18, happyCallee19, happyCallee20, happyCallee21, happyCallee22, happyCallee23, happyCallee24, happyCallee25, happyCallee26, happyCallee27, happyCallee28, happyCallee29, happyCallee30, happyCallee31, happyCallee32, happyCallee33, happyCallee34, happyCallee35, happyCallee36, happyCallee37, happyCallee38, happyCallee39, happyCallee40, happyCallee41, happyCallee42, happyCallee43, happyCallee44, happyCallee45, happyCallee46, happyCallee47, happyCallee48, happyCallee49, happyCallee50, happyCallee51, happyCallee52, happyCallee53, happyCallee54, happyCallee55, happyCallee56, happyCallee57, happyCallee58, happyCallee59, happyCallee60, happyCallee61, happyCallee62, happyCallee63]; - -for (var i = 0; i < happyCallees.length; ++i) - noInline(happyCallees[i]); - -// We want the input array to have an easy-to-deal-with type that isn't exactly the same as the type that -// ftlFunction will return. -var array = new Int32Array(64); -for (var i = 0; i < array.length; ++i) - array[i] = i; - -// Now, do some warming up. -for (var i = 0; i < 100000; ++i) { - var result = ftlFunction(array, happyCallees[i % happyCallees.length]); - if (result.length != array.length) - throw "Error: bad length: " + result; - for (var j = 0; j < result.length; ++j) { - if (result[j] != array[j]) - throw "Error: bad entry at j = " + j + ": " + result; - } -} - -// Finally, attempt to trigger the bug. -var notACell = 42; -for (var i = 0; i < 100; ++i) { - try { - ftlFunction(array, Int8Array); - } catch (e) { - if (e.message.indexOf("constructor without new is invalid") < 0) - throw "Error: bad exception message: " + e.message; - var result = notACell.f; - if (result !== void 0) { - print("Bad outcome of accessing f on notACell."); - print("Here's notACell:", notACell, describe(notACell)); - print("Here's the result:", result, describe(result)); - throw "Error: bad outcome of accessing f on " + notACell + ": " + result; - } - var result2 = result + 5; - var result3 = notACell + 5; - if ("" + result2 != "NaN") - throw "Error: bad outcome of adding 5 to result: " + result2; - if (result3 != 47) - throw "Error: bad outcome of adding 5 to 42: " + result3; - } -} - diff --git a/implementation-contributed/javascriptcore/stress/throw-from-ftl-in-loop.js b/implementation-contributed/javascriptcore/stress/throw-from-ftl-in-loop.js deleted file mode 100644 index b87cc8e270..0000000000 --- a/implementation-contributed/javascriptcore/stress/throw-from-ftl-in-loop.js +++ /dev/null @@ -1,13 +0,0 @@ -var didThrow = false; -try { - (function() { - for (var i = 0; i < 1000000; ++i) { } - throw 42; - })(); -} catch (e) { - if (e != 42) - throw "Error: bad result: " + e; - didThrow = true; -} -if (!didThrow) - throw "Error: should have thrown but didn't."; diff --git a/implementation-contributed/javascriptcore/stress/throw-from-ftl.js b/implementation-contributed/javascriptcore/stress/throw-from-ftl.js deleted file mode 100644 index aac2e9ea7d..0000000000 --- a/implementation-contributed/javascriptcore/stress/throw-from-ftl.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(p) { - var o = {f:42}; - if (p) - throw o; - return o; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var o = foo(false); - if (o.f != 42) - throw "Error: bad result: " + o.f; -} - -var didThrow = false; -try { - foo(true); -} catch (e) { - if (e.f != 42) - throw "Error: bad result in catch: " + o.f; - didThrow = true; -} -if (!didThrow) - throw "Error: should have thrown but didn't."; diff --git a/implementation-contributed/javascriptcore/stress/throw-through-optimized-code.js b/implementation-contributed/javascriptcore/stress/throw-through-optimized-code.js deleted file mode 100644 index 0feb240ed3..0000000000 --- a/implementation-contributed/javascriptcore/stress/throw-through-optimized-code.js +++ /dev/null @@ -1,30 +0,0 @@ -function foo(f) { - return f(1) + 1; -} - -var shouldThrow = false; -function bar(x) { - if (shouldThrow) - throw "hello"; - return 42 - x; -} - -noInline(foo); -noInline(bar); - -for (var i = 0; i < 100000; ++i) { - var result = foo(bar); - if (result != 42) - throw "Error: bad result: " + result; -} - -var didThrow; -try { - shouldThrow = true; - foo(bar); -} catch (e) { - didThrow = e; -} - -if (didThrow != "hello") - throw "Error: didn't throw or threw wrong exception: " + didThrow; diff --git a/implementation-contributed/javascriptcore/stress/tier-up-in-loop-with-cfg-simplification.js b/implementation-contributed/javascriptcore/stress/tier-up-in-loop-with-cfg-simplification.js deleted file mode 100644 index 874904bc44..0000000000 --- a/implementation-contributed/javascriptcore/stress/tier-up-in-loop-with-cfg-simplification.js +++ /dev/null @@ -1,24 +0,0 @@ -var False = false; - -function foo(p, array) { - var result = 0; - var i = 0; - if (array.length) { - if (p) { - } else { - return; - } - do { - result += array[i++]; - } while (False); - } - return result; -} - -noInline(foo); - -for (var i = 0; i < 1000000; ++i) { - var result = foo(true, [42]); - if (result != 42) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/to-int32-sensible.js b/implementation-contributed/javascriptcore/stress/to-int32-sensible.js deleted file mode 100644 index 4f5a12bbb5..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-int32-sensible.js +++ /dev/null @@ -1,40 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -// ValueToInt32(DoubleRep) -function toInt32(number) -{ - return (number * 0.5) >> 0; -} -noInline(toInt32); -for (var i = 0; i < 1e5; ++i) - toInt32(i * 1.0); - -function test(number) -{ - return toInt32(number * 2); -} - -const INT32_MAX = 2147483647; -const INT32_MIN = -2147483648; - -shouldBe(test(INT32_MAX - 1), INT32_MAX - 1); -shouldBe(test(INT32_MAX - 0.5), INT32_MAX - 1); -shouldBe(test(INT32_MAX), INT32_MAX); -shouldBe(test(INT32_MAX + 0.5), INT32_MAX); -shouldBe(test(INT32_MAX + 1), INT32_MIN); - -shouldBe(test(INT32_MIN - 1), INT32_MAX); -shouldBe(test(INT32_MIN - 0.5), INT32_MIN); -shouldBe(test(INT32_MIN), INT32_MIN); -shouldBe(test(INT32_MIN + 0.5), INT32_MIN + 1); -shouldBe(test(INT32_MIN + 1), INT32_MIN + 1); - -shouldBe(test(Number.EPSILON), 0); -shouldBe(test(Number.NaN), 0); -shouldBe(test(Number.POSITIVE_INFINITY), 0); -shouldBe(test(Number.NEGATIVE_INFINITY), 0); -shouldBe(test(Number.MAX_SAFE_INTEGER), -1); -shouldBe(test(Number.MIN_SAFE_INTEGER), 1); diff --git a/implementation-contributed/javascriptcore/stress/to-int32-sensible2.js b/implementation-contributed/javascriptcore/stress/to-int32-sensible2.js deleted file mode 100644 index bbfe9be7f3..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-int32-sensible2.js +++ /dev/null @@ -1,55 +0,0 @@ -//@ runFTLNoCJIT - -var testCases = [ - { value: -Number.MAX_VALUE, expected: 0 }, - { value: Number.MAX_VALUE, expected: 0 }, - { value: -Number.MIN_VALUE, expected: 0 }, - { value: Number.MIN_VALUE, expected: 0 }, - { value: -Infinity, expected: 0 }, - { value: Infinity, expected: 0 }, - { value: NaN, expected: 0 }, - { value: -NaN, expected: 0 }, - { value: 0, expected: 0 }, - { value: -0, expected: 0 }, - { value: 1, expected: 1 }, - { value: -1, expected: -1 }, - { value: 5, expected: 5 }, - { value: -5, expected: -5 }, - - { value: 0x80000001, expected: -2147483647 }, - { value: 0x80000000, expected: -2147483648 }, - { value: 0x7fffffff, expected: 2147483647 }, - { value: 0x7ffffffe, expected: 2147483646 }, - - { value: -2147483647, expected: -2147483647 }, - { value: -2147483648, expected: -2147483648 }, - { value: -2147483649, expected: 2147483647 }, - { value: -2147483650, expected: 2147483646 }, - - { value: 2147483646, expected: 2147483646 }, - { value: 2147483647, expected: 2147483647 }, - { value: 2147483648, expected: -2147483648 }, - { value: 2147483649, expected: -2147483647 }, -]; - -var numFailures = 0; -for (var i = 0; i < testCases.length; i++) { - try { - var testCase = testCases[i]; - var test = new Function("x", "y", "y = " + i + "; return x|0;"); - noInline(test); - - for (var k = 0; k < 10000; ++k) { - actual = test(testCase.value); - if (actual != testCase.expected) - throw ("FAILED: x|0 where x = " + testCase.value + ": expected " + testCase.expected + ", actual " + actual); - } - } catch (e) { - print(e); - numFailures++; - } -} - -if (numFailures) - throw("Found " + numFailures + " failures"); - diff --git a/implementation-contributed/javascriptcore/stress/to-lower-case-intrinsic-on-empty-rope.js b/implementation-contributed/javascriptcore/stress/to-lower-case-intrinsic-on-empty-rope.js deleted file mode 100644 index 58f31244f6..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-lower-case-intrinsic-on-empty-rope.js +++ /dev/null @@ -1,26 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("bad!"); -} - -function returnRope() { - function helper(r, s) { - // I'm paranoid about RegExp matching constant folding. - return s.match(r)[1]; - } - noInline(helper); - return helper(/(b*)fo/, "fo"); -} -noInline(returnRope); - -function lower(a) { - return a.toLowerCase(); -} -noInline(lower); - -for (let i = 0; i < 10000; i++) { - let rope = returnRope(); - assert(!rope.length); - assert(isRope(rope)); // Keep this test future proofed. If this stops returning a rope, we should try to find another way to return an empty rope. - lower(rope); -} diff --git a/implementation-contributed/javascriptcore/stress/to-lower-case.js b/implementation-contributed/javascriptcore/stress/to-lower-case.js deleted file mode 100644 index 28c4392d76..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-lower-case.js +++ /dev/null @@ -1,30 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion"); -} - -let tests = [ - ["FOO", "foo"], - ["fff\u00C2", "fff\u00E2"], - ["foo", "foo"], - ["foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo", "foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo"], - ["BaR", "bar"], - ["FOO\u00A9", "foo\u00A9"], - ["#$#$", "#$#$"], - ["&&&\u00A9", "&&&\u00A9"], - ["&&&\u00C2", "&&&\u00E2"], - ["ABC\u0100", "abc\u0101"], -]; - -function foo(a) { - return a.toLowerCase(); -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - for (let i = 0; i < tests.length; i++) { - let test = tests[i][0]; - let result = tests[i][1]; - assert(foo(test) === result); - } -} diff --git a/implementation-contributed/javascriptcore/stress/to-number-basics.js b/implementation-contributed/javascriptcore/stress/to-number-basics.js deleted file mode 100644 index 438b21660d..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-number-basics.js +++ /dev/null @@ -1,22 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function test1(value) -{ - return Number(value) <= 42; -} -noInline(test1); - -// Int32. -for (var i = 0; i < 1e4; ++i) - shouldBe(test1(42), true); - -// Doubles. -for (var i = 0; i < 1e4; ++i) - shouldBe(test1(42.195), false); - -// Non numbers. -for (var i = 0; i < 1e4; ++i) - shouldBe(test1("Hello"), false); diff --git a/implementation-contributed/javascriptcore/stress/to-number-convert-identity-without-execution.js b/implementation-contributed/javascriptcore/stress/to-number-convert-identity-without-execution.js deleted file mode 100644 index 1378e470d2..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-number-convert-identity-without-execution.js +++ /dev/null @@ -1,26 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function test(x, y) -{ - if (x) - return Number(y); - return y; -} -noInline(test); - -// Converted to Identity, but since Number is handled by inlining, it emits ForceOSRExit. -// So converted Identity is never executed. -for (var i = 0; i < 1e4; ++i) - shouldBe(test(false, 41), 41); - - -for (var i = 0; i < 1e4; ++i) - shouldBe(test(true, 41), 41); -var object = { valueOf() { return 41; } }; -for (var i = 0; i < 1e4; ++i) - shouldBe(test(true, object), 41); -for (var i = 0; i < 1e4; ++i) - shouldBe(test(true, { valueOf() { return 42.195; } }), 42.195); diff --git a/implementation-contributed/javascriptcore/stress/to-number-int52.js b/implementation-contributed/javascriptcore/stress/to-number-int52.js deleted file mode 100644 index b58ac92b8f..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-number-int52.js +++ /dev/null @@ -1,29 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function test(x) { - var y = x; - var z = y * 2; - if (z) { - z += y; - z += y; - z += y; - } - return Number(z) < 42; -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) - shouldBe(test(1000000000), false); - -// Extend to Doubles. -for (var i = 0; i < 1e4; ++i) - shouldBe(test(42.195), false); - -// Leave ToNumber for objects. -// And this should update the value profiling to accept doubles in ToNumber calls. -var object = { valueOf() { return 42.195; } }; -for (var i = 0; i < 1e4; ++i) - shouldBe(test(object), false); diff --git a/implementation-contributed/javascriptcore/stress/to-number-intrinsic-convert-to-identity-without-execution.js b/implementation-contributed/javascriptcore/stress/to-number-intrinsic-convert-to-identity-without-execution.js deleted file mode 100644 index 5d6007bbc0..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-number-intrinsic-convert-to-identity-without-execution.js +++ /dev/null @@ -1,22 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function test(x, y) -{ - if (x) - return +y; - return y; -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) - shouldBe(test(false, 41), 41); -for (var i = 0; i < 1e4; ++i) - shouldBe(test(true, 41), 41); -var object = { valueOf() { return 41; } }; -for (var i = 0; i < 1e4; ++i) - shouldBe(test(true, object), 41); -for (var i = 0; i < 1e4; ++i) - shouldBe(test(true, { valueOf() { return 42.195; } }), 42.195); diff --git a/implementation-contributed/javascriptcore/stress/to-number-intrinsic-int52.js b/implementation-contributed/javascriptcore/stress/to-number-intrinsic-int52.js deleted file mode 100644 index 1dcbf83fd8..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-number-intrinsic-int52.js +++ /dev/null @@ -1,29 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function test(x) { - var y = x; - var z = y * 2; - if (z) { - z += y; - z += y; - z += y; - } - return isFinite(z); -} -noInline(test); - -for (var i = 0; i < 1e4; ++i) - shouldBe(test(1000000000), true); - -// Extend to Doubles. -for (var i = 0; i < 1e4; ++i) - shouldBe(test(42.195), true); - -// Leave ToNumber for objects. -// And this should update the value profiling to accept doubles in ToNumber calls. -var object = { valueOf() { return 42.195; } }; -for (var i = 0; i < 1e4; ++i) - shouldBe(test(object), true); diff --git a/implementation-contributed/javascriptcore/stress/to-number-intrinsic-object-without-execution.js b/implementation-contributed/javascriptcore/stress/to-number-intrinsic-object-without-execution.js deleted file mode 100644 index 7482bbdc5c..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-number-intrinsic-object-without-execution.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function test(x, y) -{ - if (x) - return +y; - return y; -} -noInline(test); - -var object = { valueOf() { return 41; } }; -for (var i = 0; i < 1e4; ++i) - shouldBe(test(false, object), object); -for (var i = 0; i < 1e4; ++i) - shouldBe(test(true, object), 41); diff --git a/implementation-contributed/javascriptcore/stress/to-number-intrinsic-value-profiling.js b/implementation-contributed/javascriptcore/stress/to-number-intrinsic-value-profiling.js deleted file mode 100644 index 9f6cc04cea..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-number-intrinsic-value-profiling.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function test(x) { - return isFinite(x); -} -noInline(test); - -var object = { valueOf() { return 42; } }; -for (var i = 0; i < 1e4; ++i) - shouldBe(test(object), true); - -// This should update the value profiling to accept doubles in ToNumber calls. -var object = { valueOf() { return 42.195; } }; -for (var i = 0; i < 1e4; ++i) - shouldBe(test(object), true); diff --git a/implementation-contributed/javascriptcore/stress/to-number-object-without-execution.js b/implementation-contributed/javascriptcore/stress/to-number-object-without-execution.js deleted file mode 100644 index 856e0da829..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-number-object-without-execution.js +++ /dev/null @@ -1,20 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function test(x, y) -{ - if (x) - return Number(y); - return y; -} -noInline(test); - -var object = { valueOf() { return 41; } }; -// Since Number is handled by inlining, it emits ForceOSRExit. -for (var i = 0; i < 1e4; ++i) - shouldBe(test(false, object), object); - -for (var i = 0; i < 1e4; ++i) - shouldBe(test(true, object), 41); diff --git a/implementation-contributed/javascriptcore/stress/to-number-object.js b/implementation-contributed/javascriptcore/stress/to-number-object.js deleted file mode 100644 index 689249a4df..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-number-object.js +++ /dev/null @@ -1,70 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function test1(object) -{ - // The prediction should be Int32. - return Number(object); -} -noInline(test1); - -function test12(object) -{ - // Should be Int32 comparison. - return Number(object) <= 42; -} -noInline(test12); - -var object1 = { valueOf() { return 42; } }; -for (var i = 0; i < 1e4; ++i) { - shouldBe(test1(object1), 42); - shouldBe(test12(object1), true); -} - -function test2(object) -{ - // The prediction should be Doubles. - return Number(object); -} -noInline(test2); - -function test22(object) -{ - // Should be Double comparison. - return Number(object) <= 42; -} -noInline(test22); - -var object2 = { valueOf() { return 42.195; } }; -for (var i = 0; i < 1e4; ++i) { - shouldBe(test2(object2), 42.195); - shouldBe(test22(object2), false); -} - -function test3(object) -{ - // The prediction should be Int32, and later it should be Doubles. - return Number(object); -} -noInline(test3); - -function test32(object) -{ - // Should be Int32 comparison. And later, OSR exit occurs with 42.195. And it should be recompiled as Double comparison. - return Number(object) <= 42; -} -noInline(test32); - -var value = 42; -var object3 = { valueOf() { return value; } }; -for (var i = 0; i < 1e4; ++i) { - shouldBe(test3(object3), value); - shouldBe(test32(object3), true); -} -value = 42.195; -for (var i = 0; i < 1e4; ++i) { - shouldBe(test3(object3), value); - shouldBe(test32(object3), false); -} diff --git a/implementation-contributed/javascriptcore/stress/to-number-throws-correct-exception.js b/implementation-contributed/javascriptcore/stress/to-number-throws-correct-exception.js deleted file mode 100644 index 382a730af8..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-number-throws-correct-exception.js +++ /dev/null @@ -1,121 +0,0 @@ -function test(op) { - let test = ` - function runTest(iters) { - let shouldThrow = false; - let a = { - valueOf() { - if (shouldThrow) - throw "a"; - return 0; - } - }; - let {proxy: b, revoke} = Proxy.revocable({}, { - get: function(target, prop) { - if (prop === "valueOf") { - if (shouldThrow) - throw new Error("Should not be here!"); - return function() { - return 0; - } - } - } - }); - function f(a, b) { - return a ${op} b; - } - noInline(f); - for (let i = 0; i < iters; i++) { - f(a, b); - } - - shouldThrow = true; - let validException = false; - let exception = null; - revoke(); - try { - f(a, b); - } catch(e) { - validException = e === "a"; - exception = e; - } - if (!validException) - throw new Error("Bad operation: " + exception.toString() + " with iters: " + iters); - } - runTest(2); - runTest(10); - runTest(50); - runTest(1000); - runTest(10000); - `; - eval(test); -} -let ops = [ - "+" - , "-" - , "*" - , "**" - , "/" - , "%" - , "&" - , "|" - , "^" - , ">>" - , ">>>" - , "<<" -]; -for (let op of ops) - test(op); - -function test2(op) { - function runTest(iters) { - let test = ` - let shouldThrow = false; - let a = { - valueOf() { - if (shouldThrow) - throw "a"; - return 0; - } - }; - let {proxy: b, revoke} = Proxy.revocable({}, { - get: function(target, prop) { - if (prop === "valueOf") { - if (shouldThrow) - throw new Error("Should not be here!"); - return function() { - return 0; - } - } - } - }); - function f(a, b) { - return a ${op} b; - } - noInline(f); - for (let i = 0; i < ${iters}; i++) { - f(a, b); - } - - shouldThrow = true; - let validException = false; - let exception = null; - revoke(); - try { - f(a, b); - } catch(e) { - validException = e === "a"; - exception = e; - } - if (!validException) - throw new Error("Bad operation: " + exception.toString() + " with iters: " + ${iters}); - `; - eval(Math.random() + ";" + test); - } - runTest(2); - runTest(10); - runTest(50); - runTest(1000); - runTest(10000); -} -for (let op of ops) - test2(op); diff --git a/implementation-contributed/javascriptcore/stress/to-number-value-profiling.js b/implementation-contributed/javascriptcore/stress/to-number-value-profiling.js deleted file mode 100644 index ea69fe5cf3..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-number-value-profiling.js +++ /dev/null @@ -1,19 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function test(x) { - return Number(x) < 42; -} -noInline(test); - -var object = { valueOf() { return 42; } }; -for (var i = 0; i < 1e4; ++i) - shouldBe(test(object), false); - -// Leave ToNumber for objects. -// And this should update the value profiling to accept doubles in ToNumber calls. -var object = { valueOf() { return 42.195; } }; -for (var i = 0; i < 1e4; ++i) - shouldBe(test(object), false); diff --git a/implementation-contributed/javascriptcore/stress/to-property-key-correctness.js b/implementation-contributed/javascriptcore/stress/to-property-key-correctness.js deleted file mode 100644 index bab89a2f0d..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-property-key-correctness.js +++ /dev/null @@ -1,130 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion"); -} - -function test(f) { - for (let i = 0; i < 100; i++) - f(); -} - -test(function() { - let error = null; - let handler = { - has: function(theTarget, property) { - assert(error === null); // Make sure we don't call into has more than once. Make sure we throw on the fist error. - error = new Error; - throw error; - } - }; - let proxy = new Proxy({}, handler); - let foo = {}; - - let threw = false; - try { - Object.defineProperty(foo, "foo", proxy); - } catch(e) { - threw = true; - assert(e === error); - } - assert(threw); -}); - -test(function() { - let error = null; - let handler = { - has: function(theTarget, property) { - assert(error === null); // Make sure we don't call into has more than once. Make sure we throw on the fist error. - if (property === "set") { - error = new Error; - throw error; - } - return Reflect.has(theTarget, property); - } - }; - let proxy = new Proxy({}, handler); - let foo = {}; - - let threw = false; - try { - Object.defineProperty(foo, "foo", proxy); - } catch(e) { - threw = true; - assert(e === error); - } - assert(threw); -}); - -function arrayEq(a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) { - if (a[i] !== b[i]) - return false; - } - return true; - -} -test(function() { - let error = null; - let hasArray = []; - let getArray = []; - let handler = { - has: function(theTarget, property) { - hasArray.push(property); - return Reflect.has(theTarget, property); - }, - get: function(theTarget, property, receiver) { - getArray.push(property); - return Reflect.get(theTarget, property, receiver); - } - }; - - let target = { - enumerable: true, - configurable: true, - value: 45 - }; - let proxy = new Proxy(target, handler); - let foo = {}; - Object.defineProperty(foo, "foo", proxy); - assert(arrayEq(hasArray, ["enumerable", "configurable", "value", "writable", "get", "set"])); - assert(arrayEq(getArray, ["enumerable", "configurable", "value"])); - assert(foo.foo === 45); -}); - -test(function() { - let error = null; - let hasArray = []; - let getArray = []; - let handler = { - has: function(theTarget, property) { - hasArray.push(property); - return Reflect.has(theTarget, property); - }, - get: function(theTarget, property, receiver) { - getArray.push(property); - return Reflect.get(theTarget, property, receiver); - } - }; - - let target = { - enumerable: true, - configurable: true, - value: 45, - writable: true, - get: function(){}, - set: function(){} - }; - let proxy = new Proxy(target, handler); - let foo = {}; - let threw = false; - try { - Object.defineProperty(foo, "foo", proxy); - } catch(e) { - threw = true; - } - assert(threw); - assert(arrayEq(hasArray, ["enumerable", "configurable", "value", "writable", "get", "set"])); - assert(arrayEq(hasArray, getArray)); -}); diff --git a/implementation-contributed/javascriptcore/stress/to-string-int32.js b/implementation-contributed/javascriptcore/stress/to-string-int32.js deleted file mode 100644 index 5279fe5c6d..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-string-int32.js +++ /dev/null @@ -1,59 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error(`bad value: expected:(${expected}),actual:(${actual})`); -} - -function toString(value, radix) -{ - return value.toString(radix); -} -noInline(toString); - -function toString10(value) -{ - return `${value}`; -} -noInline(toString10); - -function expected(num, radix) -{ - let characters = "0123456789abcdefghijklmnopqrstuvwxyz"; - let result = ""; - let negative = false; - if (num < 0) { - negative = true; - num = -num; - } - - do { - const index = num % radix; - result = characters[index] + result; - num = (num - index) / radix; - } while (num); - - if (negative) - return '-' + result; - return result; -} - -for (var i = 0; i < 1e4; ++i) { - toString(i, 10); - toString(i, 36); - toString10(i); -} - -for (var radix = 2; radix < 37; ++radix) { - for (var lessThanRadix = -2000; lessThanRadix < radix; ++lessThanRadix) - shouldBe(toString(lessThanRadix, radix), expected(lessThanRadix, radix)); - for (var greaterThanRadix = radix; greaterThanRadix < 2000; ++greaterThanRadix) - shouldBe(toString(greaterThanRadix, radix), expected(greaterThanRadix, radix)); -} - -{ - var radix = 10; - for (var lessThanRadix = -2000; lessThanRadix < radix; ++lessThanRadix) - shouldBe(toString10(lessThanRadix), expected(lessThanRadix, radix)); - for (var greaterThanRadix = radix; greaterThanRadix < 2000; ++greaterThanRadix) - shouldBe(toString10(greaterThanRadix), expected(greaterThanRadix, radix)); -} diff --git a/implementation-contributed/javascriptcore/stress/to-string-int52.js b/implementation-contributed/javascriptcore/stress/to-string-int52.js deleted file mode 100644 index e1f323f765..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-string-int52.js +++ /dev/null @@ -1,59 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error(`bad value: expected:(${expected}),actual:(${actual})`); -} - -function toString(value, radix) -{ - return fiatInt52(value).toString(radix); -} -noInline(toString); - -function toString10(value) -{ - return `${fiatInt52(value)}`; -} -noInline(toString10); - -function expected(num, radix) -{ - let characters = "0123456789abcdefghijklmnopqrstuvwxyz"; - let result = ""; - let negative = false; - if (num < 0) { - negative = true; - num = -num; - } - - do { - const index = num % radix; - result = characters[index] + result; - num = (num - index) / radix; - } while (num); - - if (negative) - return '-' + result; - return result; -} - -for (var i = 0; i < 1e4; ++i) { - toString(i, 10); - toString(i, 36); - toString10(i); -} - -for (var radix = 2; radix < 37; ++radix) { - for (var lessThanRadix = -2000; lessThanRadix < radix; ++lessThanRadix) - shouldBe(toString(lessThanRadix, radix), expected(lessThanRadix, radix)); - for (var greaterThanRadix = radix; greaterThanRadix < 2000; ++greaterThanRadix) - shouldBe(toString(greaterThanRadix, radix), expected(greaterThanRadix, radix)); -} - -{ - var radix = 10; - for (var lessThanRadix = -2000; lessThanRadix < radix; ++lessThanRadix) - shouldBe(toString10(lessThanRadix), expected(lessThanRadix, radix)); - for (var greaterThanRadix = radix; greaterThanRadix < 2000; ++greaterThanRadix) - shouldBe(toString10(greaterThanRadix), expected(greaterThanRadix, radix)); -} diff --git a/implementation-contributed/javascriptcore/stress/to-string-non-cell-use.js b/implementation-contributed/javascriptcore/stress/to-string-non-cell-use.js deleted file mode 100644 index 573cd567c6..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-string-non-cell-use.js +++ /dev/null @@ -1,43 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function shouldThrow(func, errorMessage) -{ - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -function toString(value) -{ - return `${value}`; -} -noInline(toString); - -for (var i = 0; i < 1e4; ++i) { - shouldBe(toString(i), i + ""); - shouldBe(toString(null), "null"); - shouldBe(toString(undefined), "undefined"); - shouldBe(toString(10.5), "10.5"); - shouldBe(toString(-10.5), "-10.5"); - shouldBe(toString(true), "true"); - shouldBe(toString(false), "false"); - shouldBe(toString(0 / 0), "NaN"); -} - -shouldBe(toString("HELLO"), "HELLO"); -shouldThrow(() => { - toString(Symbol("Cocoa")); -}, `TypeError: Cannot convert a symbol to a string`); diff --git a/implementation-contributed/javascriptcore/stress/to-string-on-object-or-string.js b/implementation-contributed/javascriptcore/stress/to-string-on-object-or-string.js deleted file mode 100644 index 43638c14cf..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-string-on-object-or-string.js +++ /dev/null @@ -1,27 +0,0 @@ -function Foo() { } - -Foo.prototype.toString = function() { return "hello" }; - -function foo(o) { - return String(o); -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(new Foo()); - if (typeof result != "string") { - describe(result); - throw "Error: result isn't a string"; - } - if (result != "hello") - throw "Error: bad result: " + result; - - result = foo("world"); - if (typeof result != "string") { - describe(result); - throw "Error: result isn't a string"; - } - if (result != "world") - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/to-string-on-object.js b/implementation-contributed/javascriptcore/stress/to-string-on-object.js deleted file mode 100644 index 60a89a4c43..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-string-on-object.js +++ /dev/null @@ -1,19 +0,0 @@ -function Foo() { } - -Foo.prototype.toString = function() { return "hello" }; - -function foo(o) { - return String(o); -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(new Foo()); - if (typeof result != "string") { - describe(result); - throw "Error: result isn't a string"; - } - if (result != "hello") - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/to-string-on-string-object.js b/implementation-contributed/javascriptcore/stress/to-string-on-string-object.js deleted file mode 100644 index e4435e5aac..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-string-on-string-object.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo(o) { - return String(o); -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(new String("hello")); - if (typeof result != "string") { - describe(result); - throw "Error: result isn't a string"; - } - if (result != "hello") - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/to-string-on-string-or-string-object-then-object.js b/implementation-contributed/javascriptcore/stress/to-string-on-string-or-string-object-then-object.js deleted file mode 100644 index 8eb040b78a..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-string-on-string-or-string-object-then-object.js +++ /dev/null @@ -1,35 +0,0 @@ -function foo(o) { - return String(o); -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(new String("hello")); - if (typeof result != "string") { - describe(result); - throw "Error: result isn't a string"; - } - if (result != "hello") - throw "Error: bad result: " + result; - - result = foo("world"); - if (typeof result != "string") { - describe(result); - throw "Error: result isn't a string"; - } - if (result != "world") - throw "Error: bad result: " + result; -} - -function Foo() { } - -Foo.prototype.toString = function() { return "hello" }; - -var result = foo(new Foo()); -if (typeof result != "string") { - describe(result); - throw "Error: result isn't a string"; -} -if (result != "hello") - throw "Error: bad result: " + result; diff --git a/implementation-contributed/javascriptcore/stress/to-string-on-string-or-string-object.js b/implementation-contributed/javascriptcore/stress/to-string-on-string-or-string-object.js deleted file mode 100644 index 5a5de96f47..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-string-on-string-or-string-object.js +++ /dev/null @@ -1,23 +0,0 @@ -function foo(o) { - return String(o); -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(new String("hello")); - if (typeof result != "string") { - describe(result); - throw "Error: result isn't a string"; - } - if (result != "hello") - throw "Error: bad result: " + result; - - result = foo("world"); - if (typeof result != "string") { - describe(result); - throw "Error: result isn't a string"; - } - if (result != "world") - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/to-string-on-value-or-string.js b/implementation-contributed/javascriptcore/stress/to-string-on-value-or-string.js deleted file mode 100644 index 8ced6c083a..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-string-on-value-or-string.js +++ /dev/null @@ -1,23 +0,0 @@ -function foo(o) { - return String(o); -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(42); - if (typeof result != "string") { - describe(result); - throw "Error: result isn't a string"; - } - if (result != "42") - throw "Error: bad result: " + result; - - result = foo("world"); - if (typeof result != "string") { - describe(result); - throw "Error: result isn't a string"; - } - if (result != "world") - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/to-string-on-value.js b/implementation-contributed/javascriptcore/stress/to-string-on-value.js deleted file mode 100644 index 408e5ba4c9..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-string-on-value.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo(o) { - return String(o); -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(42); - if (typeof result != "string") { - describe(result); - throw "Error: result isn't a string"; - } - if (result != "42") - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/to-string-with-int52.js b/implementation-contributed/javascriptcore/stress/to-string-with-int52.js deleted file mode 100644 index c7fe985612..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-string-with-int52.js +++ /dev/null @@ -1,15 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -shouldBe((0xfffffffffff).toString(16), `fffffffffff`); -shouldBe((-0xfffffffffff).toString(16), `-fffffffffff`); -shouldBe((0xfffffffffff000).toString(16), `fffffffffff000`); -shouldBe((-0xfffffffffff000).toString(16), `-fffffffffff000`); - -shouldBe((0x8000000000000).toString(16), `8000000000000`); -shouldBe((-0x8000000000000).toString(16), `-8000000000000`); -shouldBe((0x8000000000000 - 1).toString(16), `7ffffffffffff`); -shouldBe((-0x8000000000000 + 1).toString(16), `-7ffffffffffff`); diff --git a/implementation-contributed/javascriptcore/stress/to-this-before-arrow-function-closes-over-this-that-starts-as-lexical-environment.js b/implementation-contributed/javascriptcore/stress/to-this-before-arrow-function-closes-over-this-that-starts-as-lexical-environment.js deleted file mode 100644 index d549a8a847..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-this-before-arrow-function-closes-over-this-that-starts-as-lexical-environment.js +++ /dev/null @@ -1,58 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad assertion!") -} - -function obj() { - return {}; -} -noInline(obj); - -// This test makes sure that when wrapper() is called with the closure created in foo() as |this| -// that we to_this the |this| that is a closure before the arrow function captures its value. -// This crashes if there is a bug in debug builds. - -const globalThis = this; -function foo() { - function capture() { return wrapper; } - function wrapper() { - let x = () => { - // This should not defineProperty on a JSLexicalEnvironment! That's a huge bug. - Object.defineProperty(this, "foo", { - get: function() { }, - set: function() { } - }); - assert(!("bar" in this)); - assert(this === globalThis); - } - - x(); - } - wrapper(); -} -foo(); - - -function foo2() { - function capture() { return wrapper; } - function wrapper() { - let x = () => { - // This should not defineProperty on a JSLexicalEnvironment! That's a huge bug. - Object.defineProperty(this, "foo", { - get: function() { }, - set: function() { } - }); - } - - x(); - - function bar() { - with (obj()) { - assert; - } - } - bar(); - } - wrapper(); -} -foo2(); diff --git a/implementation-contributed/javascriptcore/stress/to-this-boolean.js b/implementation-contributed/javascriptcore/stress/to-this-boolean.js deleted file mode 100644 index e5b3b76beb..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-this-boolean.js +++ /dev/null @@ -1,22 +0,0 @@ -Boolean.prototype.negate = function () -{ - "use strict"; - return !this; -}; -noInline(Boolean.prototype.negate); - -for (var i = 0; i < 1e4; ++i) - (i % 4 === 0).negate(); -Boolean.prototype.negate.call(true); - -for (var i = 0; i < 1e4; ++i) - Boolean.prototype.negate.call(i); - -Boolean.prototype.negate2 = function () -{ - "use strict"; - return !this; -}; - -for (var i = 0; i < 1e4; ++i) - (true).negate2(); diff --git a/implementation-contributed/javascriptcore/stress/to-this-double.js b/implementation-contributed/javascriptcore/stress/to-this-double.js deleted file mode 100644 index 34b1728613..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-this-double.js +++ /dev/null @@ -1,8 +0,0 @@ -Number.prototype.negate = function () -{ - "use strict"; - return -this; -}; - -for (var i = 1; i < 1e4; ++i) - (4.24242).negate(); diff --git a/implementation-contributed/javascriptcore/stress/to-this-global-object.js b/implementation-contributed/javascriptcore/stress/to-this-global-object.js deleted file mode 100644 index d449de0068..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-this-global-object.js +++ /dev/null @@ -1,25 +0,0 @@ -function test() { - return this.f; -} -noInline(test); - -function test2() { - "use strict"; - return this.f; -} -noInline(test2); - -f = 42; - -let get = eval; -let global = get("this"); - -for (var i = 0; i < 10000; ++i) { - let result = test.call(global); - if (result !== 42) - throw new Error("bad this value: " + result); - - result = test2.call(global); - if (result !== 42) - throw new Error("bad this value: " + result); -} diff --git a/implementation-contributed/javascriptcore/stress/to-this-int32.js b/implementation-contributed/javascriptcore/stress/to-this-int32.js deleted file mode 100644 index 7cf0c2ad93..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-this-int32.js +++ /dev/null @@ -1,8 +0,0 @@ -Number.prototype.negate = function () -{ - "use strict"; - return -this; -}; - -for (var i = 1; i < 1e4; ++i) - (0x424242).negate(); diff --git a/implementation-contributed/javascriptcore/stress/to-this-int52.js b/implementation-contributed/javascriptcore/stress/to-this-int52.js deleted file mode 100644 index 145f7a9d95..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-this-int52.js +++ /dev/null @@ -1,8 +0,0 @@ -Number.prototype.negate = function () -{ - "use strict"; - return -this; -}; - -for (var i = 1; i < 1e4; ++i) - (0xfffffff * 100000).negate(); diff --git a/implementation-contributed/javascriptcore/stress/to-this-number.js b/implementation-contributed/javascriptcore/stress/to-this-number.js deleted file mode 100644 index 2f13a9fcfa..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-this-number.js +++ /dev/null @@ -1,20 +0,0 @@ -Number.prototype.negate = function () -{ - "use strict"; - return -this; -}; -noInline(Number.prototype.negate); - -for (var i = 0; i < 1e4; ++i) - (i % 3 === 0 ? -i : i).negate(); - -for (var i = 0; i < 1e4; ++i) - ((i % 3 === 0 ? -i : i) * 0.2).negate(); - -for (var i = 0; i < 1e4; ++i) - ((i % 3 === 0 ? -i : i) * 1000000).negate(); - -Number.prototype.negate.call(-20000); - -for (var i = 0; i < 1e4; ++i) - Number.prototype.negate.call(i % 2 === 0); diff --git a/implementation-contributed/javascriptcore/stress/to-this-numbers.js b/implementation-contributed/javascriptcore/stress/to-this-numbers.js deleted file mode 100644 index 17b148ec0d..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-this-numbers.js +++ /dev/null @@ -1,19 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} -noInline(shouldBe); - -Number.prototype.toThis = function toThis() -{ - 'use strict'; - return this; -}; -noInline(Number.prototype.toThis); - -for (var i = 0; i < 1e4; ++i) { - shouldBe((0.1).toThis(), 0.1); - shouldBe((42).toThis(), 42); - shouldBe((1024 * 1024 * 1024 * 1024).toThis(), (1024 * 1024 * 1024 * 1024)); -} diff --git a/implementation-contributed/javascriptcore/stress/to-this-on-constant-lexical-environment.js b/implementation-contributed/javascriptcore/stress/to-this-on-constant-lexical-environment.js deleted file mode 100644 index ddf863583c..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-this-on-constant-lexical-environment.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -function foo() { - function bar(i) { - return this; - } - function inner() { - let result; - for (let i = 0; i < 1000000; i++) - result = bar(i); - return result; - } - noInline(inner); - return inner(); -} - -let result = foo(); -if (result !== undefined) - throw new Error("Bad result"); diff --git a/implementation-contributed/javascriptcore/stress/to-this-polymorphic.js b/implementation-contributed/javascriptcore/stress/to-this-polymorphic.js deleted file mode 100644 index 5e8972d5f6..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-this-polymorphic.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo() { - return this.f; -} - -noInline(foo); - -String.prototype.f = 43; -String.prototype.g = foo; -Number.prototype.f = 78; -Number.prototype.g = foo; - -for (var i = 0; i < 100000; ++i) { - var o = {f:foo}; - var result = o.f(); - if (result != foo) - throw "Error: bad object result: " + result; - o = "hello"; - result = o.g(); - if (result != 43) - throw "Error: bad string result: " + result; - o = 42; - result = o.g(); - if (result != 78) - throw "Error: bad number result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/to-this-string.js b/implementation-contributed/javascriptcore/stress/to-this-string.js deleted file mode 100644 index 0d4f9b1c81..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-this-string.js +++ /dev/null @@ -1,27 +0,0 @@ -String.prototype.prefix = function (string) -{ - "use strict"; - // ToThis should be converted to Identity. - return string + this; -}; -noInline(String.prototype.prefix); - -String.prototype.first = function (string) -{ - return this.second(string); -}; - -String.prototype.second = function (string) -{ - // Duplicate ToThis(in first) should be converted to Identity. - return this + string; -}; -noInline(String.prototype.first); - - -for (var i = 0; i < 1e4; ++i) - String(i).prefix("Hello"); - - -for (var i = 0; i < 1e4; ++i) - String(i).first("Hello"); diff --git a/implementation-contributed/javascriptcore/stress/to-this-symbol.js b/implementation-contributed/javascriptcore/stress/to-this-symbol.js deleted file mode 100644 index e4520abcc4..0000000000 --- a/implementation-contributed/javascriptcore/stress/to-this-symbol.js +++ /dev/null @@ -1,18 +0,0 @@ -Symbol.prototype.identity = function () -{ - "use strict"; - return this; -}; -noInline(Symbol.prototype.identity); - -Symbol.prototype.identity2 = function () -{ - "use strict"; - return this; -}; - -for (var i = 1; i < 1e4; ++i) - Symbol.prototype.identity.call(Symbol(i)); - -for (var i = 1; i < 1e4; ++i) - Symbol.prototype.identity2.call(Symbol(i)); diff --git a/implementation-contributed/javascriptcore/stress/toprimitive-speculated-types.js b/implementation-contributed/javascriptcore/stress/toprimitive-speculated-types.js deleted file mode 100644 index 3a18a19141..0000000000 --- a/implementation-contributed/javascriptcore/stress/toprimitive-speculated-types.js +++ /dev/null @@ -1,27 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + JSON.stringify(actual)); -} - -function raw(array) { - var result = ''; - for (var i = 0; i < array.length; ++i) { - result += array[i]; - } - return result; -} - -function Counter() { - return { - count: 0, - toString() { - // Return a number even if the "toString" method. - return this.count++; - } - }; -} - -for (var i = 0; i < 10000; ++i) { - var c = Counter(); - shouldBe(raw([c, c]), "01"); -} diff --git a/implementation-contributed/javascriptcore/stress/trailing-comma-in-function-parameters.js b/implementation-contributed/javascriptcore/stress/trailing-comma-in-function-parameters.js deleted file mode 100644 index 7da381fe45..0000000000 --- a/implementation-contributed/javascriptcore/stress/trailing-comma-in-function-parameters.js +++ /dev/null @@ -1,63 +0,0 @@ -function test(result, expected, message) { - if (result !== expected) - throw "Error: " + message + ". was: " + result + " wanted: " + expected; -} - -function evalWithThrow(text) { - var result; - try { - result = eval(text); - } catch (error) { - return error.toString(); - } - return result; -} - -test(evalWithThrow('typeof function(,){ return a; }'), 'SyntaxError: Unexpected token \',\'. Expected a parameter pattern or a \')\' in parameter list.'); -test(evalWithThrow('typeof function(a,,){ return a; }'), 'SyntaxError: Unexpected token \',\'. Expected a parameter pattern or a \')\' in parameter list.'); -test(evalWithThrow('function a(a, ...last,){ return; }'), 'SyntaxError: Unexpected token \',\'. Rest parameter should be the last parameter in a function declaration.'); -test(eval('typeof function(a,){ return a; }'), 'function'); -test(eval('typeof function(a, b,){ return a + b; }'), 'function'); -test(eval('typeof function(a, b, c, ){ return a + b + c; }'), 'function'); - -test(evalWithThrow('typeof ((,)=>{ return a; })'), 'SyntaxError: Unexpected token \',\''); -test(evalWithThrow('typeof ((a,,)=>{ return a; })'), 'SyntaxError: Unexpected token \',\''); -test(evalWithThrow('typeof ((a, ...last,)=>{ return a; })'), 'SyntaxError: Unexpected token \'...\''); -test(eval('typeof ((a,)=>{ return a; })'), 'function'); -test(eval('typeof ((a, b,)=>{ return a + b; })'), 'function'); -test(eval('typeof ((a, b, c)=>{ return a + b + c; })'), 'function'); - -test(evalWithThrow('typeof ((,)=>a)'), 'SyntaxError: Unexpected token \',\''); -test(evalWithThrow('typeof ((a,,)=>a)'), 'SyntaxError: Unexpected token \',\''); -test(evalWithThrow('(a,...last,)=>0;'), 'SyntaxError: Unexpected token \'...\''); -test(eval('typeof ((a,)=>a)'), 'function'); -test(eval('typeof ((a, b,)=>a + b)'), 'function'); -test(eval('typeof ((a, b, c)=>a + b + c)'), 'function'); - -test(evalWithThrow('typeof ((,)=>a)'), 'SyntaxError: Unexpected token \',\''); -test(evalWithThrow('typeof ((a,,)=>a)'), 'SyntaxError: Unexpected token \',\''); -test(evalWithThrow('(a,...last,)=>0;'), 'SyntaxError: Unexpected token \'...\''); -test(eval('typeof ((a,)=>a)'), 'function'); -test(eval('typeof ((a, b,)=>a + b)'), 'function'); -test(eval('typeof ((a, b, c)=>a + b + c)'), 'function'); - -test(evalWithThrow('typeof function(a = "x0",,){ return a; }'), 'SyntaxError: Unexpected token \',\'. Expected a parameter pattern or a \')\' in parameter list.'); -test(evalWithThrow('typeof function(a = "x0",...last,){ return a; }'), 'SyntaxError: Unexpected token \',\'. Rest parameter should be the last parameter in a function declaration.'); -test(eval('typeof function(a = "x0",){ return a; }'), 'function'); -test(eval('typeof function(a = "x1", b = "y1",){ return a + b; }'), 'function'); -test(eval('typeof function(a = "x2", b = "y2", c = "z3"){ return a + b + c; }'), 'function'); - -test(evalWithThrow('(function(a){ return a; })(,)'), 'SyntaxError: Unexpected token \',\''); -test(evalWithThrow('(function(a){ return a; })("A",,)'), 'SyntaxError: Unexpected token \',\''); -test(eval('(function(a){ return a; })("A",)'), 'A'); -test(eval('(function(a, b,){ return a + b; })("A", "B",)'), 'AB'); -test(eval('(function(a, b, c){ return a + b + c; })("A", "B", "C",)'), 'ABC'); - -test(eval('(function(a){ return arguments.length; })("A",)'), 1); -test(eval('(function(a, b,){ return arguments.length; })("A", "B",)'), 2); -test(eval('(function(a, b, c){ return arguments.length; })("A", "B", "C",)'), 3); -test(eval('(function(a,) { }).length'), 1); -test(eval('(function(a, b, ) { }).length'), 2); -test(eval('(function(a, b, c, ) { }).length'), 3); - - diff --git a/implementation-contributed/javascriptcore/stress/trailing-comma-in-patterns.js b/implementation-contributed/javascriptcore/stress/trailing-comma-in-patterns.js deleted file mode 100644 index 7353e90c2d..0000000000 --- a/implementation-contributed/javascriptcore/stress/trailing-comma-in-patterns.js +++ /dev/null @@ -1,157 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function iterator(array) { - var nextCount = 0; - var returnCount = 0; - var original = array.values(); - return { - [Symbol.iterator]() { - return this; - }, - - next() { - ++nextCount; - return original.next(); - }, - - return() { - ++returnCount; - return { done: true }; - }, - - reportNext() { - return nextCount; - }, - - reportReturn() { - return returnCount; - } - }; -}; - -(function () { - var iter = iterator([1, 2, 3]); - var [] = iter; - shouldBe(iter.reportNext(), 0); - shouldBe(iter.reportReturn(), 1); -}()); - -(function () { - var iter = iterator([1, 2, 3]); - var [,] = iter; - shouldBe(iter.reportNext(), 1); - shouldBe(iter.reportReturn(), 1); -}()); - -(function () { - var iter = iterator([1, 2, 3]); - var [,,] = iter; - shouldBe(iter.reportNext(), 2); - shouldBe(iter.reportReturn(), 1); -}()); - -(function () { - var iter = iterator([1, 2, 3]); - var [,,,] = iter; - shouldBe(iter.reportNext(), 3); - shouldBe(iter.reportReturn(), 1); -}()); - -(function () { - var iter = iterator([1, 2, 3]); - var [,,,,] = iter; - shouldBe(iter.reportNext(), 4); - shouldBe(iter.reportReturn(), 0); -}()); - -(function () { - var iter = iterator([1, 2, 3]); - var [,,,,,] = iter; - shouldBe(iter.reportNext(), 4); - shouldBe(iter.reportReturn(), 0); -}()); - -(function () { - var iter = iterator([1, 2, 3]); - var [,a,] = iter; - shouldBe(iter.reportNext(), 2); - shouldBe(iter.reportReturn(), 1); - shouldBe(a, 2); -}()); - -(function () { - var iter = iterator([1, 2, 3]); - var [a,] = iter; - shouldBe(iter.reportNext(), 1); - shouldBe(iter.reportReturn(), 1); - shouldBe(a, 1); -}()); - -(function () { - var iter = iterator([1, 2, 3]); - var [a,,] = iter; - shouldBe(iter.reportNext(), 2); - shouldBe(iter.reportReturn(), 1); - shouldBe(a, 1); -}()); - -(function () { - var iter = iterator([1, 2, 3]); - var [a,b = 42,] = iter; - shouldBe(iter.reportNext(), 2); - shouldBe(iter.reportReturn(), 1); - shouldBe(a, 1); - shouldBe(b, 2); -}()); - -(function () { - var {} = { Cocoa: 15, Cappuccino: 13 }; -}()); - -(function () { - var {Cocoa,} = { Cocoa: 15, Cappuccino: 13 }; - shouldBe(Cocoa, 15); -}()); - -(function () { - var {Cocoa = 'Cocoa',} = { Cocoa: 15, Cappuccino: 13 }; - shouldBe(Cocoa, 15); -}()); - -(function () { - var {Cocoa, Kilimanjaro = 'Coffee'} = { Cocoa: 15, Cappuccino: 13 }; - shouldBe(Cocoa, 15); - shouldBe(Kilimanjaro, 'Coffee'); -}()); - -(function () { - var {Cocoa, Kilimanjaro = 'Coffee'} = {}; - shouldBe(Cocoa, undefined); - shouldBe(Kilimanjaro, 'Coffee'); -}()); - -(function () { - var {Cocoa, Kilimanjaro = 'Coffee',} = { Cocoa: 15, Cappuccino: 13 }; - shouldBe(Cocoa, 15); - shouldBe(Kilimanjaro, 'Coffee'); -}()); - -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -testSyntaxError(String.raw`var {,} = {Cocoa: 15}`, String.raw`SyntaxError: Unexpected token ','. Expected a property name.`); -testSyntaxError(String.raw`var {,} = {}`, String.raw`SyntaxError: Unexpected token ','. Expected a property name.`); diff --git a/implementation-contributed/javascriptcore/stress/tricky-indirectly-inferred-infinite-loop-that-uses-captured-variables-and-creates-the-activation-outside-the-loop.js b/implementation-contributed/javascriptcore/stress/tricky-indirectly-inferred-infinite-loop-that-uses-captured-variables-and-creates-the-activation-outside-the-loop.js deleted file mode 100644 index 4b526a1580..0000000000 --- a/implementation-contributed/javascriptcore/stress/tricky-indirectly-inferred-infinite-loop-that-uses-captured-variables-and-creates-the-activation-outside-the-loop.js +++ /dev/null @@ -1,36 +0,0 @@ -var count = 0; - -function bar(f) { - if (++count < 10) - return; - count = 0; - throw f; -} - -noInline(bar); - -function fuzz(a) { - return a != true; -} - -function foo(a) { - var x = a + 1; - var y = a + 2; - var f = (function() { return x; }); - while (fuzz(y)) { - bar(f); - } -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - try { - foo(i); - } catch (f) { - var result = f(); - if (result != i + 1) - throw "Error: bad result for i = " + i + ": " + result; - } -} - diff --git a/implementation-contributed/javascriptcore/stress/tricky-inferred-infinite-loop-that-uses-captured-variables-and-creates-the-activation-outside-the-loop.js b/implementation-contributed/javascriptcore/stress/tricky-inferred-infinite-loop-that-uses-captured-variables-and-creates-the-activation-outside-the-loop.js deleted file mode 100644 index f69d064043..0000000000 --- a/implementation-contributed/javascriptcore/stress/tricky-inferred-infinite-loop-that-uses-captured-variables-and-creates-the-activation-outside-the-loop.js +++ /dev/null @@ -1,33 +0,0 @@ -var count = 0; - -function bar(f) { - if (++count < 10) - return; - count = 0; - throw f; -} - -noInline(bar); - -var shouldContinue = true; - -function foo(a) { - var x = a + 1; - var f = (function() { return x; }); - while (shouldContinue) { - bar(f); - } -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - try { - foo(i); - } catch (f) { - var result = f(); - if (result != i + 1) - throw "Error: bad result for i = " + i + ": " + result; - } -} - diff --git a/implementation-contributed/javascriptcore/stress/tricky-infinite-loop-that-uses-captured-variables-and-creates-the-activation-outside-the-loop.js b/implementation-contributed/javascriptcore/stress/tricky-infinite-loop-that-uses-captured-variables-and-creates-the-activation-outside-the-loop.js deleted file mode 100644 index 5b481e5c37..0000000000 --- a/implementation-contributed/javascriptcore/stress/tricky-infinite-loop-that-uses-captured-variables-and-creates-the-activation-outside-the-loop.js +++ /dev/null @@ -1,31 +0,0 @@ -var count = 0; - -function bar(f) { - if (++count < 10) - return; - count = 0; - throw f; -} - -noInline(bar); - -function foo(a) { - var x = a + 1; - var f = (function() { return x; }); - for (;;) { - bar(f); - } -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - try { - foo(i); - } catch (f) { - var result = f(); - if (result != i + 1) - throw "Error: bad result for i = " + i + ": " + result; - } -} - diff --git a/implementation-contributed/javascriptcore/stress/tricky-infinite-loop-that-uses-captured-variables.js b/implementation-contributed/javascriptcore/stress/tricky-infinite-loop-that-uses-captured-variables.js deleted file mode 100644 index 3f79f07fec..0000000000 --- a/implementation-contributed/javascriptcore/stress/tricky-infinite-loop-that-uses-captured-variables.js +++ /dev/null @@ -1,30 +0,0 @@ -var count = 0; - -function bar(f) { - if (++count < 10) - return; - count = 0; - throw f; -} - -noInline(bar); - -function foo(a) { - var x = a + 1; - for (;;) { - bar(function() { return x; }); - } -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - try { - foo(i); - } catch (f) { - var result = f(); - if (result != i + 1) - throw "Error: bad result for i = " + i + ": " + result; - } -} - diff --git a/implementation-contributed/javascriptcore/stress/trim.js b/implementation-contributed/javascriptcore/stress/trim.js deleted file mode 100644 index 2b1d1fd516..0000000000 --- a/implementation-contributed/javascriptcore/stress/trim.js +++ /dev/null @@ -1,53 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function startTest(string, expected) { - shouldBe(string.trimStart(), expected); - shouldBe(string.trimLeft(), expected); -} - -function endTest(string, expected) { - shouldBe(string.trimEnd(), expected); - shouldBe(string.trimRight(), expected); -} - -function trimTest(string, expected) { - shouldBe(string.trim(), expected); -} - -startTest(` Hello `, `Hello `); -endTest(` Hello `, ` Hello`); -trimTest(` Hello `, `Hello`); - -startTest(` 日本語 `, `日本語 `); -endTest(` 日本語 `, ` 日本語`); -trimTest(` 日本語 `, `日本語`); - -startTest(`Hello`, `Hello`); -endTest(`Hello`, `Hello`); -trimTest(`Hello`, `Hello`); - -startTest(`日本語`, `日本語`); -endTest(`日本語`, `日本語`); -trimTest(`日本語`, `日本語`); - -startTest(``, ``); -endTest(``, ``); -trimTest(``, ``); - -startTest(` `, ``); -endTest(` `, ``); -trimTest(` `, ``); - -startTest(` A`, `A`); -endTest(` A`, ` A`); -trimTest(` A`, `A`); - -startTest(`A `, `A `); -endTest(`A `, `A`); -trimTest(`A `, `A`); - -shouldBe(String.prototype.trimStart, String.prototype.trimLeft); -shouldBe(String.prototype.trimEnd, String.prototype.trimRight); diff --git a/implementation-contributed/javascriptcore/stress/trivially-foldable-reflective-arguments-access.js b/implementation-contributed/javascriptcore/stress/trivially-foldable-reflective-arguments-access.js deleted file mode 100644 index 1d21c8520f..0000000000 --- a/implementation-contributed/javascriptcore/stress/trivially-foldable-reflective-arguments-access.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo() { - return arguments[0]; -} - -function bar(x) { - return foo(x); -} - -noInline(bar); - -for (var i = 0; i < 100000; ++i) { - var result = bar(42); - if (result != 42) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/try-catch-getter-as-get-by-id-register-restoration.js b/implementation-contributed/javascriptcore/stress/try-catch-getter-as-get-by-id-register-restoration.js deleted file mode 100644 index 77eb156f58..0000000000 --- a/implementation-contributed/javascriptcore/stress/try-catch-getter-as-get-by-id-register-restoration.js +++ /dev/null @@ -1,57 +0,0 @@ -function assert(b) { - if (!b) throw new Error("bad value"); -} -noInline(assert); - -let i; -var o1 = { - get f() { - if (i === -1000) - throw new Error("hello"); - return 20; - }, - x: "x" -}; - -var o2 = { - f: 40 -} - -var o3 = { - x: 100, - f: "f" -} - -function bar(i) { - if (i === -1000) - return o1; - - if (i % 2) - return o3; - else - return o2; -} -noInline(bar); - -function foo(i) { - var o = bar(i); - let v; - let v2; - let v3; - try { - v2 = o.x; - v = o.f; - } catch(e) { - assert(v2 === "x"); - assert(o === o1); - } -} -noInline(foo); - -foo(i); -for (i = 0; i < 1000; i++) - foo(i); - -i = -1000; -for (let j = 0; j < 1000; j++) - foo(i); diff --git a/implementation-contributed/javascriptcore/stress/try-catch-getter-as-get-by-id.js b/implementation-contributed/javascriptcore/stress/try-catch-getter-as-get-by-id.js deleted file mode 100644 index 6e8fb59da3..0000000000 --- a/implementation-contributed/javascriptcore/stress/try-catch-getter-as-get-by-id.js +++ /dev/null @@ -1,53 +0,0 @@ -function assert(b) { - if (!b) throw new Error("b"); -} -noInline(assert); - - -let i; -var o1 = { - get f() { - if (i === -1000) - throw new Error("hello"); - return 20; - } -}; - -var o2 = { - f: 40 -} - -var o3 = { - x: 100, - f: 50 -} - -function bar(i) { - if (i === -1000) - return o1; - - if (i % 2) - return o3; - else - return o2; -} -noInline(bar); - -function foo(i) { - var o = bar(i); - var v; - try { - v = o.f - } catch(e) { - assert(o === o1); - } -} -noInline(foo); - -foo(i); -for (i = 0; i < 1000; i++) - foo(i); - -i = -1000; -for (let j = 0; j < 1000; j++) - foo(i); diff --git a/implementation-contributed/javascriptcore/stress/try-catch-setter-as-put-by-id.js b/implementation-contributed/javascriptcore/stress/try-catch-setter-as-put-by-id.js deleted file mode 100644 index 265c719723..0000000000 --- a/implementation-contributed/javascriptcore/stress/try-catch-setter-as-put-by-id.js +++ /dev/null @@ -1,54 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("bad assertion"); -} -noInline(assert); - - -let i; -var o1 = { - set f(v) { - if (i === -1000) - throw new Error("hello"); - this._v = v; - } -}; - -var o2 = { - f: 40 -} - -var o3 = { - x: 100, - f: 50 -} - -function bar(i) { - if (i === -1000) - return o1; - - if (i % 2) - return o3; - else - return o2; -} -noInline(bar); - -function foo(i) { - let o = bar(i); - let v = o.x; - try { - o.f = v; - } catch(e) { - assert(o === o1); - } -} -noInline(foo); - -foo(i); -for (i = 0; i < 1000; i++) - foo(i); - -i = -1000; -for (let j = 0; j < 1000; j++) - foo(i); diff --git a/implementation-contributed/javascriptcore/stress/try-catch-stub-routine-replaced.js b/implementation-contributed/javascriptcore/stress/try-catch-stub-routine-replaced.js deleted file mode 100644 index db164088b9..0000000000 --- a/implementation-contributed/javascriptcore/stress/try-catch-stub-routine-replaced.js +++ /dev/null @@ -1,87 +0,0 @@ -// The main purpose of this test is to ensure that -// we will re-use no longer in use CallSiteIndices for -// inline cache stubs. See relevant code in destructor -// which calls: -// DFG::CommonData::removeCallSiteIndex(.) -// CodeBlock::removeExceptionHandlerForCallSite(.) -// Which add old call site indices to a free list. - -function assert(b) { - if (!b) - throw new Error("bad value"); -} -noInline(assert); - -var arr = [] -function allocate() { - for (var i = 0; i < 10000; i++) - arr.push({}); -} - -function hello() { return 20; } -noInline(hello); - -let __jaz = {}; -function jazzy() { - return __jaz; -} -noInline(jazzy); - -function foo(o) { - let baz = hello(); - let jaz = jazzy(); - let v; - try { - v = o.f; - v = o.f; - v = o.f; - } catch(e) { - assert(baz === 20); - assert(jaz === __jaz); - assert(v === 2); // Really flagCount. - } - return v; -} -noInline(foo); - -var objChain = {f: 40}; -var fakeOut = {x: 30, f: 100}; -for (let i = 0; i < 1000; i++) - foo(i % 2 ? objChain : fakeOut); - -var i; -var flag = "flag"; -var flagCount = 0; -objChain = { - get f() { - if (flagCount === 2) - throw new Error("I'm testing you."); - if (i === flag) - flagCount++; - return flagCount; - } -}; -for (i = 0; i < 100; i++) { - allocate(); - if (i === 99) - i = flag; - foo(objChain); -} - -fakeOut = {x: 30, get f() { return 100}}; -for (i = 0; i < 100; i++) { - allocate(); - if (i === 99) - i = flag; - foo(fakeOut); -} - -var o = { - get f() { - return flagCount; - }, - x: 100 -}; - -for (i = 0; i < 100; i++) - foo(o); diff --git a/implementation-contributed/javascriptcore/stress/type-check-hoisting-phase-hoist-check-structure-on-tdz-this-value.js b/implementation-contributed/javascriptcore/stress/type-check-hoisting-phase-hoist-check-structure-on-tdz-this-value.js deleted file mode 100644 index 56f1bc7417..0000000000 --- a/implementation-contributed/javascriptcore/stress/type-check-hoisting-phase-hoist-check-structure-on-tdz-this-value.js +++ /dev/null @@ -1,51 +0,0 @@ -function __isPropertyOfType(obj, name, type) { - desc = Object.getOwnPropertyDescriptor(obj, name) - return typeof type === 'undefined' || typeof desc.value === type; -} -function __getProperties(obj, type) { - let properties = []; - for (let name of Object.getOwnPropertyNames(obj)) { - if (__isPropertyOfType(obj, name, type)) properties.push(name); - } - let proto = Object.getPrototypeOf(obj); - while (proto && proto != Object.prototype) { - Object.getOwnPropertyNames(proto).forEach(name => { - }); - proto = Object.getPrototypeOf(proto); - } - return properties; -} -function* __getObjects(root = this, level = 0) { - if (level > 4) return; - let obj_names = __getProperties(root, 'object'); - for (let obj_name of obj_names) { - let obj = root[obj_name]; - yield* __getObjects(obj, level + 1); - } -} -function __getRandomObject() { - for (let obj of __getObjects()) { - } -} -var theClass = class { - constructor() { - if (242487 != null && typeof __getRandomObject() == "object") try { - } catch (e) {} - } -}; -var childClass = class Class extends theClass { - constructor() { - var arrow = () => { - try { - super(); - } catch (e) {} - this.idValue - }; - arrow()()(); - } -}; -for (var counter = 0; counter < 1000; counter++) { - try { - new childClass(); - } catch (e) {} -} diff --git a/implementation-contributed/javascriptcore/stress/type-of-functions-and-objects.js b/implementation-contributed/javascriptcore/stress/type-of-functions-and-objects.js deleted file mode 100644 index 9363158e44..0000000000 --- a/implementation-contributed/javascriptcore/stress/type-of-functions-and-objects.js +++ /dev/null @@ -1,86 +0,0 @@ -function foo(v) { - return typeof v; -} - -function bar(v) { - switch (typeof v) { - case "object": - return 1; - case "function": - return 2; - default: - return 3; - } -} - -function baz(v) { - return typeof v == "function"; -} - -function fuzz(v) { - return typeof v == "object"; -} - -noInline(foo); -noInline(bar); -noInline(baz); -noInline(fuzz); - -function test() { - var errors = []; - - function testValue(v, expected) { - function expect(f, expected) { - var result = f(v); - if (result != expected) - errors.push(f.name + "(" + v + ") returned " + result + " instead of " + expected); - } - - switch (expected) { - case "function": - expect(foo, "function"); - expect(bar, 2); - expect(baz, true); - expect(fuzz, false); - break; - case "object": - expect(foo, "object"); - expect(bar, 1); - expect(baz, false); - expect(fuzz, true); - break; - case "other": - var result = foo(v); - if (result == "object" || result == "function") - errors.push("foo(" + v + ") returned " + result + " but expected something other than object or function"); - expect(bar, 3); - expect(baz, false); - expect(fuzz, false); - break; - default: - throw "Bad expected case"; - } - } - - testValue({}, "object"); - testValue(function() { }, "function"); - testValue("hello", "other"); - testValue(42, "other"); - testValue(null, "object"); - testValue(void 0, "other"); - testValue(42.5, "other"); - testValue(Map, "function"); - testValue(Date, "function"); - testValue(Map.prototype, "object"); - - if (!errors.length) - return; - - for (var i = 0; i < errors.length; ++i) - print("Error: " + errors[i]); - throw "Encountered errors during test run."; -} - -for (var i = 0; i < 10000; ++i) - test(); - diff --git a/implementation-contributed/javascriptcore/stress/typed-array-byte-offset.js b/implementation-contributed/javascriptcore/stress/typed-array-byte-offset.js deleted file mode 100644 index 39d3cf2da6..0000000000 --- a/implementation-contributed/javascriptcore/stress/typed-array-byte-offset.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo(array) { - return array.byteOffset; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(new Int32Array(100)); - if (result != 0) - throw "Error: bad result for fast typed array: " + result; - result = foo(new Int32Array(100000)); - if (result != 0) - throw "Error: bad result for big typed array: " + result; - result = foo(new Int32Array(new ArrayBuffer(100), 4, 1)); - if (result != 4) - throw "Error: bad result for wasteful typed array: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/typed-array-get-by-val-profiling.js b/implementation-contributed/javascriptcore/stress/typed-array-get-by-val-profiling.js deleted file mode 100644 index f0ea641010..0000000000 --- a/implementation-contributed/javascriptcore/stress/typed-array-get-by-val-profiling.js +++ /dev/null @@ -1,91 +0,0 @@ -function testArray(arrayType) -{ - var testCode = - ` - // We make this look like a polymorphic types for incomingObject but the GetByVal are never actually - // polymorphic. The boolean isTypedArray let us differentiate the types. - function ${ arrayType }AndObjectSpeculationInBounds(incomingObject, iterationLength, isTypedArray) { - var output = 0; - output += incomingObject.length; - - if (isTypedArray) { - for (var i = 0; i < iterationLength; ++i) { - output += incomingObject[i]; - } - } else { - for (var i = 0; i < iterationLength; ++i) { - output += incomingObject[i]; - } - } - return output; - } - noInline(${ arrayType }AndObjectSpeculationInBounds); - - var typedArray = new ${ arrayType }(64); - var regularArray = new Array(64); - for (var i = 0; i < 64; ++i) { - typedArray[i] = i; - regularArray[i] = i; - } - - // Access in bounds. - for (var i = 0; i < 1e4; ++i) { - var output = ${ arrayType }AndObjectSpeculationInBounds(typedArray, 64, true); - if (output !== 32 * 65) - throw "${ arrayType }AndObjectSpeculationInBounds(typedArray, 64, true) failed, value = " + output; - - var output = ${ arrayType }AndObjectSpeculationInBounds(regularArray, 64, false); - if (output !== 32 * 65) - throw "${ arrayType }AndObjectSpeculationInBounds(regularArray, 64, false) failed, value = " + output; - } - - // One out of bounds on top of the in bounds profile. - { - var output = ${ arrayType }AndObjectSpeculationInBounds(typedArray, 128, true); - if (output === output) - throw "${ arrayType }AndObjectSpeculationInBounds(typedArray, 128, true) failed, value = " + output; - - var output = ${ arrayType }AndObjectSpeculationInBounds(regularArray, 128, false); - if (output === output) - throw "${ arrayType }AndObjectSpeculationInBounds(regularArray, 128, false) failed, value = " + output; - } - - // Same but here we make out-of-bounds a normal case. - function ${ arrayType }AndObjectSpeculationOutOfBounds(incomingObject, iterationLength, isTypedArray) { - var output = 0; - output += incomingObject.length; - - if (isTypedArray) { - for (var i = 0; i < iterationLength; ++i) { - output += incomingObject[i]|0; - } - } else { - for (var i = 0; i < iterationLength; ++i) { - output += incomingObject[i]|0; - } - } - return output; - } - noInline(${ arrayType }AndObjectSpeculationOutOfBounds); - - for (var i = 0; i < 1e4; ++i) { - var output = ${ arrayType }AndObjectSpeculationOutOfBounds(typedArray, 128, true); - if (output !== 32 * 65) - throw "${ arrayType }AndObjectSpeculationOutOfBounds(typedArray, 128, true) failed, value = " + output; - - var output = ${ arrayType }AndObjectSpeculationOutOfBounds(regularArray, 128, false); - if (output !== 32 * 65) - throw "${ arrayType }AndObjectSpeculationOutOfBounds(regularArray, 128, false) failed, value = " + output; - }` - eval(testCode); -} - -testArray("Int8Array"); -testArray("Uint8Array"); -testArray("Uint8ClampedArray"); -testArray("Int16Array"); -testArray("Uint16Array"); -testArray("Int32Array"); -testArray("Uint32Array"); -testArray("Float32Array"); -testArray("Float64Array"); diff --git a/implementation-contributed/javascriptcore/stress/typed-array-put-by-val-profiling.js b/implementation-contributed/javascriptcore/stress/typed-array-put-by-val-profiling.js deleted file mode 100644 index 9f70a23058..0000000000 --- a/implementation-contributed/javascriptcore/stress/typed-array-put-by-val-profiling.js +++ /dev/null @@ -1,98 +0,0 @@ -function testArray(arrayType) -{ - var testCode = - ` - function testOutOfBoundsValues(regularArray, typedArray) { - for (var i = 0; i < 16; ++i) { - var typedArrayValue = typedArray[i] - if (typedArrayValue !== i) { - throw "Failed ${ arrayType }AndObjectSpeculationInBounds, typedArrayValue = " + typedArrayValue + " for i = " + i; - } - var regularArrayValue = regularArray[i]; - if (regularArrayValue !== i) { - throw "Failed ${ arrayType }AndObjectSpeculationInBounds, regularArrayValue = " + regularArrayValue + " for i = " + i; - } - } - for (var i = 16; i < 24; ++i) { - var typedArrayValue = typedArray[i] - if (typedArrayValue !== undefined) { - throw "Failed ${ arrayType }AndObjectSpeculationInBounds, typedArrayValue = " + typedArrayValue + " for i = " + i; - } - var regularArrayValue = regularArray[i]; - if (regularArrayValue !== i) { - throw "Failed ${ arrayType }AndObjectSpeculationInBounds, regularArrayValue = " + regularArrayValue + " for i = " + i; - } - } - } - - // We make this look like a polymorphic types for incomingObject but the GetByVal are never actually - // polymorphic. The boolean isTypedArray let us differentiate the types. - function ${ arrayType }AndObjectSpeculationInBounds(incomingObject, iterationLength, isTypedArray) { - if (isTypedArray) { - for (var i = 0; i < iterationLength; ++i) { - incomingObject[i] = i; - } - } else { - for (var i = 0; i < iterationLength; ++i) { - incomingObject[i] = i; - } - } - } - noInline(${ arrayType }AndObjectSpeculationInBounds); - - var typedArray = new ${ arrayType }(16); - var regularArray = new Array(16); - - // Access in bounds. - for (var i = 0; i < 1e4; ++i) { - ${ arrayType }AndObjectSpeculationInBounds(regularArray, 16, false); - ${ arrayType }AndObjectSpeculationInBounds(typedArray, 16, true); - } - for (var i = 0; i < 16; ++i) { - var typedArrayValue = typedArray[i] - if (typedArrayValue !== i) { - throw "Failed ${ arrayType }AndObjectSpeculationInBounds, typedArrayValue = " + typedArrayValue + " for i = " + i; - } - var regularArrayValue = regularArray[i]; - if (regularArrayValue !== i) { - throw "Failed ${ arrayType }AndObjectSpeculationInBounds, regularArrayValue = " + regularArrayValue + " for i = " + i; - } - } - - // One "out of bounds" on top of the in bounds profile. - ${ arrayType }AndObjectSpeculationInBounds(regularArray, 24, false); - ${ arrayType }AndObjectSpeculationInBounds(typedArray, 24, true); - testOutOfBoundsValues(regularArray, typedArray); - - // Same but here we make out-of-bounds a normal case. - function ${ arrayType }AndObjectSpeculationOutOfBounds(incomingObject, iterationLength, isTypedArray) { - if (isTypedArray) { - for (var i = 0; i < iterationLength; ++i) { - incomingObject[i] = i; - } - } else { - for (var i = 0; i < iterationLength; ++i) { - incomingObject[i] = i; - } - } - } - noInline(${ arrayType }AndObjectSpeculationOutOfBounds); - - var typedArray = new ${ arrayType }(16); - var regularArray = new Array(16); - for (var i = 0; i < 1e4; ++i) { - ${ arrayType }AndObjectSpeculationInBounds(regularArray, 24, false); - ${ arrayType }AndObjectSpeculationInBounds(typedArray, 24, true); - }` - eval(testCode); -} - -testArray("Int8Array"); -testArray("Uint8Array"); -testArray("Uint8ClampedArray"); -testArray("Int16Array"); -testArray("Uint16Array"); -testArray("Int32Array"); -testArray("Uint32Array"); -testArray("Float32Array"); -testArray("Float64Array"); diff --git a/implementation-contributed/javascriptcore/stress/typed-array-view-set-should-not-crash-on-exception.js b/implementation-contributed/javascriptcore/stress/typed-array-view-set-should-not-crash-on-exception.js deleted file mode 100644 index 2e3d1c90b4..0000000000 --- a/implementation-contributed/javascriptcore/stress/typed-array-view-set-should-not-crash-on-exception.js +++ /dev/null @@ -1,27 +0,0 @@ -//@ runFTLNoCJIT -// This test passes if it does not crash. - -function shouldEqual(testId, actual, expected) { - if (actual != expected) { - throw testId + ": ERROR: expect " + expected + ", actual " + actual; - } -} - -arr = new Array; - -Object.defineProperty(arr, 1, { - configurable: true, enumerable: true, - get: Date.prototype.getSeconds, -}); - -typedArray = new Float64Array(16); -typedArray[0] = 0; - -var exception = undefined; -try { - typedArray.set(arr, 0); -} catch (e) { - exception = e; -} - -shouldEqual(10000, exception, "TypeError: Type error"); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-access-monomorphic-neutered.js b/implementation-contributed/javascriptcore/stress/typedarray-access-monomorphic-neutered.js deleted file mode 100644 index 009e5bf29f..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-access-monomorphic-neutered.js +++ /dev/null @@ -1,54 +0,0 @@ -typedArrays = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array]; - - -function check(array, thunk, count) { - let failed = true; - try { - thunk(array, count); - } catch(e) { - if (e != "TypeError: Underlying ArrayBuffer has been detached from the view") - throw new Error([thunk, count, e]); - failed = false; - } - if (failed) - throw new Error([thunk, count]); -} -noInline(check); - -function test(thunk, array) { - let fn = Function("array", "i", thunk); - noInline(fn); - for (let i = 0; i < 10000; i++) - check(array, fn, i); -} - -for (let constructor of typedArrays) { - let array = new constructor(10); - transferArrayBuffer(array.buffer); - test("array[0]", array); - test("delete array[0]", array); - test("Object.getOwnPropertyDescriptor(array, 0)", array); - test("Object.defineProperty(array, 0, { value: 1, writable: true, configurable: false, enumerable: true })", array); - test("array[0] = 1", array); - test("array[i] = 1", array); -} - -function testFTL(thunk, array, failArray) { - let fn = Function("array", "i", thunk); - noInline(fn); - for (let i = 0; i < 10000; i++) - fn(array, i) - check(failArray, fn, 10000); -} - -for (let constructor of typedArrays) { - let array = new constructor(10); - let failArray = new constructor(10); - transferArrayBuffer(failArray.buffer); - testFTL("array[0]", array, failArray); - testFTL("delete array[0]", array, failArray); - testFTL("Object.getOwnPropertyDescriptor(array, 0)", array, failArray); - testFTL("Object.defineProperty(array, 0, { value: 1, writable: true, configurable: false, enumerable: true })", array, failArray); - testFTL("array[0] = 1", array, failArray); - testFTL("array[i] = 1", array, failArray); -} diff --git a/implementation-contributed/javascriptcore/stress/typedarray-access-neutered.js b/implementation-contributed/javascriptcore/stress/typedarray-access-neutered.js deleted file mode 100644 index 7a64211b77..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-access-neutered.js +++ /dev/null @@ -1,30 +0,0 @@ -typedArrays = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array]; - - -function check(thunk, count) { - let array = new constructor(10); - transferArrayBuffer(array.buffer); - let failed = true; - try { - thunk(array); - } catch(e) { - if (e != "TypeError: Underlying ArrayBuffer has been detached from the view") - throw new Error([thunk, count, e]); - failed = false; - } - if (failed) - throw new Error([thunk, count]); -} - -function test(thunk, count) { - for (constructor of typedArrays) - check(thunk, count); -} - -for (let i = 0; i < 10000; i++) { - test((array) => array[0], i); - test((array) => delete array[0], i); - test((array) => Object.getOwnPropertyDescriptor(array, 0), i); - test((array) => Object.defineProperty(array, 0, { value: 1, writable: true, configurable: false, enumerable: true }), i) - test((array) => array[0] = 1, i); -} diff --git a/implementation-contributed/javascriptcore/stress/typedarray-add-property-to-base-object.js b/implementation-contributed/javascriptcore/stress/typedarray-add-property-to-base-object.js deleted file mode 100644 index f8e2760615..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-add-property-to-base-object.js +++ /dev/null @@ -1,21 +0,0 @@ -// This tests that we don't fast path intrinsics when they should not be fast pathed. Currently, -// that means that we don't inline length and byteLength when they are "connected" to a TypedArray. - -(function body() { - function foo(a) { - return a.length + a.byteLength + a.byteOffset; - } - - let array = new Int32Array(10); - - for (let i = 0; i < 100000; i++) - foo(array); - - - Object.defineProperty(array, "length", { value: 0 }); - Object.defineProperty(array, "byteLength", { value: 0 }); - Object.defineProperty(array, "byteOffset", { value: 0 }); - - if (foo(array) !== 0) - throw "wrong number!"; -})(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-bad-getter.js b/implementation-contributed/javascriptcore/stress/typedarray-bad-getter.js deleted file mode 100644 index c75f4a88f9..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-bad-getter.js +++ /dev/null @@ -1,36 +0,0 @@ -// This tests that we don't fast path intrinsics when they should not be fast pathed. Currently, -// that means that we don't inline length, byteLength, and byteOffset when they are called -// from a non-TypedArray. - -(function body() { - function foo(a) { - return a.length + a.byteLength + a.byteOffset; - } - noInline(foo); - - let proto = { } - - let properties = ["length", "byteLength", "byteOffset"]; - properties.map(function(name) { - let getter = Int32Array.prototype.__lookupGetter__(name); - Object.defineProperty(proto, name, { get : getter }); - }); - - function Bar() { - return this; - } - - Bar.prototype = proto; - let bar = new Bar(); - - let noThrow = false; - for (let i = 0; i < 100000; i++) { - try { - foo(bar); - noThrow = true - } catch (e) { - } - if (noThrow) - throw "broken"; - } -})(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-configure-index.js b/implementation-contributed/javascriptcore/stress/typedarray-configure-index.js deleted file mode 100644 index e82de0bdf6..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-configure-index.js +++ /dev/null @@ -1,57 +0,0 @@ -typedArrays = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array]; - -function assert(cond) { - if (!cond) - throw new Error("bad assertion!"); -} - -function assertThrows(thunk, error) { - let failed = true; - try { - thunk(); - } catch (e) { - if (error && e != error) - throw new Error("bad assertion!"); - failed = false; - } - if (failed) - throw new Error("bad assertion!"); -} - -function makeDescriptor(accessor, configurable, writable, enumerable) { - let o = {writable, configurable, enumerable} - if (accessor) - o.get = () => 1; - else - o.value = 1; - return o; -} - -let bools = [true, false]; - -function test(array, a, c, error ) { - for (w of bools) { - for (e of bools) { - assertThrows(() => Object.defineProperty(a, 0, makeDescriptor(a, c, w, e), error)); - } - } -} - -function foo() { - for (constructor of typedArrays) { - let a = new constructor(10); - Object.defineProperty(a, 0, makeDescriptor(false, false, true, true)); - assert(a[0] === 1); - assertThrows(() => Object.defineProperty(a, 0, makeDescriptor(false, false, true, false), "TypeError: Attempting to store non-enumerable or non-writable indexed property on a typed array.")); - assertThrows(() => Object.defineProperty(a, 0, makeDescriptor(false, false, false, false), "TypeError: Attempting to store non-enumerable or non-writable indexed property on a typed array.")); - assertThrows(() => Object.defineProperty(a, 0, makeDescriptor(false, false, false, true), "TypeError: Attempting to store non-enumerable or non-writable indexed property on a typed array.")); - - test(a, false, true, "TypeError: Attempting to configure non-configurable property."); - for (c of bools) { - test(a, true, c, "TypeError: Attempting to store accessor indexed property on a typed array.") - } - } -} - -for (let i = 0; i < 100; i++) - foo(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-construct-iterator.js b/implementation-contributed/javascriptcore/stress/typedarray-construct-iterator.js deleted file mode 100644 index d1d80d5330..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-construct-iterator.js +++ /dev/null @@ -1,66 +0,0 @@ -// Test a bunch of things about typed array constructors with iterators. - -// Test that the dfg actually respects iterators. -let foo = [1,2,3,4]; - -function iterator() { - return { i: 0, - next: function() { - if (this.i < foo.length/2) { - return { done: false, - value: foo[this.i++] - }; - } - return { done: true }; - } - }; -} - -foo[Symbol.iterator] = iterator; - -(function body() { - - for (var i = 1; i < 100000; i++) { - if (new Int32Array(foo).length !== 2) - throw "iterator did not run"; - } - -})(); - -// Test that the optimizations used for iterators during construction is valid. - -foo = { 0:0, 1:1, 2:2, 3:3 }; -count = 4; -foo.__defineGetter__("length", function() { - return count--; -}); - -foo[Symbol.iterator] = Array.prototype[Symbol.iterator]; - -if (new Int32Array(foo).length !== 2) - throw "iterator did not run"; - -// Test that we handle length is unset... whoops. - -foo = { 0:0, 2:2, 3:3 }; - -if (new Int32Array(foo).length !== 0) - throw "did not handle object with unset length"; - -// Test that we handle prototypes with accessors. - -foo = { 0:0, 2:2, 3:3 }; -foo[Symbol.iterator] = Array.prototype[Symbol.iterator]; -foo.length = 4; -bar = { }; - -bar.__defineGetter__("1", function() { - foo.length = 0; - return 1; -}); - - -foo.__proto__ = bar; - -if (new Int32Array(foo).length !== 2) - throw "did not handle object with accessor on prototype"; diff --git a/implementation-contributed/javascriptcore/stress/typedarray-constructor.js b/implementation-contributed/javascriptcore/stress/typedarray-constructor.js deleted file mode 100644 index 0e8eaf7498..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-constructor.js +++ /dev/null @@ -1,69 +0,0 @@ -load("./resources/typedarray-constructor-helper-functions.js"); - -let TypedArray = Object.getPrototypeOf(Int32Array); - -class A extends TypedArray { - constructor() { super(); } - -} - -shouldThrow("new A()"); - -let foo = [1,2,3,4]; - -function iterator() { - return { i: 0, - next: function() { - if (this.i < foo.length/2) { - return { done: false, - value: foo[this.i++] - }; - } - return { done: true }; - } - }; -} - -foo[Symbol.iterator] = iterator; - -shouldBeTrue("testConstructor('(foo)', [1,2])"); -debug(""); - -debug("Test that we don't premptively convert to native values and use a gc-safe temporary storage."); - - -done = false; -obj = { - valueOf: function() { - if (!done) - throw "bad"; - return 1; - } -}; - -foo = [obj, 2, 3, 4]; - -function iterator2() { - done = false; - return { i: 0, - next: function() { - gc(); - if (this.i < foo.length/2) { - return { done: false, - value: foo[this.i++] - }; - } - done = true; - return { done: true }; - } - }; -} - -foo[Symbol.iterator] = iterator2; - -shouldBeTrue("testConstructor('(foo)', [1,2])"); - -shouldBeTrue("testConstructor('(true)', [0])"); -shouldBeTrue("testConstructor('(`hi`)', [])"); - -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-copyWithin.js b/implementation-contributed/javascriptcore/stress/typedarray-copyWithin.js deleted file mode 100644 index e5e79aa0e6..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-copyWithin.js +++ /dev/null @@ -1,16 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description("This test checks the behavior of the TypedArray.prototype.copyWithin function"); - - -shouldBe("Int32Array.prototype.copyWithin.length", "2"); -shouldBe("Int32Array.prototype.copyWithin.name", "'copyWithin'"); - -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('copyWithin')"); -shouldBeTrue("testPrototypeReceivesArray('copyWithin', [undefined, this, { }, [ ], true, ''])"); - -shouldBeTrue("testPrototypeFunction('copyWithin', '(0, 3)', [1, 2, 3, 4, 5], [4, 5, 3, 4, 5])"); -shouldBeTrue("testPrototypeFunction('copyWithin', '(0, 3, 4)', [1, 2, 3, 4, 5], [4, 2, 3, 4, 5])"); -shouldBeTrue("testPrototypeFunction('copyWithin', '(0, -2, -1)', [1, 2, 3, 4, 5], [4, 2, 3, 4, 5])"); -shouldBeTrue("testPrototypeFunction('copyWithin', '(5, -5, 5)', [1, 2, 3, 4, 5], [1, 2, 3, 4, 5])"); -shouldBeTrue("testPrototypeFunction('copyWithin', '(1, -5, 5)', [1, 2, 3, 4, 5], [1, 1, 2, 3, 4])"); -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-every.js b/implementation-contributed/javascriptcore/stress/typedarray-every.js deleted file mode 100644 index c4e979cab5..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-every.js +++ /dev/null @@ -1,56 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.prototype.every function" -); - -shouldBe("Int32Array.prototype.every.length", "1"); -shouldBe("Int32Array.prototype.every.name", "'every'"); -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('every')"); -shouldBeTrue("testPrototypeReceivesArray('every', [undefined, this, { }, [ ], true, ''])"); -debug(""); - -debug("testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])"); -debug(""); - -debug("1.0 Single Argument Testing"); -function isBigEnough(element, index, array) { - if (this.value) - return element >= this.value; - return element >= 10; -} -shouldBeTrue("testPrototypeFunction('every', '(isBigEnough)', [12, 5, 8, 13, 44], false)"); -shouldBeTrue("testPrototypeFunction('every', '(isBigEnough)', [12, 54, 18, 13, 44], true)"); -debug(""); - -debug("2.0 Two Argument Testing"); -var thisValue = { value: 11 }; -shouldBeTrue("testPrototypeFunction('every', '(isBigEnough, thisValue)', [12, 15, 10, 13, 44], false)"); -shouldBeTrue("testPrototypeFunction('every', '(isBigEnough, thisValue)', [12, 54, 82, 13, 44], true)"); -debug(""); - -debug("3.0 Array Element Changing"); -function isBigEnoughAndChange(element, index, array) { - array[array.length - 1 - index] = 5; - return (element >= 10); -} -shouldBeTrue("testPrototypeFunction('every', '(isBigEnoughAndChange)', [12, 15, 1, 13, 44], false, [12, 15, 5, 5, 5])"); -shouldBeTrue("testPrototypeFunction('every', '(isBigEnoughAndChange)', [12, 15, 10, 13, 44], false, [12, 5, 5, 5, 5])"); -debug(""); - -debug("4.0 Exception Test"); -function isBigEnoughAndException(element, index, array) { - if(index==1) throw "exception from function"; - return (element >= 10); -} -shouldThrow("testPrototypeFunction('every', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], false)"); -debug(""); - -debug("5.0 Wrong Type for Callback Test"); -shouldThrow("testPrototypeFunction('every', '(8)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.every callback must be a function'"); -shouldThrow("testPrototypeFunction('every', '(\"wrong\")', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.every callback must be a function'"); -shouldThrow("testPrototypeFunction('every', '(new Object())', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.every callback must be a function'"); -shouldThrow("testPrototypeFunction('every', '(null)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.every callback must be a function'"); -shouldThrow("testPrototypeFunction('every', '()', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.every callback must be a function'"); -debug(""); - -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-fill.js b/implementation-contributed/javascriptcore/stress/typedarray-fill.js deleted file mode 100644 index 755b44047c..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-fill.js +++ /dev/null @@ -1,49 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.prototype.fill function" -); - -shouldBe("Int32Array.prototype.fill.length", "1"); -shouldBe("Int32Array.prototype.fill.name", "'fill'"); -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('fill')"); -shouldBeTrue("testPrototypeReceivesArray('fill', [undefined, this, { }, [ ], true, ''])"); -debug(""); - -debug("testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])"); -debug(""); - -debug("1.0 Single Argument Testing"); -shouldBeTrue("testPrototypeFunction('fill', '(12)', [15, 5, 8, 13, 44], [12,12,12,12,12])"); -shouldBeTrue("testPrototypeFunction('fill', '(true)', [12, 54, 18, 13, 44], [1,1,1,1,1])"); -debug(""); - -debug("2.0 Two Argument Testing"); -shouldBeTrue("testPrototypeFunction('fill', '(12, 2)', [14, 15, 10, 13, 44], [14, 15, 12, 12, 12])"); -shouldBeTrue("testPrototypeFunction('fill', '(4, NaN)', [14, 15, 10, 13, 44], [4, 4, 4, 4, 4])"); -shouldBeTrue("testPrototypeFunction('fill', '(4, -5)', [14, 15, 10, 13, 44], [4, 4, 4, 4, 4])"); -shouldBeTrue("testPrototypeFunction('fill', '(4, -1)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 4])"); -debug(""); - -debug("3.0 Three Argument Testing"); -shouldBeTrue("testPrototypeFunction('fill', '(4, -1, 0)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 44])"); -shouldBeTrue("testPrototypeFunction('fill', '(4, 1, 1)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 44])"); -shouldBeTrue("testPrototypeFunction('fill', '(4, 1, NaN)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 44])"); -shouldBeTrue("testPrototypeFunction('fill', '(4, NaN, NaN)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 44])"); -shouldBeTrue("testPrototypeFunction('fill', '(4, NaN, 5)', [14, 15, 10, 13, 44], [4, 4, 4, 4, 4])"); -shouldBeTrue("testPrototypeFunction('fill', '(4, -3, -2)', [14, 15, 10, 13, 44], [14, 15, 4, 13, 44])"); -shouldBeTrue("testPrototypeFunction('fill', '(4, 5, 5)', [14, 15, 10, 13, 44], [14, 15, 10, 13, 44])"); - -debug("4.0 Coercion Testing"); -for (constructor of typedArrays) { - count = 0; - let p = new Proxy({}, { get(target, name) { - count++; - return target[name]; - }}); - new constructor(10).fill(p); - shouldBeTrue("count === 40"); -} - - - -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-filter.js b/implementation-contributed/javascriptcore/stress/typedarray-filter.js deleted file mode 100644 index 5e85923817..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-filter.js +++ /dev/null @@ -1,103 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.prototype.filter function" -); - -shouldBe("Int32Array.prototype.filter.length", "1"); -shouldBe("Int32Array.prototype.filter.name", "'filter'"); -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('filter')"); -shouldBeTrue("testPrototypeReceivesArray('filter', [undefined, this, { }, [ ], true, ''])"); -debug(""); - -debug("testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])"); -debug(""); - -debug("1.0 Single Argument Testing"); -function keepEven(e, i) { - return !(e & 1) || (this.keep ? this.keep.indexOf(i) >= 0 : false); -} -shouldBeTrue("testPrototypeFunction('filter', '(keepEven)', [12, 5, 8, 13, 44], [12, 8, 44])"); -shouldBeTrue("testPrototypeFunction('filter', '(keepEven)', [11, 54, 18, 13, 1], [54, 18])"); -debug(""); - -debug("2.0 Two Argument Testing"); -var thisValue = { keep: [1, 3] }; -shouldBeTrue("testPrototypeFunction('filter', '(keepEven, thisValue)', [12, 23, 11, 1, 45], [12, 23, 1])"); -debug(""); - -debug("3.0 Array Element Changing"); -function keepEvenAndChange(e, i, a) { - a[a.length - 1 - i] = 5; - return !(e & 1); -} -shouldBeTrue("testPrototypeFunction('filter', '(keepEvenAndChange)', [12, 15, 2, 13, 44], [12, 2], [5, 5, 5, 5, 5])"); -debug(""); - -debug("4.0 Exception Test"); -function isBigEnoughAndException(element, index, array) { - if(index==1) throw "exception from function"; - return (element >= 10); -} -shouldThrow("testPrototypeFunction('filter', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], false)"); -debug(""); - -debug("5.0 Wrong Type for Callback Test"); -shouldThrow("testPrototypeFunction('filter', '(8)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.filter callback must be a function'"); -shouldThrow("testPrototypeFunction('filter', '(\"wrong\")', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.filter callback must be a function'"); -shouldThrow("testPrototypeFunction('filter', '(new Object())', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.filter callback must be a function'"); -shouldThrow("testPrototypeFunction('filter', '(null)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.filter callback must be a function'"); -shouldThrow("testPrototypeFunction('filter', '()', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.filter callback must be a function'"); -debug(""); - -debug("6.0 Symbol.species Test"); -subclasses = typedArrays.map(function(constructor) { return class extends constructor { } } ); - -function accept() { return true; } - -function testSpecies(array, constructor) { - let newArray = array.filter(accept); - return newArray instanceof constructor; -} - -shouldBeTrue("forEachTypedArray(subclasses, testSpecies)"); - -Foo = class extends Int32Array { } -subclasses.forEach(function(constructor) { Object.defineProperty(constructor, Symbol.species, { value:Foo, writable:true }); }); -function testSpeciesWithFoo(array, constructor) { - let newArray = array.filter(accept); - return newArray instanceof Foo; -} -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesWithFoo)"); -debug(""); - -debug("6.2 Symbol.species Test throws"); -subclasses.forEach(function(constructor) { constructor[Symbol.species] = 1; }); -shouldThrow("forEachTypedArray(subclasses, testSpecies)"); - -subclasses.forEach(function(constructor) { constructor[Symbol.species] = Array; }); -shouldThrow("forEachTypedArray(subclasses, testSpecies)"); -debug(""); - -debug("6.2 Symbol.species Test with Defaults"); -subclasses.forEach(function(constructor) { constructor[Symbol.species] = null; }); -function testSpeciesIsDefault(array, constructor) { - let newArray = array.filter(accept); - let defaultConstructor = typedArrays[subclasses.indexOf(constructor)]; - return newArray instanceof defaultConstructor; -} - -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesIsDefault)"); - -subclasses.forEach(function(constructor) { constructor[Symbol.species] = undefined; }); -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesIsDefault)"); - -subclasses = typedArrays.map(function(constructor) { return class extends constructor { } } ); -function testSpeciesRemoveConstructor(array, constructor) { - array.constructor = undefined; - let newArray = array.filter(accept); - let defaultConstructor = typedArrays[subclasses.indexOf(constructor)]; - return newArray instanceof defaultConstructor; -} - -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesRemoveConstructor)"); -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-find.js b/implementation-contributed/javascriptcore/stress/typedarray-find.js deleted file mode 100644 index b1902c45a0..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-find.js +++ /dev/null @@ -1,53 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.prototype.find function" -); - -shouldBe("Int32Array.prototype.find.length", "1"); -shouldBe("Int32Array.prototype.find.name", "'find'"); -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('find')"); -shouldBeTrue("testPrototypeReceivesArray('find', [undefined, this, { }, [ ], true, ''])"); -debug(""); - -debug("testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])"); -debug(""); - -debug("1.0 Single Argument Testing"); -function keepEven(e, i) { - return !(e & 1) || (this.keep ? this.keep === i : false); -} -shouldBeTrue("testPrototypeFunction('find', '(keepEven)', [12, 5, 8, 13, 44], 12)"); -shouldBeTrue("testPrototypeFunction('find', '(keepEven)', [11, 13, 17, 13, 22], 22)"); -shouldBeTrue("testPrototypeFunction('find', '(keepEven)', [11, 13, 17, 13, 11], undefined)"); -debug(""); - -debug("2.0 Two Argument Testing"); -var thisValue = { keep: 3 }; -shouldBeTrue("testPrototypeFunction('find', '(keepEven, thisValue)', [11, 23, 11, 1, 44], 1)"); -debug(""); - -debug("3.0 Array Element Changing"); -function keepEvenAndChange(e, i, a) { - a[a.length - 1 - i] = 5; - return !(e & 1); -} -shouldBeTrue("testPrototypeFunction('find', '(keepEvenAndChange)', [11, 15, 3, 12, 44], undefined, [5, 5, 5, 5, 5])"); -debug(""); - -debug("4.0 Exception Test"); -function isBigEnoughAndException(element, index, array) { - if(index==1) throw "exception from function"; - return (element >= 10); -} -shouldBeTrue("testPrototypeFunction('find', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], 12)"); -shouldThrow("testPrototypeFunction('find', '(isBigEnoughAndException)', [9, 15, 10, 13, 44], false)"); -debug(""); - -debug("5.0 Wrong Type for Callback Test"); -shouldThrow("testPrototypeFunction('find', '(8)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.find callback must be a function'"); -shouldThrow("testPrototypeFunction('find', '(\"wrong\")', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.find callback must be a function'"); -shouldThrow("testPrototypeFunction('find', '(new Object())', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.find callback must be a function'"); -shouldThrow("testPrototypeFunction('find', '(null)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.find callback must be a function'"); -shouldThrow("testPrototypeFunction('find', '()', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.find callback must be a function'"); -debug(""); -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-findIndex.js b/implementation-contributed/javascriptcore/stress/typedarray-findIndex.js deleted file mode 100644 index e015b7c5a5..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-findIndex.js +++ /dev/null @@ -1,53 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.prototype.findIndex function" -); - -shouldBe("Int32Array.prototype.findIndex.length", "1"); -shouldBe("Int32Array.prototype.findIndex.name", "'findIndex'"); -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('findIndex')"); -shouldBeTrue("testPrototypeReceivesArray('findIndex', [undefined, this, { }, [ ], true, ''])"); -debug(""); - -debug("testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])"); -debug(""); - -debug("1.0 Single Argument Testing"); -function keepEven(e, i) { - return !(e & 1) || (this.keep ? this.keep === i : false); -} -shouldBeTrue("testPrototypeFunction('findIndex', '(keepEven)', [12, 5, 8, 13, 44], 0)"); -shouldBeTrue("testPrototypeFunction('findIndex', '(keepEven)', [11, 13, 17, 13, 22], 4)"); -shouldBeTrue("testPrototypeFunction('findIndex', '(keepEven)', [11, 13, 17, 13, 11], -1)"); -debug(""); - -debug("2.0 Two Argument Testing"); -var thisValue = { keep: 3 }; -shouldBeTrue("testPrototypeFunction('findIndex', '(keepEven, thisValue)', [11, 23, 11, 1, 44], 3)"); -debug(""); - -debug("3.0 Array Element Changing"); -function keepEvenAndChange(e, i, a) { - a[a.length - 1 - i] = 5; - return !(e & 1); -} -shouldBeTrue("testPrototypeFunction('findIndex', '(keepEvenAndChange)', [11, 15, 3, 12, 44], -1, [5, 5, 5, 5, 5])"); -debug(""); - -debug("4.0 Exception Test"); -function isBigEnoughAndException(element, index, array) { - if(index==1) throw "exception from function"; - return (element >= 10); -} -shouldBeTrue("testPrototypeFunction('findIndex', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], 0)"); -shouldThrow("testPrototypeFunction('findIndex', '(isBigEnoughAndException)', [9, 15, 10, 13, 44], false)"); -debug(""); - -debug("5.0 Wrong Type for Callback Test"); -shouldThrow("testPrototypeFunction('findIndex', '(8)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.findIndex callback must be a function'"); -shouldThrow("testPrototypeFunction('findIndex', '(\"wrong\")', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.findIndex callback must be a function'"); -shouldThrow("testPrototypeFunction('findIndex', '(new Object())', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.findIndex callback must be a function'"); -shouldThrow("testPrototypeFunction('findIndex', '(null)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.findIndex callback must be a function'"); -shouldThrow("testPrototypeFunction('findIndex', '()', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.findIndex callback must be a function'"); -debug(""); -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-forEach.js b/implementation-contributed/javascriptcore/stress/typedarray-forEach.js deleted file mode 100644 index 0d69ffed4c..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-forEach.js +++ /dev/null @@ -1,91 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.prototype.forEach function" -); - -shouldBe("Int32Array.prototype.forEach.length", "1"); -shouldBe("Int32Array.prototype.forEach.name", "'forEach'"); -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('forEach')"); -shouldBeTrue("testPrototypeReceivesArray('forEach', [undefined, this, { }, [ ], true, ''])"); -debug(""); - -var passed = true; -var thisPassed = true; -var typedArray; -function createChecker(expected, callback, thisValue) { - function checkCorrect(array) { - let list = [] - function accumulate(e, i, a) { - list.push(callback.call(this, e, i, a)); - } - - typedArray = array; - array.forEach(accumulate, thisValue); - - if (list.length !== expected.length) { - debug("forEach did not work correctly, computed array: " + list + " expected array: " + expected); - passed = false; - } - - for (let i = 0; i < list.length; ++i) - if (list[i] !== expected[i]) { - debug("forEach did not work correctly, computed array: " + list + " expected array: " + expected); - passed = false; - } - } - - return checkCorrect; -} - -function foo(e, i) { - if (this.value !== 3) - thisPassed = false; - return e; -} - - -debug("1.0 Single Argument Testing"); - -forEachTypedArray(typedArrays, createChecker([1, 2, 3, 4, 5], foo, undefined), [1, 2, 3, 4, 5]); -shouldBeTrue("passed"); -debug(""); - -debug("2.0 Two Argument Testing"); -passed = true; -thisPassed = true; - -forEachTypedArray(typedArrays, createChecker([1, 2, 3, 4, 5], foo, { value: 3 }), [1, 2, 3, 4, 5]); -shouldBeTrue("passed && thisPassed"); - -passed = true; -thisPassed = true; -forEachTypedArray(typedArrays, createChecker([1, 2, 3, 4, 5], foo, { value: 2 }), [1, 2, 3, 4, 5]); -shouldBeTrue("passed && !thisPassed"); -debug(""); - -debug("3.0 Array Element Changing"); -function changeArray(e, i, a) { - a[a.length - 1 - i] = 5; - return e; -} - -forEachTypedArray(typedArrays, createChecker([11, 12, 13, 5, 5], changeArray), [11, 12, 13, 14, 15]); -shouldBeTrue("passed && hasSameValues('array did not mutate correctly', typedArray, [5, 5, 5, 5, 5])"); -debug(""); - -debug("4.0 Exception Test"); -function isBigEnoughAndException(element, index, array) { - if(index==1) throw "exception from function"; - return (element); -} -shouldThrow("testPrototypeFunction('forEach', '(isBigEnoughAndException)', [9, 15, 10, 13, 44], false)"); -debug(""); - -debug("5.0 Wrong Type for Callback Test"); -shouldThrow("testPrototypeFunction('forEach', '(8)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.forEach callback must be a function'"); -shouldThrow("testPrototypeFunction('forEach', '(\"wrong\")', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.forEach callback must be a function'"); -shouldThrow("testPrototypeFunction('forEach', '(new Object())', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.forEach callback must be a function'"); -shouldThrow("testPrototypeFunction('forEach', '(null)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.forEach callback must be a function'"); -shouldThrow("testPrototypeFunction('forEach', '()', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.forEach callback must be a function'"); -debug(""); -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-from.js b/implementation-contributed/javascriptcore/stress/typedarray-from.js deleted file mode 100644 index dbbfc8a2ed..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-from.js +++ /dev/null @@ -1,47 +0,0 @@ -load("./resources/typedarray-constructor-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.from function" -); - -shouldBe("Int32Array.from.length", "1"); -shouldBe("Int32Array.from.name", "'from'"); -debug(""); - -debug("testConstructorFunction has the following arg list (name, args, init, result [ , expectedArray ])"); -debug(""); - -debug("1.0 Single Argument Testing"); -shouldBeTrue("testConstructorFunction('from', '([])', [])"); -shouldBeTrue("testConstructorFunction('from', '([2])', [2])"); -shouldBeTrue("testConstructorFunction('from', '([2,3,4])', [2,3,4])"); -debug(""); - -debug("2.0 Two Argument Testing"); -function even(e, i) { - return !(e & 1) || (this.change ? this.change.indexOf(i) >= 0 : false); -} -shouldBeTrue("testConstructorFunction('from', '([12, 5, 8, 13, 44], even)', [1, 0, 1, 0, 1])"); -shouldBeTrue("testConstructorFunction('from', '([11, 54, 18, 13, 1], even)', [0, 1, 1, 0, 0])"); -debug(""); - -debug("3.0 Three Argument Testing"); -var thisValue = { change: [1, 3] }; -shouldBeTrue("testConstructorFunction('from', '([12, 23, 11, 1, 45], even, thisValue)', [1, 1, 0, 1, 0])"); -debug(""); - - -debug("4.0 Exception Test"); -function isBigEnoughAndException(element, index, array) { - if(index==1) throw "exception from function"; - return (element >= 10); -} -shouldThrow("testConstructorFunction('from', '([12, 15, 10, 13, 44], isBigEnoughAndException)', false)"); -debug(""); - -debug("5.0 Wrong Type for Callback Test"); -shouldThrow("testConstructorFunction('from', '( [12, 15, 10, 13, 44], 8)', false)"); -shouldThrow("testConstructorFunction('from', '([12, 15, 10, 13, 44], \"wrong\")', false)"); -shouldThrow("testConstructorFunction('from', '([12, 15, 10, 13, 44], new Object())', false)"); -shouldThrow("testConstructorFunction('from', '([12, 15, 10, 13, 44], null)', false)"); -debug(""); -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-functions-with-neutered.js b/implementation-contributed/javascriptcore/stress/typedarray-functions-with-neutered.js deleted file mode 100644 index 0e66ec94ce..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-functions-with-neutered.js +++ /dev/null @@ -1,169 +0,0 @@ -typedArrays = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array]; - -proto = Int8Array.prototype.__proto__; - -function getGetter(prop) { - return Object.getOwnPropertyDescriptor(proto, prop).get; -} - -function unit() { } - - -prototypeFunctions = [ - { func:getGetter("length"), args:[], result:0 }, - { func:getGetter("byteLength"), args:[], result:0 }, - { func:getGetter("byteOffset"), args:[], result:0 }, - { func:proto.copyWithin, args:[0, 1] }, - { func:proto.entries, args:[] }, - { func:proto.every, args:[unit] }, - { func:proto.every, args:[1] }, - { func:proto.filter, args:[unit] }, - { func:proto.find, args:[] }, - { func:proto.findIndex, args:[] }, - { func:proto.forEach, args:[] }, - { func:proto.indexOf, args:[] }, - { func:proto.join, args:[] }, - { func:proto.keys, args:[] }, - { func:proto.lastIndexOf, args:[] }, - { func:proto.map, args:[] }, - { func:proto.reduce, args:[] }, - { func:proto.reduceRight, args:[] }, - { func:proto.reverse, args:[] }, - { func:proto.set, args:[[]] }, - { func:proto.set, args:[new Int32Array(1)] }, - { func:proto.set, args:[new Int32Array(1)] }, - { func:proto.set, args:[new Int32Array(1), -1], error:"RangeError: Offset should not be negative" }, - { func:proto.slice, args:[] }, - { func:proto.some, args:[] }, - { func:proto.sort, args:[] }, - { func:proto.subarray, args:[] }, - { func:proto.toString, args:[] }, - { func:proto.values, args:[] }, -]; - -arrays = typedArrays.map(function(constructor) { - let view = new constructor(10); - transferArrayBuffer(view.buffer); - return view; -}); - -function checkProtoFunc(testArgs) { - function throwsCorrectError(elem) { - try { - result = testArgs.func.call(...[elem, ...testArgs.args]); - if (testArgs.result !== undefined) { - return result === testArgs.result; - } - } catch (e) { - if (testArgs.error) - return e == testArgs.error; - return e == "TypeError: Underlying ArrayBuffer has been detached from the view"; - } - return false; - } - - if (!arrays.every(throwsCorrectError)) - throw "bad" + testArgs.func.name; -} - -function test() { - prototypeFunctions.forEach(checkProtoFunc); -} - -for (var i = 0; i < 1000; i++) - test(); - -// Test that we handle neutering for any toInteger neutering the arraybuffer. -prototypeFunctions = [ - { func:proto.copyWithin, args:["prim", "prim", "prim"] }, - { func:proto.every, args:["func"] }, - { func:proto.fill, args:["prim", "prim", "prim"] }, - { func:proto.filter, args:["func"] }, - { func:proto.find, args:["func"] }, - { func:proto.findIndex, args:["func"] }, - { func:proto.forEach, args:["func"] }, - { func:proto.indexOf, args:["na", "prim"] }, - { func:proto.includes, args:["na", "prim"] }, - { func:proto.join, args:["prim"] }, - { func:proto.lastIndexOf, args:["na", "prim"] }, - { func:proto.map, args:["func"] }, - { func:proto.reduce, args:["func"] }, - { func:proto.reduceRight, args:["func"] }, - { func:proto.set, args:["array", "prim"] }, - { func:proto.slice, args:["prim", "prim"] }, - { func:proto.some, args:["func"] }, - { func:proto.sort, args:["func"] }, - { func:proto.subarray, args:["prim", "prim"] }, -]; - -function defaultForArg(arg, argNum) -{ - if (arg === "func") - return () => { return argNum; } - if (arg === "array") - return [1,2]; - - return argNum; -} - -function callWithArgs(func, array, args, argNum) { - let failed = true; - try { - func.call(array, ...args); - } catch (e) { - if (e != "TypeError: Underlying ArrayBuffer has been detached from the view") - throw new Error(e); - failed = false; - } - if (failed) - throw new Error([func, argNum]); -} - - -function checkArgumentsForType(func, args, constructor) { - let defaultArgs = args.map(defaultForArg); - - for (let argNum = 0; argNum < args.length; argNum++) { - let arg = args[argNum]; - let callArgs = defaultArgs.slice(); - - if (arg === "na") - continue; - - let array = new constructor(10); - if (arg === "func") { - callArgs[argNum] = () => { - transferArrayBuffer(array.buffer); - return func === array.every ? 1 : 0; - }; - callWithArgs(func, array, callArgs, argNum); - } else if (arg === "prim") { - callArgs[argNum] = { [Symbol.toPrimitive]() { - transferArrayBuffer(array.buffer); - return argNum; - } }; - callWithArgs(func, array, callArgs, argNum); - } else if (arg === "array") { - callArgs[argNum] = new Array(4); - callArgs[argNum].fill(2); - let desc = { get: () => { - transferArrayBuffer(array.buffer); - return 1; - } }; - Object.defineProperty(callArgs[argNum], 1, desc); - callWithArgs(func, array, callArgs, argNum); - } else - throw new Error(arg); - } -} - -function checkArguments({func, args}) { - for (constructor of typedArrays) - checkArgumentsForType(func, args, constructor); -} - -function test2() { - prototypeFunctions.forEach(checkArguments); -} - -test2(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-getownproperty-not-configurable.js b/implementation-contributed/javascriptcore/stress/typedarray-getownproperty-not-configurable.js deleted file mode 100644 index 91fbb5d5c3..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-getownproperty-not-configurable.js +++ /dev/null @@ -1,20 +0,0 @@ -typedArrays = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array]; - -function assert(cond) { - if (!cond) - throw new Error("bad assertion!"); -} - -function foo() { - for (constructor of typedArrays) { - let a = new constructor(10); - let b = Object.getOwnPropertyDescriptor(a, 0); - assert(b.value === 0); - assert(b.writable === false); - assert(b.enumerable === true); - assert(b.configurable === false); - } -} - -for (let i = 0; i < 100; i++) - foo(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-getter-on-self.js b/implementation-contributed/javascriptcore/stress/typedarray-getter-on-self.js deleted file mode 100644 index 293a0d37b0..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-getter-on-self.js +++ /dev/null @@ -1,43 +0,0 @@ -// This tests that intrinsics that are attached to self of an object correctly abort -// when the self value is changed. - -(function body() { - function foo(a) { - return a.length; - } - noInline(foo); - - function bar(a) { - return a.byteLength; - } - noInline(bar); - - function baz(a) { - return a.byteOffset; - } - noInline(baz); - - let array = new Int32Array(10); - - let properties = ["length", "byteLength", "byteOffset"]; - properties.map(function(name) { - let getter = Int32Array.prototype.__lookupGetter__(name); - Object.defineProperty(array, name, { get: getter, configurable: true }); - }); - - for (let i = 0; i < 100000; i++) - foo(array); - - properties.map(function(name) { - Object.defineProperty(array, name, { value: null }); - }); - - if (foo(array) !== null) - throw "length should have been null"; - - if (bar(array) !== null) - throw "byteLength should have been null"; - - if (baz(array) !== null) - throw "byteOffset should have been null"; -})(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-hasOwnProperty-out-of-bounds.js b/implementation-contributed/javascriptcore/stress/typedarray-hasOwnProperty-out-of-bounds.js deleted file mode 100644 index 143fb6bab2..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-hasOwnProperty-out-of-bounds.js +++ /dev/null @@ -1,20 +0,0 @@ - -let array = new Float32Array(10); - -function test(array, indicies, result) { - for (let i of indicies) { - if (array.hasOwnProperty(i) !== result) - throw new Error("wrong value for " + i); - if (array.hasOwnProperty(i.toString()) !== result) - throw new Error("wrong value for " + i + " (as String)"); - } -} -noInline(test); - -let interestingIndicies = [0, 1, 2, 8, 9]; -for (let i = 0; i < 10000; i++) - test(array, interestingIndicies, true); - -interestingIndicies = [-1, 10, 100]; -for (let i = 0; i < 10000; i++) - test(array, interestingIndicies, false); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-includes.js b/implementation-contributed/javascriptcore/stress/typedarray-includes.js deleted file mode 100644 index d6c03af8da..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-includes.js +++ /dev/null @@ -1,10 +0,0 @@ -load("resources/typedarray-test-helper-functions.js"); - -for (constructor of typedArrays) { - let a = new constructor(10); - passed = true; - result = a.includes({ valueOf() { passed = false; return 1; } }); - shouldBeTrue("passed"); - shouldBeFalse("result"); -} -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-indexOf.js b/implementation-contributed/javascriptcore/stress/typedarray-indexOf.js deleted file mode 100644 index 7dd5f001aa..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-indexOf.js +++ /dev/null @@ -1,67 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.prototype.indexOf function" -); - -shouldBe("Int32Array.prototype.indexOf.length", "1"); -shouldBe("Int32Array.prototype.indexOf.name", "'indexOf'"); -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('indexOf')"); -shouldBeTrue("testPrototypeReceivesArray('indexOf', [undefined, this, { }, [ ], true, ''])"); -debug(""); - -debug("testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])"); -debug(""); - -function keepEven(e, i) { - return !(e & 1) || (this.keep ? this.keep === i : false); -} - -var array = [2, 5, 9, 2] - -shouldBeTrue("testPrototypeFunction('indexOf', '(2, -500)', array, 0)"); -shouldBeTrue("testPrototypeFunction('indexOf', '(9, 500)', array, -1)"); -shouldBeTrue("testPrototypeFunction('indexOf', '(2)', array, 0)"); -shouldBeTrue("testPrototypeFunction('indexOf', '(7)', array, -1)"); -shouldBeTrue("testPrototypeFunction('indexOf', '(2, 3)', array, 3)"); -shouldBeTrue("testPrototypeFunction('indexOf', '(2, 2)', array, 3)"); -shouldBeTrue("testPrototypeFunction('indexOf', '(2, 0)', array, 0)"); -shouldBeTrue("testPrototypeFunction('indexOf', '(2, -1)', array, 3)"); -shouldBeTrue("testPrototypeFunction('indexOf', '(2, -2)', array, 3)"); -debug(""); - -debug("Check object coersion"); -for (constructor of typedArrays) { - a = new constructor([0,2,3]); - passed = true; - - shouldBe("a.indexOf({ valueOf() { passed = false; return 1; }})", "-1"); - shouldBeTrue("passed"); - shouldBe("a.indexOf(3, {valueOf: () => -1})", "2"); - - // test we don't coerce non-native values - shouldBe("a.indexOf(\"abc\")", "-1"); - shouldBe("a.indexOf(null)", "-1"); - shouldBe("a.indexOf(undefined)", "-1"); - shouldBe("a.indexOf({1: ''})", "-1"); - shouldBe("a.indexOf(\"\")", "-1"); -} - - -for (constructor of intArrays) { - a = new constructor([0,2,3]); - - shouldBe("a.indexOf(2.0)", "1"); - shouldBe("a.indexOf(2.5)", "-1"); -} - -for (constructor of floatArrays) { - a = new constructor([0,2.0,3.6, NaN, Infinity]); - - shouldBe("a.indexOf(2.0)", "1"); - shouldBe("a.indexOf(2.5)", "-1"); - shouldBe("a.indexOf(3.600001)", "-1"); - shouldBe("a.indexOf(NaN)", "-1"); - shouldBe("a.indexOf(Infinity)", "4"); -} - -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-intrinsic-getters-change-prototype.js b/implementation-contributed/javascriptcore/stress/typedarray-intrinsic-getters-change-prototype.js deleted file mode 100644 index 2e27b6f425..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-intrinsic-getters-change-prototype.js +++ /dev/null @@ -1,39 +0,0 @@ -// This tests that TypedArray length and byteLength correctly dump code when the prototypes move. - -(function body() { - function foo(a) { - return a.length; - } - noInline(foo); - - function bar(a) { - return a.byteLength; - } - noInline(bar); - - function baz(a) { - return a.byteOffset; - } - noInline(baz); - - let array = new Int32Array(15); - - while(numberOfDFGCompiles(foo) < 1) { - foo(array); - bar(array); - baz(array); - } - - Object.setPrototypeOf(array, null); - - let passed = false; - - if (foo(array) !== undefined) - throw "length should have become undefined when the prototype changed"; - if (bar(array) !== undefined) - throw "byteLength should have become undefined when the prototype changed"; - if (baz(array) !== undefined) - throw "byteOffset should have become undefined when the prototype changed"; - - -})(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-lastIndexOf.js b/implementation-contributed/javascriptcore/stress/typedarray-lastIndexOf.js deleted file mode 100644 index c740043242..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-lastIndexOf.js +++ /dev/null @@ -1,64 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.prototype.lastIndexOf function" -); - -shouldBe("Int32Array.prototype.lastIndexOf.length", "1"); -shouldBe("Int32Array.prototype.lastIndexOf.name", "'lastIndexOf'"); -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('lastIndexOf')"); -shouldBeTrue("testPrototypeReceivesArray('lastIndexOf', [undefined, this, { }, [ ], true, ''])"); -debug(""); - -debug("testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])"); -debug(""); - -var array = [2, 5, 9, 2] - -shouldBeTrue("testPrototypeFunction('lastIndexOf', '(2, -500)', array, -1)"); -shouldBeTrue("testPrototypeFunction('lastIndexOf', '(9, 500)', array, 2)"); -shouldBeTrue("testPrototypeFunction('lastIndexOf', '(2)', array, 3)"); -shouldBeTrue("testPrototypeFunction('lastIndexOf', '(5)', array, 1)"); -shouldBeTrue("testPrototypeFunction('lastIndexOf', '(7)', array, -1)"); -shouldBeTrue("testPrototypeFunction('lastIndexOf', '(2, 3)', array, 3)"); -shouldBeTrue("testPrototypeFunction('lastIndexOf', '(2, 2)', array, 0)"); -shouldBeTrue("testPrototypeFunction('lastIndexOf', '(2, 0)', array, 0)"); -shouldBeTrue("testPrototypeFunction('lastIndexOf', '(2, -1)', array, 3)"); -shouldBeTrue("testPrototypeFunction('lastIndexOf', '(2, -2)', array, 0)"); -debug(""); - -debug("Check object coersion"); -for (constructor of typedArrays) { - a = new constructor([0,2,3]); - passed = true; - - shouldBe("a.lastIndexOf({ valueOf() { passed = false; return 1; }})", "-1"); - shouldBeTrue("passed"); - shouldBe("a.lastIndexOf(3, {valueOf: () => 3})", "2"); - - // test we don't coerce non-native values - shouldBe("a.lastIndexOf(\"abc\")", "-1"); - shouldBe("a.lastIndexOf(null)", "-1"); - shouldBe("a.lastIndexOf(undefined)", "-1"); - shouldBe("a.lastIndexOf({1: ''})", "-1"); - shouldBe("a.lastIndexOf(\"\")", "-1"); -} - - -for (constructor of intArrays) { - a = new constructor([0,2,3]); - - shouldBe("a.lastIndexOf(2.0)", "1"); - shouldBe("a.lastIndexOf(2.5)", "-1"); -} - -for (constructor of floatArrays) { - a = new constructor([0,2.0,3.6, NaN, Infinity]); - - shouldBe("a.lastIndexOf(2.0)", "1"); - shouldBe("a.lastIndexOf(2.5)", "-1"); - shouldBe("a.lastIndexOf(3.600001)", "-1"); - shouldBe("a.lastIndexOf(NaN)", "-1"); - shouldBe("a.lastIndexOf(Infinity)", "4"); -} - -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-length-dictionary.js b/implementation-contributed/javascriptcore/stress/typedarray-length-dictionary.js deleted file mode 100644 index 0a1f2dcee1..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-length-dictionary.js +++ /dev/null @@ -1,19 +0,0 @@ -// This tests that we do not inline cache intrinsic getters when the base structure is a dictionary. - -foo = new Int32Array(10); - -function len() { - return foo.length; -} -noInline(len); - -foo.bar = 1; -foo.baz = 2; -delete foo.bar; - -for (i = 0; i < 1000; i++) - len() - -Object.defineProperty(foo, "length", { value: 1 }); -if (len() !== 1) - throw "bad result"; diff --git a/implementation-contributed/javascriptcore/stress/typedarray-map.js b/implementation-contributed/javascriptcore/stress/typedarray-map.js deleted file mode 100644 index 1d9a890d22..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-map.js +++ /dev/null @@ -1,102 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.prototype.map function" -); - -shouldBe("Int32Array.prototype.map.length", "1"); -shouldBe("Int32Array.prototype.map.name", "'map'"); -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('map')"); -shouldBeTrue("testPrototypeReceivesArray('map', [undefined, this, { }, [ ], true, ''])"); -debug(""); - -debug("testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])"); -debug(""); - -debug("1.0 Single Argument Testing"); -function even(e, i) { - return !(e & 1) || (this.change ? this.change.indexOf(i) >= 0 : false); -} -shouldBeTrue("testPrototypeFunction('map', '(even)', [12, 5, 8, 13, 44], [1, 0, 1, 0, 1], [12, 5, 8, 13, 44])"); -shouldBeTrue("testPrototypeFunction('map', '(even)', [11, 54, 18, 13, 1], [0, 1, 1, 0, 0])"); -debug(""); - -debug("2.0 Two Argument Testing"); -var thisValue = { change: [1, 3] }; -shouldBeTrue("testPrototypeFunction('map', '(even, thisValue)', [12, 23, 11, 1, 45], [1, 1, 0, 1, 0])"); -debug(""); - -debug("3.0 Array Element Changing"); -function evenAndChange(e, i, a) { - a[a.length - 1 - i] = 5; - return !(e & 1); -} -shouldBeTrue("testPrototypeFunction('map', '(evenAndChange)', [12, 15, 2, 13, 44], [1, 0, 1, 0, 0], [5, 5, 5, 5, 5])"); -debug(""); - -debug("4.0 Exception Test"); -function isBigEnoughAndException(element, index, array) { - if(index==1) throw "exception from function"; - return (element >= 10); -} -shouldThrow("testPrototypeFunction('map', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], false)"); -debug(""); - -debug("5.0 Wrong Type for Callback Test"); -shouldThrow("testPrototypeFunction('map', '(8)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.map callback must be a function'"); -shouldThrow("testPrototypeFunction('map', '(\"wrong\")', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.map callback must be a function'"); -shouldThrow("testPrototypeFunction('map', '(new Object())', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.map callback must be a function'"); -shouldThrow("testPrototypeFunction('map', '(null)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.map callback must be a function'"); -shouldThrow("testPrototypeFunction('map', '()', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.map callback must be a function'"); -debug(""); - -debug("6.0 Symbol.species Test"); -subclasses = typedArrays.map(function(constructor) { return class extends constructor { } } ); - -function id(x) { return x; } - -function testSpecies(array, constructor) { - let newArray = array.map(id); - return newArray instanceof constructor; -} -shouldBeTrue("forEachTypedArray(subclasses, testSpecies)"); - -Foo = class extends Int32Array { } -subclasses.forEach(function(constructor) { Object.defineProperty(constructor, Symbol.species, { value:Foo, writable:true }); }); -function testSpeciesWithFoo(array, constructor) { - let newArray = array.map(id); - return newArray instanceof Foo; -} -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesWithFoo)"); -debug(""); - -debug("6.1 Symbol.species Test throws"); -subclasses.forEach(function(constructor) { Object.defineProperty(constructor, Symbol.species, { value:1, writable:true }); }); -shouldThrow("forEachTypedArray(subclasses, testSpecies)"); - -subclasses.forEach(function(constructor) { constructor[Symbol.species] = Array; }); -shouldThrow("forEachTypedArray(subclasses, testSpecies)"); -debug(""); - -debug("6.2 Symbol.species Test with Defaults"); -subclasses.forEach(function(constructor) { constructor[Symbol.species] = null; }); -function testSpeciesIsDefault(array, constructor) { - let newArray = array.map(id); - let defaultConstructor = typedArrays[subclasses.indexOf(constructor)]; - return newArray instanceof defaultConstructor; -} - -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesIsDefault)"); - -subclasses.forEach(function(constructor) { constructor[Symbol.species] = undefined; }); -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesIsDefault)"); - -subclasses = typedArrays.map(function(constructor) { return class extends constructor { } } ); -function testSpeciesRemoveConstructor(array, constructor) { - array.constructor = undefined; - let newArray = array.map(id); - let defaultConstructor = typedArrays[subclasses.indexOf(constructor)]; - return newArray instanceof defaultConstructor; -} - -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesRemoveConstructor)"); -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-of.js b/implementation-contributed/javascriptcore/stress/typedarray-of.js deleted file mode 100644 index 0e852dd8c8..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-of.js +++ /dev/null @@ -1,21 +0,0 @@ -load("./resources/typedarray-constructor-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.of function" -); - -shouldBe("Int32Array.of.length", "0"); -shouldBe("Int32Array.of.name", "'of'"); -debug(""); - -debug("testPrototypeFunction has the following arg list (name, args, expected)"); -debug(""); - -shouldBeTrue("testConstructorFunction('of', '()', [])"); -shouldBeTrue("testConstructorFunction('of', '(1)', [1])"); -shouldBeTrue("testConstructorFunction('of', '(1,2,3)', [1,2,3])"); - -shouldThrow("testConstructorFunction('of', '.call(false)', false)", "'TypeError: TypedArray.of requires its this argument to subclass a TypedArray constructor'"); -shouldThrow("testConstructorFunction('of', '.call({})', false)", "'TypeError: TypedArray.of requires its this argument to subclass a TypedArray constructor'"); -shouldThrow("testConstructorFunction('of', '.call([])', false)", "'TypeError: TypedArray.of requires its this argument to subclass a TypedArray constructor'"); - -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-reduce.js b/implementation-contributed/javascriptcore/stress/typedarray-reduce.js deleted file mode 100644 index 39a6da31a4..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-reduce.js +++ /dev/null @@ -1,59 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.prototype.reduce function" -); - -shouldBe("Int32Array.prototype.reduce.length", "1"); -shouldBe("Int32Array.prototype.reduce.name", "'reduce'"); -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('reduce')"); -shouldBeTrue("testPrototypeReceivesArray('reduce', [undefined, this, { }, [ ], true, ''])"); -debug(""); - -debug("testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])"); -debug(""); - -debug("1.0 Single Argument Testing"); -function createArray(acc, e, i, a) { - if (typeof acc !== "object") - acc = [acc]; - acc.push(e); - return acc; -} - -function sum(acc, e, i, a) { return acc + e; } - -shouldBeTrue("testPrototypeFunction('reduce', '(createArray)', [12, 5, 8, 13, 44], [12, 5, 8, 13, 44], [12, 5, 8, 13, 44])"); -shouldBeTrue("testPrototypeFunction('reduce', '(sum)', [1, 2, 3, 4, 5], 15)"); -debug(""); - -debug("2.0 Two Argument Testing"); - -shouldBeTrue("testPrototypeFunction('reduce', '(createArray, [1])', [12, 23, 11, 1, 45], [1, 12, 23, 11, 1, 45], [12, 23, 11, 1, 45])"); -debug(""); - -debug("3.0 Array Element Changing"); -function createArrayAndChange(acc, e, i, a) { - a[a.length - 1 - i] = 5; - acc.push(e); - return acc; -} -shouldBeTrue("testPrototypeFunction('reduce', '(createArrayAndChange, [])', [12, 15, 2, 13, 44], [12, 15, 2, 5, 5], [5, 5, 5, 5, 5])"); -debug(""); - -debug("4.0 Exception Test"); -function isBigEnoughAndException(acc, element, index, array) { - if(index==1) throw "exception from function"; - return (element >= 10); -} -shouldThrow("testPrototypeFunction('reduce', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], false)"); -debug(""); - -debug("5.0 Wrong Type for Callback Test"); -shouldThrow("testPrototypeFunction('reduce', '(8)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.reduce callback must be a function'"); -shouldThrow("testPrototypeFunction('reduce', '(\"wrong\")', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.reduce callback must be a function'"); -shouldThrow("testPrototypeFunction('reduce', '(new Object())', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.reduce callback must be a function'"); -shouldThrow("testPrototypeFunction('reduce', '(null)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.reduce callback must be a function'"); -shouldThrow("testPrototypeFunction('reduce', '()', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.reduce callback must be a function'"); -shouldThrow("testPrototypeFunction('reduce', '(new Function())', [], false)", "'TypeError: TypedArray.prototype.reduce of empty array with no initial value'"); -debug(""); -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-reduceRight.js b/implementation-contributed/javascriptcore/stress/typedarray-reduceRight.js deleted file mode 100644 index d5db3c7b6e..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-reduceRight.js +++ /dev/null @@ -1,59 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.prototype.reduceRight function" -); - -shouldBe("Int32Array.prototype.reduceRight.length", "1"); -shouldBe("Int32Array.prototype.reduceRight.name", "'reduceRight'"); -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('reduceRight')"); -shouldBeTrue("testPrototypeReceivesArray('reduceRight', [undefined, this, { }, [ ], true, ''])"); -debug(""); - -debug("testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])"); -debug(""); - -debug("1.0 Single Argument Testing"); -function createArray(acc, e, i, a) { - if (typeof acc !== "object") - acc = [acc]; - acc.push(e); - return acc; -} - -function sum(acc, e, i, a) { return acc + e; } - -shouldBeTrue("testPrototypeFunction('reduceRight', '(createArray)', [12, 5, 8, 13, 44], [12, 5, 8, 13, 44].reverse(), [12, 5, 8, 13, 44])"); -shouldBeTrue("testPrototypeFunction('reduceRight', '(sum)', [1, 2, 3, 4, 5], 15)"); -debug(""); - -debug("2.0 Two Argument Testing"); - -shouldBeTrue("testPrototypeFunction('reduceRight', '(createArray, [1])', [12, 23, 11, 1, 45], [1, 45, 1, 11, 23, 12], [12, 23, 11, 1, 45])"); -debug(""); - -debug("3.0 Array Element Changing"); -function createArrayAndChange(acc, e, i, a) { - a[a.length - 1 - i] = 5; - acc.push(e); - return acc; -} -shouldBeTrue("testPrototypeFunction('reduceRight', '(createArrayAndChange, [])', [12, 15, 2, 13, 44], [44, 13, 2, 5, 5], [5, 5, 5, 5, 5])"); -debug(""); - -debug("4.0 Exception Test"); -function isBigEnoughAndException(acc, element, index, array) { - if(index==1) throw "exception from function"; - return (element >= 10); -} -shouldThrow("testPrototypeFunction('reduceRight', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], false)"); -debug(""); - -debug("5.0 Wrong Type for Callback Test"); -shouldThrow("testPrototypeFunction('reduceRight', '(8)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.reduceRight callback must be a function'"); -shouldThrow("testPrototypeFunction('reduceRight', '(\"wrong\")', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.reduceRight callback must be a function'"); -shouldThrow("testPrototypeFunction('reduceRight', '(new Object())', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.reduceRight callback must be a function'"); -shouldThrow("testPrototypeFunction('reduceRight', '(null)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.reduceRight callback must be a function'"); -shouldThrow("testPrototypeFunction('reduceRight', '()', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.reduceRight callback must be a function'"); -shouldThrow("testPrototypeFunction('reduceRight', '(new Function())', [], false)", "'TypeError: TypedArray.prototype.reduceRight of empty array with no initial value'"); -debug(""); -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-set.js b/implementation-contributed/javascriptcore/stress/typedarray-set.js deleted file mode 100644 index fac5fc7ced..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-set.js +++ /dev/null @@ -1,27 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description("This test checks the behavior of the TypedArray.prototype.set function"); - -shouldBe("Int32Array.prototype.set.length", "1"); -shouldBe("Int32Array.prototype.set.name", "'set'"); - -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('set')"); -shouldBeTrue("testPrototypeReceivesArray('set', [undefined, this, { }, [ ], true, ''])"); -debug(""); - -debug("1.0 Normal Calls"); -shouldBeTrue("testPrototypeFunction('set', '([2, 3, 4])', [1, 2, 3, 4, 5], undefined, [2, 3, 4, 4, 5])"); -debug("This next should pass because -.1 when converted to an integer is -0"); -shouldBeTrue("testPrototypeFunction('set', '([2, 3, 4], -.1)', [1, 2, 3, 4, 5], undefined, [2, 3, 4, 4, 5])"); -shouldBeTrue("testPrototypeFunction('set', '([2, 3, 4], 2)', [1, 2, 3, 4, 5], undefined, [1, 2, 2, 3, 4])"); -shouldBeTrue("testPrototypeFunction('set', '([], 5)', [1, 2, 3, 4, 5], undefined, [1, 2, 3, 4, 5])"); -shouldBeTrue("testPrototypeFunction('set', '([])', [1, 2, 3, 4, 5], undefined, [1, 2, 3, 4, 5])"); -debug(""); - -debug("2.0 Bad Range Test"); -shouldThrow("testPrototypeFunction('set', '([], -1)', [1, 2, 3, 4, 5], false, false)", "'RangeError: Offset should not be negative'"); -shouldThrow("testPrototypeFunction('set', '([2, 3, 4], -1)', [1, 2, 3, 4, 5], false, false)", "'RangeError: Offset should not be negative'"); -shouldThrow("testPrototypeFunction('set', '([2, 3, 4], -1.23412)', [1, 2, 3, 4, 5], false, false)", "'RangeError: Offset should not be negative'"); -shouldThrow("testPrototypeFunction('set', '([2, 3, 4], 1000)', [1, 2, 3, 4, 5], false, false)", "'RangeError: Range consisting of offset and length are out of bounds'"); -shouldThrow("testPrototypeFunction('set', '([2, 3, 4], 1e42*1.2434325231)', [1, 2, 3, 4, 5], false, false)", "'RangeError: Range consisting of offset and length are out of bounds'"); - -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-slice.js b/implementation-contributed/javascriptcore/stress/typedarray-slice.js deleted file mode 100644 index 99cbba6f6a..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-slice.js +++ /dev/null @@ -1,172 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.prototype.slice function" -); - -shouldBe("Int32Array.prototype.slice.length", "2"); -shouldBe("Int32Array.prototype.slice.name", "'slice'"); -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('slice')"); -shouldBeTrue("testPrototypeReceivesArray('slice', [undefined, this, { }, [ ], true, ''])"); -debug(""); - -debug("testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])"); -debug(""); - -debug("1.0 Test Basic Functionality"); -shouldBeTrue("testPrototypeFunction('slice', '(2, 3)', [12, 5, 8, 13, 44], [8], [12, 5, 8, 13, 44])"); -shouldBeTrue("testPrototypeFunction('slice', '(5, 5)', [12, 5, 8, 13, 44], [])"); -shouldBeTrue("testPrototypeFunction('slice', '(0, 5)', [12, 5, 8, 13, 44], [12, 5, 8, 13, 44])"); -shouldBeTrue("testPrototypeFunction('slice', '()', [12, 5, 8, 13, 44], [12, 5, 8, 13, 44])"); -shouldBeTrue("testPrototypeFunction('slice', '(0, -5)', [12, 5, 8, 13, 44], [])"); -shouldBeTrue("testPrototypeFunction('slice', '(-3, -2)', [12, 5, 8, 13, 44], [8])"); -shouldBeTrue("testPrototypeFunction('slice', '(4, 2)', [12, 5, 8, 13, 44], [])"); -shouldBeTrue("testPrototypeFunction('slice', '(-50, 50)', [12, 5, 8, 13, 44], [12, 5, 8, 13, 44])"); -shouldBeTrue("testPrototypeFunction('slice', '(0, 10)', 100000, [0,0,0,0,0,0,0,0,0,0])"); -debug(""); - -debug("2.0 Preserve Underlying bits"); - -var intView = new Int32Array(5); -intView[0] = -1; -var floatView = new Float32Array(intView.buffer); -floatView = floatView.slice(0,1); -intView = new Int32Array(floatView.buffer); - -shouldBe("intView[0]", "-1"); -debug(""); - -debug("3.0 Creates New Buffer"); - -var intView = new Int32Array(1) -var newView = intView.slice(0,1); -newView[0] = 1; -debug(""); - -shouldBe("intView[0]", "0"); -debug(""); - -debug("4.0 Symbol.species Test"); -subclasses = typedArrays.map(function(constructor) { return class extends constructor { } } ); - -function testSpecies(array, constructor) { - let newArray = array.slice(0, 0); - return newArray instanceof constructor; -} -shouldBeTrue("forEachTypedArray(subclasses, testSpecies)"); - -Foo = class extends Int32Array { } -subclasses.forEach(function(constructor) { Object.defineProperty(constructor, Symbol.species, { value:Foo, writable:true }); }); -function testSpeciesWithFoo(array, constructor) { - let newArray = array.slice(0, 0); - return newArray instanceof Foo; -} -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesWithFoo)"); -debug(""); - -debug("4.1 Symbol.species Test throws"); -subclasses.forEach(function(constructor) { Object.defineProperty(constructor, Symbol.species, { value:1, writable:true }); }); -shouldThrow("forEachTypedArray(subclasses, testSpecies)"); - -subclasses.forEach(function(constructor) { constructor[Symbol.species] = Array; }); -shouldThrow("forEachTypedArray(subclasses, testSpecies)"); -debug(""); - -debug("4.2 Symbol.species Test with Defaults"); -subclasses.forEach(function(constructor) { constructor[Symbol.species] = null; }); -function testSpeciesIsDefault(array, constructor) { - let newArray = array.slice(0, 0); - let defaultConstructor = typedArrays[subclasses.indexOf(constructor)]; - return newArray instanceof defaultConstructor; -} - -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesIsDefault)"); - -subclasses.forEach(function(constructor) { constructor[Symbol.species] = undefined; }); -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesIsDefault)"); - -subclasses = typedArrays.map(function(constructor) { return class extends constructor { } } ); -function testSpeciesRemoveConstructor(array, constructor) { - array.constructor = undefined; - let newArray = array.slice(0, 0); - let defaultConstructor = typedArrays[subclasses.indexOf(constructor)]; - return newArray instanceof defaultConstructor; -} - -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesRemoveConstructor)"); -debug(""); - -debug("5.0 Symbol.species returns a different type"); -buffer = new ArrayBuffer(64); -subclasses.forEach(function(constructor) { Object.defineProperty(constructor, Symbol.species, { value:1, writable:true }); }); - -function setArray(array) { - array[0] = 43; - array[1] = 1.345; - array[3] = NaN; - array[4] = -Infinity; - array[5] = Infinity; - array[6] = -1; - array[7] = -0; - for (let i = 0; i < array.length; i++) - array[i] = 0; - -} - -function testSpeciesWithSameBuffer(unused, constructor) { - return typedArrays.every(function(speciesConstructor) { - constructor[Symbol.species] = function() { return new speciesConstructor(buffer); }; - let array = new constructor(buffer); - let otherArray = new speciesConstructor(buffer); - setArray(array); - for (let i = 0; i < array.length; i++) - otherArray[i] = array[i]; - - let resultString = otherArray.toString(); - - setArray(array); - otherArray = array.slice(0,array.length) - let sliceString = otherArray.toString(); - - if (sliceString === resultString) - return true; - - debug("Symbol.species didn't get the correct result got: " + sliceString + " but wanted: " + resultString); - debug("with initial type: " + constructor.__proto__.name + " and species type " + otherArray.constructor.name); - return false; - }); -} -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesWithSameBuffer)"); - -function testSpeciesWithTransferring(unused, constructor) { - - let array = new constructor(10); - Object.defineProperty(constructor, Symbol.species, { get() { - transferArrayBuffer(array.buffer); - return undefined; - }, configurable: true }); - - try { - array.slice(0,1); - return false; - } catch (e) { } - - array = new constructor(10); - Object.defineProperty(constructor, Symbol.species, { get() { - return function(len) { - let a = new constructor(len); - transferArrayBuffer(a.buffer); - return a; - } - }, configurable: true }); - - try { - array.slice(0,1); - return false; - } catch (e) { } - - return true; -} - -shouldBeTrue("forEachTypedArray(typedArrays, testSpeciesWithTransferring)"); - -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-some.js b/implementation-contributed/javascriptcore/stress/typedarray-some.js deleted file mode 100644 index 013c496852..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-some.js +++ /dev/null @@ -1,56 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.prototype.some function" -); - -shouldBe("Int32Array.prototype.some.length", "1"); -shouldBe("Int32Array.prototype.some.name", "'some'"); -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('some')"); -shouldBeTrue("testPrototypeReceivesArray('some', [undefined, this, { }, [ ], true, ''])"); -debug(""); - -debug("testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])"); -debug(""); - -debug("1.0 Single Argument Testing"); -function isBigEnough(element, index, array) { - if (this.value) - return element >= this.value; - return element >= 10; -} -shouldBeTrue("testPrototypeFunction('some', '(isBigEnough)', [12, 5, 8, 13, 44], true, [12, 5, 8, 13, 44])"); -shouldBeTrue("testPrototypeFunction('some', '(isBigEnough)', [2, 4, 8, 3, 4], false)"); -debug(""); - -debug("2.0 Two Argument Testing"); -var thisValue = { value: 11 }; -shouldBeTrue("testPrototypeFunction('some', '(isBigEnough, thisValue)', [2, 5, 10, 3, 4], false)"); -shouldBeTrue("testPrototypeFunction('some', '(isBigEnough, thisValue)', [12, 54, 82, 13, 44], true)"); -debug(""); - -debug("3.0 Array Element Changing"); -function isBigEnoughAndChange(element, index, array) { - array[array.length - 1 - index] = 5; - return (element >= 10); -} -shouldBeTrue("testPrototypeFunction('some', '(isBigEnoughAndChange)', [2, 5, 1, 13, 44], false, [5, 5, 5, 5, 5])"); -shouldBeTrue("testPrototypeFunction('some', '(isBigEnoughAndChange)', [12, 15, 10, 13, 44], true, [12, 15, 10, 13, 5])"); -debug(""); - -debug("4.0 Exception Test"); -function isBigEnoughAndException(element, index, array) { - if(index==1) throw "exception from function"; - return (element >= 10); -} -shouldBeTrue("testPrototypeFunction('some', '(isBigEnoughAndException)', [12, 15, 10, 13, 44], true)"); -shouldThrow("testPrototypeFunction('some', '(isBigEnoughAndException)', [1, 15, 10, 13, 44], false)"); -debug(""); - -debug("5.0 Wrong Type for Callback Test"); -shouldThrow("testPrototypeFunction('some', '(8)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.some callback must be a function'"); -shouldThrow("testPrototypeFunction('some', '(\"wrong\")', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.some callback must be a function'"); -shouldThrow("testPrototypeFunction('some', '(new Object())', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.some callback must be a function'"); -shouldThrow("testPrototypeFunction('some', '(null)', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.some callback must be a function'"); -shouldThrow("testPrototypeFunction('some', '()', [12, 15, 10, 13, 44], false)", "'TypeError: TypedArray.prototype.some callback must be a function'"); -debug(""); -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-sort.js b/implementation-contributed/javascriptcore/stress/typedarray-sort.js deleted file mode 100644 index 6941e0ad29..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-sort.js +++ /dev/null @@ -1,57 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.prototype.sort function" -); - -shouldBe("Int32Array.prototype.sort.length", "1"); -shouldBe("Int32Array.prototype.sort.name", "'sort'"); -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('sort')"); -shouldBeTrue("testPrototypeReceivesArray('sort', [undefined, this, { }, [ ], true, ''])"); -debug(""); - -debug("testPrototypeFunction has the following arg list (name, args, init, result [ , expectedArray ])"); -debug(""); - -debug("1.0 No Argument Testing"); -shouldBeTrue("testPrototypeFunction('sort', '()', [12, 5, 8, 13, 44], [5, 8, 12, 13, 44], [5, 8, 12, 13, 44])"); -shouldBeTrue("testPrototypeFunction('sort', '()', [2, 4, 8, 3, 4], [2, 3, 4, 4, 8])"); -debug(""); - -debug("1.1 Signed Numbers"); -shouldBeTrue("testPrototypeFunctionOnSigned('sort', '()', [12, -5, 8, -13, 44], [-13, -5, 8, 12, 44])"); -debug(""); - -debug("1.2 Float Numbers"); -shouldBeTrue("testPrototypeFunctionOnFloat('sort', '()', [12, -5, 0, -0, -13, 44], [-13, -5, -0, 0, 12, 44])"); - -debug("1.3 Negative NaNs"); -var buffer = new ArrayBuffer(8); -var intView = new Int32Array(buffer); -var floatView = new Float32Array(buffer); -intView[0] = -1; - -floatView.sort(); -shouldBeTrue("Object.is(floatView[0],0) && Object.is(floatView[1], NaN)"); -debug(""); - -debug("2.0 Custom Function Testing"); -function sortBackwards(a, b) { return b - a; } -shouldBeTrue("testPrototypeFunction('sort', '(sortBackwards)', [2, 5, 10, 3, 4], [10, 5, 4, 3, 2])"); -debug(""); - -debug("3.0 Exception Test"); -var count = 0; -function compareException(a, b) { - if(count++ === 4) throw "exception from function"; - return a < b; -} -shouldThrow("testPrototypeFunction('sort', '(compareException)', [12, 15, 10, 13, 44], true)"); -debug(""); - -debug("4.0 Wrong Type for Callback Test"); -shouldBeTrue("testPrototypeFunction('sort', '(8)', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44])"); -shouldBeTrue("testPrototypeFunction('sort', '(\"wrong\")', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44])"); -shouldBeTrue("testPrototypeFunction('sort', '(new Object())', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44])"); -shouldBeTrue("testPrototypeFunction('sort', '(null)', [12, 15, 10, 13, 44], [10, 12, 13, 15, 44])"); -debug(""); -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-subarray.js b/implementation-contributed/javascriptcore/stress/typedarray-subarray.js deleted file mode 100644 index eb730e4ba4..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-subarray.js +++ /dev/null @@ -1,78 +0,0 @@ -load("./resources/typedarray-test-helper-functions.js"); -description( -"This test checks the behavior of the TypedArray.prototype.subarray function" -); - -shouldBe("Int32Array.prototype.subarray.length", "2"); -shouldBe("Int32Array.prototype.subarray.name", "'subarray'"); -shouldBeTrue("isSameFunctionForEachTypedArrayPrototype('subarray')"); -shouldBeTrue("testPrototypeReceivesArray('subarray', [undefined, this, { }, [ ], true, ''])"); -debug(""); - -debug("1.0 Symbol.species Test"); -subclasses = typedArrays.map(function(constructor) { return class extends constructor { } } ); - -function testSpecies(array, constructor) { - let newArray = array.subarray(0, 0); - return newArray instanceof constructor; -} -shouldBeTrue("forEachTypedArray(subclasses, testSpecies)"); - -Foo = class extends Int32Array { } -subclasses.forEach(function(constructor) { Object.defineProperty(constructor, Symbol.species, { value:Foo, writable:true }); }); -function testSpeciesWithFoo(array, constructor) { - let newArray = array.subarray(0, 0); - return newArray instanceof Foo; -} -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesWithFoo)"); -debug(""); - -debug("4.1 Symbol.species Test throws"); -subclasses.forEach(function(constructor) { Object.defineProperty(constructor, Symbol.species, { value:1, writable:true }); }); -shouldThrow("forEachTypedArray(subclasses, testSpecies)"); - -subclasses.forEach(function(constructor) { constructor[Symbol.species] = Array; }); -shouldThrow("forEachTypedArray(subclasses, testSpecies)"); -debug(""); - -debug("4.2 Symbol.species Test with Defaults"); -subclasses.forEach(function(constructor) { constructor[Symbol.species] = null; }); -function testSpeciesIsDefault(array, constructor) { - let newArray = array.subarray(0, 0); - let defaultConstructor = typedArrays[subclasses.indexOf(constructor)]; - return newArray instanceof defaultConstructor; -} - -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesIsDefault)"); - -subclasses.forEach(function(constructor) { constructor[Symbol.species] = undefined; }); -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesIsDefault)"); - -subclasses = typedArrays.map(function(constructor) { return class extends constructor { } } ); -function testSpeciesRemoveConstructor(array, constructor) { - array.constructor = undefined; - let newArray = array.subarray(0, 0); - let defaultConstructor = typedArrays[subclasses.indexOf(constructor)]; - return newArray instanceof defaultConstructor; -} - -shouldBeTrue("forEachTypedArray(subclasses, testSpeciesRemoveConstructor)"); - -debug("5.0 Coercion First Argument"); -shouldBeTrue("testPrototypeFunction('subarray', '(true)', [1, 2, 3, 4], [2, 3, 4])"); -shouldBeTrue("testPrototypeFunction('subarray', '(\"abc\")', [1, 2, 3, 4], [1, 2, 3, 4])"); -shouldBeTrue("testPrototypeFunction('subarray', '({ valueOf() { return Infinity; } })', [1, 2, 3, 4], [])"); -shouldBeTrue("testPrototypeFunction('subarray', '({ valueOf() { return -0; } })', [1, 2, 3, 4], [1, 2, 3, 4])"); -shouldBeTrue("testPrototypeFunction('subarray', '(null)', [1, 2, 3, 4], [1, 2, 3, 4])"); -shouldBeTrue("testPrototypeFunction('subarray', '(undefined)', [1, 2, 3, 4], [1, 2, 3, 4])"); - -debug("5.1 Coercion Second Argument"); -shouldBeTrue("testPrototypeFunction('subarray', '(0, true)', [1, 2, 3, 4], [1])"); -shouldBeTrue("testPrototypeFunction('subarray', '(0, \"abc\")', [1, 2, 3, 4], [])"); -shouldBeTrue("testPrototypeFunction('subarray', '(0, \"1\")', [1, 2, 3, 4], [1])"); -shouldBeTrue("testPrototypeFunction('subarray', '(0, undefined)', [1, 2, 3, 4], [1, 2, 3, 4])"); -shouldBeTrue("testPrototypeFunction('subarray', '(0, { valueOf() { return Infinity; } })', [1, 2, 3, 4], [1, 2, 3, 4])"); -shouldBeTrue("testPrototypeFunction('subarray', '(0, { valueOf() { return -0; } })', [1, 2, 3, 4], [])"); -shouldBeTrue("testPrototypeFunction('subarray', '(0, null)', [1, 2, 3, 4], [])"); - -finishJSTest(); diff --git a/implementation-contributed/javascriptcore/stress/typedarray-view-string-properties-neutered.js b/implementation-contributed/javascriptcore/stress/typedarray-view-string-properties-neutered.js deleted file mode 100644 index dbf6815b13..0000000000 --- a/implementation-contributed/javascriptcore/stress/typedarray-view-string-properties-neutered.js +++ /dev/null @@ -1,49 +0,0 @@ -typedArrays = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array]; - - -function call(thunk) { - thunk(); -} -noInline(call); - -let name = ["map", "reduce"]; -// First test with every access being neutered. -function test(constructor) { - let array = new constructor(10); - transferArrayBuffer(array.buffer); - for (let i = 0; i < 10000; i++) { - call(() => { - if (array.map !== constructor.prototype.map) - throw new Error(); - }); - call(() => { - if (array[name[i % 2]] !== constructor.prototype[name[i % 2]]) - throw new Error(); - }); - } -} - -for (constructor of typedArrays) { - test(constructor); -} - -// Next test with neutered after tier up. -function test(constructor) { - let array = new constructor(10); - let i = 0; - fnId = () => { - if (array.map !== constructor.prototype.map) - throw new Error(); - }; - fnVal = () => { - if (array[name[i % 2]] !== constructor.prototype[name[i % 2]]) - throw new Error(); - }; - for (; i < 10000; i++) { - call(fnId); - call(fnVal); - } - transferArrayBuffer(array.buffer); - call(fnId); - call(fnVal); -} diff --git a/implementation-contributed/javascriptcore/stress/typeof-dfg-function-or-object.js b/implementation-contributed/javascriptcore/stress/typeof-dfg-function-or-object.js deleted file mode 100644 index 6441112bfb..0000000000 --- a/implementation-contributed/javascriptcore/stress/typeof-dfg-function-or-object.js +++ /dev/null @@ -1,25 +0,0 @@ -function assert(b) { - if (!b) { - throw new Error("Bad") - } -} - -function foo(arg) { - let o; - if (arg) { - o = {}; - } else { - o = function() { } - } - return typeof o; -} -noInline(foo); - -for (let i = 0; i < 10000; i++) { - let bool = !!(i % 2); - let result = foo(bool); - if (bool) - assert(result === "object"); - else - assert(result === "function"); -} diff --git a/implementation-contributed/javascriptcore/stress/typeof-symbol.js b/implementation-contributed/javascriptcore/stress/typeof-symbol.js deleted file mode 100644 index 02dbb05f3a..0000000000 --- a/implementation-contributed/javascriptcore/stress/typeof-symbol.js +++ /dev/null @@ -1,16 +0,0 @@ -(function () { - function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${actual}`); - } - noInline(shouldBe); - - function target() { - var symbol = Symbol("Cocoa"); - shouldBe(typeof symbol, "symbol"); - } - noInline(target); - - for (var i = 0; i < 10000; ++i) - target(); -}()); diff --git a/implementation-contributed/javascriptcore/stress/uint32-comparison-jump.js b/implementation-contributed/javascriptcore/stress/uint32-comparison-jump.js deleted file mode 100644 index 8a6be9f71a..0000000000 --- a/implementation-contributed/javascriptcore/stress/uint32-comparison-jump.js +++ /dev/null @@ -1,141 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function above(a, trap) { - let result = 0; - for (let i = 0; (a >>> 0) > (i >>> 0); ++i) { - result += i; - if (i === trap) - break; - } - return result; -} -noInline(above); - -function aboveOrEqual(a, trap) { - let result = 0; - for (let i = 0; (a >>> 0) >= (i >>> 0); ++i) { - result += i; - if (i === trap) - break; - } - return result; -} -noInline(aboveOrEqual); - -function below(a, trap) { - let result = 0; - for (let i = 0; (i >>> 0) < (a >>> 0); ++i) { - result += i; - if (i === trap) - break; - } - return result; -} -noInline(below); - -function belowOrEqual(a, trap) { - let result = 0; - for (let i = 0; (i >>> 0) <= (a >>> 0); ++i) { - result += i; - if (i === trap) - break; - } - return result; -} -noInline(belowOrEqual); - -function notAbove(a, trap) { - let result = 0; - for (let i = 0; (a >>> 0) > (i >>> 0) && a; ++i) { - result += i; - if (i === trap) - break; - } - return result; -} -noInline(notAbove); - -function notAboveOrEqual(a, trap) { - let result = 0; - for (let i = 0; (a >>> 0) >= (i >>> 0) && a; ++i) { - result += i; - if (i === trap) - break; - } - return result; -} -noInline(notAboveOrEqual); - -function notBelow(a, trap) { - let result = 0; - for (let i = 0; (i >>> 0) < (a >>> 0) && a; ++i) { - result += i; - if (i === trap) - break; - } - return result; -} -noInline(notBelow); - -function notBelowOrEqual(a, trap) { - let result = 0; - for (let i = 0; (i >>> 0) <= (a >>> 0) && a; ++i) { - result += i; - if (i === trap) - break; - } - return result; -} -noInline(notBelowOrEqual); - -for (var i = 0; i < 1e2; ++i) { - shouldBe(above(0, -1), 0); - shouldBe(above(20000, -1), 199990000); - shouldBe(above(-1, 10000), 50005000); -} - -for (var i = 0; i < 1e2; ++i) { - shouldBe(aboveOrEqual(0, -1), 0); - shouldBe(aboveOrEqual(20000, -1), 200010000); - shouldBe(aboveOrEqual(-1, 10000), 50005000); -} - -for (var i = 0; i < 1e2; ++i) { - shouldBe(below(0, -1), 0); - shouldBe(below(20000, -1), 199990000); - shouldBe(below(-1, 10000), 50005000); -} - -for (var i = 0; i < 1e2; ++i) { - shouldBe(belowOrEqual(0, -1), 0); - shouldBe(belowOrEqual(20000, -1), 200010000); - shouldBe(belowOrEqual(-1, 10000), 50005000); -} - -for (var i = 0; i < 1e2; ++i) { - shouldBe(notAbove(0, -1), 0); - shouldBe(notAbove(20000, -1), 199990000); - shouldBe(notAbove(-1, 10000), 50005000); -} - -for (var i = 0; i < 1e2; ++i) { - shouldBe(notAboveOrEqual(0, -1), 0); - shouldBe(notAboveOrEqual(20000, -1), 200010000); - shouldBe(notAboveOrEqual(-1, 10000), 50005000); -} - -for (var i = 0; i < 1e2; ++i) { - shouldBe(notBelow(0, -1), 0); - shouldBe(notBelow(20000, -1), 199990000); - shouldBe(notBelow(-1, 10000), 50005000); -} - -for (var i = 0; i < 1e2; ++i) { - shouldBe(notBelowOrEqual(0, -1), 0); - shouldBe(notBelowOrEqual(20000, -1), 200010000); - shouldBe(notBelowOrEqual(-1, 10000), 50005000); -} - diff --git a/implementation-contributed/javascriptcore/stress/uint32-comparison.js b/implementation-contributed/javascriptcore/stress/uint32-comparison.js deleted file mode 100644 index 07bec6a698..0000000000 --- a/implementation-contributed/javascriptcore/stress/uint32-comparison.js +++ /dev/null @@ -1,88 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function above(a, b) { - return (a >>> 0) > (b >>> 0); -} -noInline(above); - -function aboveOrEqual(a, b) { - return (a >>> 0) >= (b >>> 0); -} -noInline(aboveOrEqual); - -function below(a, b) { - return (a >>> 0) < (b >>> 0); -} -noInline(below); - -function belowOrEqual(a, b) { - return (a >>> 0) <= (b >>> 0); -} -noInline(belowOrEqual); - -(function aboveTest() { - for (let i = 0; i < 1e5; ++i) { - shouldBe(above(0, 20), false); - shouldBe(above(0, 0), false); - shouldBe(above(0, -0), false); - shouldBe(above(-1, 0), true); - shouldBe(above(-1, -1), false); - shouldBe(above(-1, 1), true); - shouldBe(above(1, -1), false); - shouldBe(above(1, 0xffffffff), false); - shouldBe(above(0xffffffff, 0xffffffff), false); - shouldBe(above(-1, 0xffffffff), false); - shouldBe(above(-1, 0xfffffffff), false); - } -}()); - -(function aboveOrEqualTest() { - for (let i = 0; i < 1e5; ++i) { - shouldBe(aboveOrEqual(0, 20), false); - shouldBe(aboveOrEqual(0, 0), true); - shouldBe(aboveOrEqual(0, -0), true); - shouldBe(aboveOrEqual(-1, 0), true); - shouldBe(aboveOrEqual(-1, -1), true); - shouldBe(aboveOrEqual(-1, 1), true); - shouldBe(aboveOrEqual(1, -1), false); - shouldBe(aboveOrEqual(1, 0xffffffff), false); - shouldBe(aboveOrEqual(0xffffffff, 0xffffffff), true); - shouldBe(aboveOrEqual(-1, 0xffffffff), true); - shouldBe(aboveOrEqual(-1, 0xfffffffff), true); - } -}()); - -(function belowTest() { - for (let i = 0; i < 1e5; ++i) { - shouldBe(below(0, 20), true); - shouldBe(below(0, 0), false); - shouldBe(below(0, -0), false); - shouldBe(below(-1, 0), false); - shouldBe(below(-1, -1), false); - shouldBe(below(-1, 1), false); - shouldBe(below(1, -1), true); - shouldBe(below(1, 0xffffffff), true); - shouldBe(below(0xffffffff, 0xffffffff), false); - shouldBe(below(-1, 0xffffffff), false); - shouldBe(below(-1, 0xfffffffff), false); - } -}()); - -(function belowOrEqualTest() { - for (let i = 0; i < 1e5; ++i) { - shouldBe(belowOrEqual(0, 20), true); - shouldBe(belowOrEqual(0, 0), true); - shouldBe(belowOrEqual(0, -0), true); - shouldBe(belowOrEqual(-1, 0), false); - shouldBe(belowOrEqual(-1, -1), true); - shouldBe(belowOrEqual(-1, 1), false); - shouldBe(belowOrEqual(1, -1), true); - shouldBe(belowOrEqual(1, 0xffffffff), true); - shouldBe(belowOrEqual(0xffffffff, 0xffffffff), true); - shouldBe(belowOrEqual(-1, 0xffffffff), true); - shouldBe(belowOrEqual(-1, 0xfffffffff), true); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/uint32-to-number-constant-folding.js b/implementation-contributed/javascriptcore/stress/uint32-to-number-constant-folding.js deleted file mode 100644 index ce0587a070..0000000000 --- a/implementation-contributed/javascriptcore/stress/uint32-to-number-constant-folding.js +++ /dev/null @@ -1,84 +0,0 @@ -function uint32ToNumberMinusOne() -{ - return (-1) >>> 0; -} -noInline(uint32ToNumberMinusOne); - -function uint32ToNumberMinusOnePlusInteger(a) -{ - return ((-1) >>> 0) + a; -} -noInline(uint32ToNumberMinusOnePlusInteger); - -function inlineMinusOne() -{ - return -1; -} - -function uint32ToNumberOnHiddenMinusOne() -{ - return inlineMinusOne() >>> 0; -} -noInline(uint32ToNumberOnHiddenMinusOne); - -function uint32ToNumberOnHiddenMinusOnePlusInteger(a) -{ - return (inlineMinusOne() >>> 0) + a; -} -noInline(uint32ToNumberOnHiddenMinusOnePlusInteger); - -function inlineLargeNegativeNumber1() -{ - return -2251799813685248; -} - -function inlineLargeNegativeNumber2() -{ - return -2251799813685249; -} - -function inlineLargeNegativeNumber3() -{ - return -2251799813685250; -} - -function uint32ToNumberOnHiddenLargeNegativeNumber1() -{ - return inlineLargeNegativeNumber1() >>> 0; -} -noInline(uint32ToNumberOnHiddenLargeNegativeNumber1); - -function uint32ToNumberOnHiddenLargeNegativeNumber2() -{ - return inlineLargeNegativeNumber2() >>> 0; -} -noInline(uint32ToNumberOnHiddenLargeNegativeNumber2); - -function uint32ToNumberOnHiddenLargeNegativeNumber3() -{ - return inlineLargeNegativeNumber3() >>> 0; -} -noInline(uint32ToNumberOnHiddenLargeNegativeNumber3); - -for (let i = 0; i < 1e6; ++i) { - if (uint32ToNumberMinusOne() !== 4294967295) - throw "Failed uint32ToNumberMinusOne()"; - - if (uint32ToNumberMinusOnePlusInteger(1) !== 4294967296) - throw "Failed uint32ToNumberMinusOnePlusOne()"; - - if (uint32ToNumberOnHiddenMinusOne() !== 4294967295) - throw "Failed uint32ToNumberOnHiddenMinusOne()"; - - if (uint32ToNumberOnHiddenMinusOnePlusInteger(1) !== 4294967296) - throw "Failed uint32ToNumberOnHiddenMinusOnePlusInteger()"; - - if (uint32ToNumberOnHiddenLargeNegativeNumber1() !== 0) - throw "Failed uint32ToNumberOnHiddenLargeNegativeNumber1()"; - - if (uint32ToNumberOnHiddenLargeNegativeNumber2() !== 4294967295) - throw "Failed uint32ToNumberOnHiddenLargeNegativeNumber2()"; - - if (uint32ToNumberOnHiddenLargeNegativeNumber3() !== 4294967294) - throw "Failed uint32ToNumberOnHiddenLargeNegativeNumber3()"; -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/uint32-to-number-fold-constant-with-do-overflow.js b/implementation-contributed/javascriptcore/stress/uint32-to-number-fold-constant-with-do-overflow.js deleted file mode 100644 index cedea943f3..0000000000 --- a/implementation-contributed/javascriptcore/stress/uint32-to-number-fold-constant-with-do-overflow.js +++ /dev/null @@ -1,27 +0,0 @@ -function foo(a, b) { - return a >>> b; -} - -function bar(a, b) { - return foo(a, b); -} - -noInline(bar); - -for (var i = 0; i < 1000000; ++i) { - var result = bar(-1, 0); - if (result != 4294967295) - throw "Error: bad result: " + result; -} - -function baz(a) { - return foo(a, 1); -} - -noInline(baz); - -for (var i = 0; i < 1000000; ++i) { - var result = baz(-1); - if (result != 2147483647) - throw "Error: bad result: " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/uint32-to-number-overflows-to-uint52.js b/implementation-contributed/javascriptcore/stress/uint32-to-number-overflows-to-uint52.js deleted file mode 100644 index 4885dd8580..0000000000 --- a/implementation-contributed/javascriptcore/stress/uint32-to-number-overflows-to-uint52.js +++ /dev/null @@ -1,50 +0,0 @@ -function simpleArith(number) -{ - return (number >>> 0) + 1; -} -noInline(simpleArith); - -for (let i = 0; i < 1e6; ++i) { - let simpleArithResult = simpleArith(i); - if (simpleArithResult !== i + 1) - throw "Failed simpleArith(i) at i = " + i; - - simpleArithResult = simpleArith(2147483647); - if (simpleArithResult !== 2147483648) - throw "Failed simpleArith(2147483647)"; - - simpleArithResult = simpleArith(-1); - if (simpleArithResult !== 4294967296) - throw "Failed simpleArith(-1) at i = " + i; -} - -// Make it OSR Exit. -if (simpleArith({ valueOf: function() { return 5; }}) !== 6) - throw "Failed simpleArith({ toValue: function() { return 5; }}"; -if (simpleArith("WebKit!") !== 1) - throw "Failed simpleArith({ toValue: function() { return 5; }}"; - - -function compareToLargeNumber(value) -{ - return (value >>> 0) < 4294967294; -} -noInline(compareToLargeNumber); - -for (let i = 0; i < 1e6; ++i) { - let compareResult = compareToLargeNumber(i); - if (compareResult !== true) - throw "Failed compareToLargeNumber(i) at i = " + i; - - compareResult = compareToLargeNumber(-3); - if (compareResult !== true) - throw "Failed compareToLargeNumber(4294967293) at i = " + i; - - compareResult = compareToLargeNumber(-2); - if (compareResult !== false) - throw "Failed compareToLargeNumber(4294967294) at i = " + i; - - compareResult = compareToLargeNumber(-1); - if (compareResult !== false) - throw "Failed compareToLargeNumber(4294967295) at i = " + i; -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/uint32array-unsigned-load.js b/implementation-contributed/javascriptcore/stress/uint32array-unsigned-load.js deleted file mode 100644 index 14c795949c..0000000000 --- a/implementation-contributed/javascriptcore/stress/uint32array-unsigned-load.js +++ /dev/null @@ -1,15 +0,0 @@ -function foo(a) { - return a[0] + 1; -} - -noInline(foo); - -var a = new Uint32Array(1); -a[0] = -1; - -for (var i = 0; i < 10000; ++i) { - var result = foo(a); - if (result != 4294967296) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/undecided-concat.js b/implementation-contributed/javascriptcore/stress/undecided-concat.js deleted file mode 100644 index 77fc0153ea..0000000000 --- a/implementation-contributed/javascriptcore/stress/undecided-concat.js +++ /dev/null @@ -1,8 +0,0 @@ -// This is guaranteed to scribble free cells. -//@ runNoCJITValidate - -var result = (new Array(64).concat(new Array(64))).concat(["hello"]); - -var value = result[0]; -if (value !== void 0) - throw "Error: bad result: " + value; diff --git a/implementation-contributed/javascriptcore/stress/undecided-length.js b/implementation-contributed/javascriptcore/stress/undecided-length.js deleted file mode 100644 index 8bd8e901b8..0000000000 --- a/implementation-contributed/javascriptcore/stress/undecided-length.js +++ /dev/null @@ -1,25 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -var array = []; - -function test1(array) -{ - return array.length; -} -noInline(test1); -for (var i = 0; i < 1e5; ++i) - shouldBe(test1(array), 0); - -var array = []; -array.ok = 42; - -function test2(array) -{ - return array.length; -} -noInline(test2); -for (var i = 0; i < 1e5; ++i) - shouldBe(test2(array), 0); diff --git a/implementation-contributed/javascriptcore/stress/undefined-access-dictionary-then-proto-change.js b/implementation-contributed/javascriptcore/stress/undefined-access-dictionary-then-proto-change.js deleted file mode 100644 index 96fefa47d9..0000000000 --- a/implementation-contributed/javascriptcore/stress/undefined-access-dictionary-then-proto-change.js +++ /dev/null @@ -1,17 +0,0 @@ -function foo() { - var p = {}; - var o = {}; - o.__proto__ = p; - var result; - for (var i = 0; i < 100; ++i) { - result = o.f; - if (i == 50) - p.f = 42; - } - return result; -} - -var result = foo(); -if (result != 42) - throw "Error: bad result: " + result; - diff --git a/implementation-contributed/javascriptcore/stress/undefined-access-then-proto-change.js b/implementation-contributed/javascriptcore/stress/undefined-access-then-proto-change.js deleted file mode 100644 index e04b63cf8f..0000000000 --- a/implementation-contributed/javascriptcore/stress/undefined-access-then-proto-change.js +++ /dev/null @@ -1,19 +0,0 @@ -function foo(o) { - return o.f; -} - -noInline(foo); - -var p = {}; -var o = Object.create(p); - -for (var i = 0; i < 10000; ++i) { - var result = foo(o); - if (result !== void 0) - throw "Error: bad result in loop: " + result; -} - -p.f = 42; -var result = foo(o); -if (result !== 42) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/undefined-access-then-self-change.js b/implementation-contributed/javascriptcore/stress/undefined-access-then-self-change.js deleted file mode 100644 index 685ab10020..0000000000 --- a/implementation-contributed/javascriptcore/stress/undefined-access-then-self-change.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo(o) { - return o.f; -} - -noInline(foo); - -var o = Object.create(null); - -for (var i = 0; i < 10000; ++i) { - var result = foo(o); - if (result !== void 0) - throw "Error: bad result in loop: " + result; -} - -o.f = 42 -var result = foo(o); -if (result !== 42) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/unescape.js b/implementation-contributed/javascriptcore/stress/unescape.js deleted file mode 100644 index f8c1524348..0000000000 --- a/implementation-contributed/javascriptcore/stress/unescape.js +++ /dev/null @@ -1,7 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -shouldBe(unescape("%0"), "%0"); -shouldBe(unescape("%a"), "%a"); diff --git a/implementation-contributed/javascriptcore/stress/unscopables.js b/implementation-contributed/javascriptcore/stress/unscopables.js deleted file mode 100644 index a6efd36cfd..0000000000 --- a/implementation-contributed/javascriptcore/stress/unscopables.js +++ /dev/null @@ -1,239 +0,0 @@ -function test(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - var array = []; - var unscopables = array[Symbol.unscopables]; - - test(typeof unscopables, "object"); - test(unscopables.__proto__, undefined); - test(String(Object.keys(unscopables).sort()), "copyWithin,entries,fill,find,findIndex,includes,keys,values"); -}()); - -(function () { - var find = "Cocoa"; - var forEach = "Hidden"; - var array = []; - test(typeof array.find, "function"); - - with (array) { - test(typeof find, "string"); - test(find, "Cocoa"); - test(typeof forEach, "function"); - test(__proto__, Array.prototype); // array's unscopables.__proto__ is undefined => false. - } -}()); - -(function () { - var object = { - [Symbol.unscopables]: { - Cocoa: false, - Cappuccino: true - }, - - Cocoa: null, - Cappuccino: null - }; - - var Cocoa = "Cocoa"; - var Cappuccino = "Cappuccino"; - var toString = "toString"; - - with (object) { - test(Cocoa, null); - test(Cappuccino, "Cappuccino"); - test(toString, "toString"); // object.toString is hidden by unscopables.toString. - } - - object[Symbol.unscopables].Cocoa = true; - - with (object) { - test(Cocoa, "Cocoa"); - test(Cappuccino, "Cappuccino"); - } -}()); - -(function () { - var unscopables = Object.create(null); - unscopables.Cocoa = false; - unscopables.Cappuccino = true; - - var object = { - [Symbol.unscopables]: unscopables, - Cocoa: null, - Cappuccino: null, - Matcha: null - }; - - var Cocoa = "Cocoa"; - var Cappuccino = "Cappuccino"; - var Matcha = "Matcha"; - var toString = "toString"; - - with (object) { - test(Cocoa, null); - test(Cappuccino, "Cappuccino"); - test(Matcha, null); - test(toString, Object.prototype.toString); - } - - object[Symbol.unscopables].Cocoa = true; - object[Symbol.unscopables].Cappuccino = false; - object[Symbol.unscopables].toString = true; - - with (object) { - test(Cocoa, "Cocoa"); - test(Cappuccino, null); - test(toString, "toString"); - test(Matcha, null); - } -}()); - -(function () { - var proto = Object.create(null); - var unscopables = Object.create(proto); - unscopables.Cocoa = false; - unscopables.Cappuccino = true; - - var object = { - [Symbol.unscopables]: unscopables, - Cocoa: null, - Cappuccino: null, - Matcha: null - }; - - var Cocoa = "Cocoa"; - var Cappuccino = "Cappuccino"; - var Matcha = "Matcha"; - var toString = "toString"; - - with (object) { - test(Cocoa, null); - test(Cappuccino, "Cappuccino"); - test(Matcha, null); - test(toString, Object.prototype.toString); - } - - object[Symbol.unscopables].Cocoa = true; - object[Symbol.unscopables].Cappuccino = false; - object[Symbol.unscopables].toString = true; - - with (object) { - test(Cocoa, "Cocoa"); - test(Cappuccino, null); - test(toString, "toString"); - test(Matcha, null); - } - - proto.Matcha = true; - - with (object) { - test(Cocoa, "Cocoa"); - test(Cappuccino, null); - test(toString, "toString"); - test(Matcha, "Matcha"); - } -}()); - -(function () { - var object = { - get Cocoa() { - throw new Error("bad trap"); - }, - Cappuccino: null - }; - - object[Symbol.unscopables] = { - Cocoa: true, - Cappuccino: true - }; - - var Cocoa = "Cocoa"; - var Cappuccino = "Cappuccino"; - var toString = "toString"; - - with (object) { - test(Cocoa, "Cocoa"); - } - - object[Symbol.unscopables].Cocoa = false; - - var error = null; - try { - with (object) { - Cocoa; - } - } catch (e) { - error = e; - } - test(String(error), "Error: bad trap"); -}()); - -(function () { - var object = { - Cocoa: null, - }; - Object.defineProperty(object, Symbol.unscopables, { - get: function () { - throw new Error("unscopables trap"); - } - }); - - var Cocoa = "Cocoa"; - var Cappuccino = "Cappuccino"; - - var error = null; - try { - with (object) { - Cocoa - } - } catch (e) { - error = e; - } - test(String(error), "Error: unscopables trap"); - - with (object) { - test(Cappuccino, "Cappuccino"); - } -}()); - -(function () { - var object = { - [Symbol.unscopables]: { - get Cocoa() { - throw new Error("unscopables trap"); - } - }, - Cocoa: null, - }; - var Cocoa = "Cocoa"; - var Cappuccino = "Cappuccino"; - - var error = null; - try { - with (object) { - Cocoa - } - } catch (e) { - error = e; - } - test(String(error), "Error: unscopables trap"); - - with (object) { - test(Cappuccino, "Cappuccino"); - } -}()); - -(function () { - var object = { - [Symbol.unscopables]: 42, - Cocoa: "OK", - }; - var Cocoa = "Cocoa"; - - with (object) { - test(Cocoa, "OK"); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/unshift-array-storage.js b/implementation-contributed/javascriptcore/stress/unshift-array-storage.js deleted file mode 100644 index a4f9fb4eef..0000000000 --- a/implementation-contributed/javascriptcore/stress/unshift-array-storage.js +++ /dev/null @@ -1,13 +0,0 @@ -// FIXME: Bring back something like the deferGC probability mode. -// https://bugs.webkit.org/show_bug.cgi?id=166627 -//@ skip -// //@ runFTLNoCJIT("--scribbleFreeCells=true", "--deferGCShouldCollectWithProbability=true", "--deferGCProbability=1") - -// Create some array storage. -var array = []; -ensureArrayStorage(array); - -for (var i = 0; i < 1000; ++i) - array.push(i); - -array.unshift(1, 2, 3, 4); // This will crash if we aren't careful about when we GC during unshift. diff --git a/implementation-contributed/javascriptcore/stress/unshiftCountSlowCase-correct-postCapacity.js b/implementation-contributed/javascriptcore/stress/unshiftCountSlowCase-correct-postCapacity.js deleted file mode 100644 index f1efbf5f55..0000000000 --- a/implementation-contributed/javascriptcore/stress/unshiftCountSlowCase-correct-postCapacity.js +++ /dev/null @@ -1,26 +0,0 @@ -//@ if $buildType == "release" && !$memoryLimited then runDefault else skip end - -function temp(i) { - let a1 = [{}]; - a1.foo = 20; - a1.foo1 = 20; - a1.foo2 = 20; - a1.foo3 = 20; - a1.foo4 = 20; - a1.foo5 = 20; - a1.foo6 = 20; - a1.foo8 = 20; - a1.foo10 = 20; - a1.foo11 = 20; - delete a1[0]; - try { - let args = [-15, 1, 'foo', 20, 'bar']; - for (let j = 0; j < i; ++j) - args.push(j); - for (let i = 0; i < 2**31 - 1; ++i) { - Array.prototype.splice.apply(a1, args); - } - } catch(e) { } -} -let i = 62; -temp(i); diff --git a/implementation-contributed/javascriptcore/stress/untyped-add.js b/implementation-contributed/javascriptcore/stress/untyped-add.js deleted file mode 100644 index 00cf16878e..0000000000 --- a/implementation-contributed/javascriptcore/stress/untyped-add.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a + b; -} - -noInline(foo); - -var things = [1, 2.5, "3", {valueOf: function() { return 4; }}]; -var results = [2, 3.5, "31", 5]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 1); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/untyped-bit-and.js b/implementation-contributed/javascriptcore/stress/untyped-bit-and.js deleted file mode 100644 index 8c952240a8..0000000000 --- a/implementation-contributed/javascriptcore/stress/untyped-bit-and.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a & b; -} - -noInline(foo); - -var things = [1, 2.5, "3", {valueOf: function() { return 4; }}]; -var results = [0, 2, 2, 0]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 2); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/untyped-bit-or.js b/implementation-contributed/javascriptcore/stress/untyped-bit-or.js deleted file mode 100644 index 1160a928f8..0000000000 --- a/implementation-contributed/javascriptcore/stress/untyped-bit-or.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a | b; -} - -noInline(foo); - -var things = [1, 2.5, "3", {valueOf: function() { return 4; }}]; -var results = [3, 2, 3, 6]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 2); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/untyped-bit-xor.js b/implementation-contributed/javascriptcore/stress/untyped-bit-xor.js deleted file mode 100644 index 3b11fab2e6..0000000000 --- a/implementation-contributed/javascriptcore/stress/untyped-bit-xor.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a ^ b; -} - -noInline(foo); - -var things = [1, 2.5, "3", {valueOf: function() { return 4; }}]; -var results = [3, 0, 1, 6]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 2); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/untyped-div.js b/implementation-contributed/javascriptcore/stress/untyped-div.js deleted file mode 100644 index d1b74d8b9c..0000000000 --- a/implementation-contributed/javascriptcore/stress/untyped-div.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a / b; -} - -noInline(foo); - -var things = [1, 2.5, "3", {valueOf: function() { return 4; }}]; -var results = [0.5, 1.25, 1.5, 2]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 2); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/untyped-equality.js b/implementation-contributed/javascriptcore/stress/untyped-equality.js deleted file mode 100644 index 093761b1f6..0000000000 --- a/implementation-contributed/javascriptcore/stress/untyped-equality.js +++ /dev/null @@ -1,20 +0,0 @@ -function foo(a, b) { - return a == b; -} - -noInline(foo); - -var data = [ - [5, 6.5, false], - ["foo", "bar", false], - [true, false, false], - ["42", 42, true], - [1.2, 1.2, true] -]; - -for (var i = 0; i < 100000; ++i) { - var test = data[i % data.length]; - var result = foo(test[0], test[1]); - if (result != test[2]) - throw "Error: bad result for " + test + ": " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/untyped-less-than.js b/implementation-contributed/javascriptcore/stress/untyped-less-than.js deleted file mode 100644 index c37f36715d..0000000000 --- a/implementation-contributed/javascriptcore/stress/untyped-less-than.js +++ /dev/null @@ -1,23 +0,0 @@ -function foo(a, b) { - return a < b; -} - -noInline(foo); - -var data = [ - [5, 6.5, true], - ["foo", "bar", false], - [true, false, false], - [false, true, true], - ["42", 42, false], - [1.2, 1.2, false], - ["-1", 1, true], - [-1, "1", true] -]; - -for (var i = 0; i < 100000; ++i) { - var test = data[i % data.length]; - var result = foo(test[0], test[1]); - if (result != test[2]) - throw "Error: bad result for " + test + ": " + result; -} diff --git a/implementation-contributed/javascriptcore/stress/untyped-lshift.js b/implementation-contributed/javascriptcore/stress/untyped-lshift.js deleted file mode 100644 index 9b8b866b07..0000000000 --- a/implementation-contributed/javascriptcore/stress/untyped-lshift.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a << b; -} - -noInline(foo); - -var things = [1, 2.5, "3", {valueOf: function() { return 4; }}]; -var results = [2, 4, 6, 8]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 1); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/untyped-mul.js b/implementation-contributed/javascriptcore/stress/untyped-mul.js deleted file mode 100644 index 90af2dc378..0000000000 --- a/implementation-contributed/javascriptcore/stress/untyped-mul.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a * b; -} - -noInline(foo); - -var things = [1, 2.5, "3", {valueOf: function() { return 4; }}]; -var results = [2, 5, 6, 8]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 2); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/untyped-rshift.js b/implementation-contributed/javascriptcore/stress/untyped-rshift.js deleted file mode 100644 index 9222dceb99..0000000000 --- a/implementation-contributed/javascriptcore/stress/untyped-rshift.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a >> b; -} - -noInline(foo); - -var things = [1, 2.5, "3", {valueOf: function() { return 4; }}]; -var results = [0, 1, 1, 2]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 1); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/untyped-sub.js b/implementation-contributed/javascriptcore/stress/untyped-sub.js deleted file mode 100644 index bd128b6305..0000000000 --- a/implementation-contributed/javascriptcore/stress/untyped-sub.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a - b; -} - -noInline(foo); - -var things = [1, 2.5, "3", {valueOf: function() { return 4; }}]; -var results = [0, 1.5, 2, 3]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 1); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/untyped-urshift.js b/implementation-contributed/javascriptcore/stress/untyped-urshift.js deleted file mode 100644 index 756c24f1eb..0000000000 --- a/implementation-contributed/javascriptcore/stress/untyped-urshift.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return a >>> b; -} - -noInline(foo); - -var things = [1, 2.5, "-3", {valueOf: function() { return 4; }}]; -var results = [0, 1, 2147483646, 2]; - -for (var i = 0; i < 100000; ++i) { - var result = foo(things[i % things.length], 1); - var expected = results[i % results.length]; - if (result != expected) - throw "Error: bad result for i = " + i + ": " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/use-arguments-as-object-pointer.js b/implementation-contributed/javascriptcore/stress/use-arguments-as-object-pointer.js deleted file mode 100644 index c9d24c125a..0000000000 --- a/implementation-contributed/javascriptcore/stress/use-arguments-as-object-pointer.js +++ /dev/null @@ -1,13 +0,0 @@ -function foo() { - arguments = {f:42}; - return arguments.f; -} - -noInline(foo); - -for (var i = 0; i < 100000; ++i) { - var result = foo(); - if (result != 42) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/v8-crypto-strict.js b/implementation-contributed/javascriptcore/stress/v8-crypto-strict.js deleted file mode 100644 index c33d7736b4..0000000000 --- a/implementation-contributed/javascriptcore/stress/v8-crypto-strict.js +++ /dev/null @@ -1,1697 +0,0 @@ -"use strict"; - -/* - * Copyright (c) 2003-2005 Tom Wu - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF - * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * In addition, the following condition applies: - * - * All redistributions must retain an intact copy of this copyright notice - * and disclaimer. - */ - -// Basic JavaScript BN library - subset useful for RSA encryption. - -// Bits per digit -var dbits; -var BI_DB; -var BI_DM; -var BI_DV; - -var BI_FP; -var BI_FV; -var BI_F1; -var BI_F2; - -// JavaScript engine analysis -var canary = 0xdeadbeefcafe; -var j_lm = ((canary&0xffffff)==0xefcafe); - -// (public) Constructor -function BigInteger(a,b,c) { - this.array = new Array(); - if(a != null) - if("number" == typeof a) this.fromNumber(a,b,c); - else if(b == null && "string" != typeof a) this.fromString(a,256); - else this.fromString(a,b); -} - -// return new, unset BigInteger -function nbi() { return new BigInteger(null); } - -// am: Compute w_j += (x*this_i), propagate carries, -// c is initial carry, returns final carry. -// c < 3*dvalue, x < 2*dvalue, this_i < dvalue -// We need to select the fastest one that works in this environment. - -// am1: use a single mult and divide to get the high bits, -// max digit bits should be 26 because -// max internal value = 2*dvalue^2-2*dvalue (< 2^53) -function am1(i,x,w,j,c,n) { - var this_array = this.array; - var w_array = w.array; - while(--n >= 0) { - var v = x*this_array[i++]+w_array[j]+c; - c = Math.floor(v/0x4000000); - w_array[j++] = v&0x3ffffff; - } - return c; -} - -// am2 avoids a big mult-and-extract completely. -// Max digit bits should be <= 30 because we do bitwise ops -// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) -function am2(i,x,w,j,c,n) { - var this_array = this.array; - var w_array = w.array; - var xl = x&0x7fff, xh = x>>15; - while(--n >= 0) { - var l = this_array[i]&0x7fff; - var h = this_array[i++]>>15; - var m = xh*l+h*xl; - l = xl*l+((m&0x7fff)<<15)+w_array[j]+(c&0x3fffffff); - c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); - w_array[j++] = l&0x3fffffff; - } - return c; -} - -// Alternately, set max digit bits to 28 since some -// browsers slow down when dealing with 32-bit numbers. -function am3(i,x,w,j,c,n) { - var this_array = this.array; - var w_array = w.array; - - var xl = x&0x3fff, xh = x>>14; - while(--n >= 0) { - var l = this_array[i]&0x3fff; - var h = this_array[i++]>>14; - var m = xh*l+h*xl; - l = xl*l+((m&0x3fff)<<14)+w_array[j]+c; - c = (l>>28)+(m>>14)+xh*h; - w_array[j++] = l&0xfffffff; - } - return c; -} - -// This is tailored to VMs with 2-bit tagging. It makes sure -// that all the computations stay within the 29 bits available. -function am4(i,x,w,j,c,n) { - var this_array = this.array; - var w_array = w.array; - - var xl = x&0x1fff, xh = x>>13; - while(--n >= 0) { - var l = this_array[i]&0x1fff; - var h = this_array[i++]>>13; - var m = xh*l+h*xl; - l = xl*l+((m&0x1fff)<<13)+w_array[j]+c; - c = (l>>26)+(m>>13)+xh*h; - w_array[j++] = l&0x3ffffff; - } - return c; -} - -// am3/28 is best for SM, Rhino, but am4/26 is best for v8. -// Kestrel (Opera 9.5) gets its best result with am4/26. -// IE7 does 9% better with am3/28 than with am4/26. -// Firefox (SM) gets 10% faster with am3/28 than with am4/26. - -var setupEngine = function(fn, bits) { - BigInteger.prototype.am = fn; - dbits = bits; - - BI_DB = dbits; - BI_DM = ((1<<dbits)-1); - BI_DV = (1<<dbits); - - BI_FP = 52; - BI_FV = Math.pow(2,BI_FP); - BI_F1 = BI_FP-dbits; - BI_F2 = 2*dbits-BI_FP; -} - - -// Digit conversions -var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz"; -var BI_RC = new Array(); -var rr,vv; -rr = "0".charCodeAt(0); -for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv; -rr = "a".charCodeAt(0); -for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; -rr = "A".charCodeAt(0); -for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; - -function int2char(n) { return BI_RM.charAt(n); } -function intAt(s,i) { - var c = BI_RC[s.charCodeAt(i)]; - return (c==null)?-1:c; -} - -// (protected) copy this to r -function bnpCopyTo(r) { - var this_array = this.array; - var r_array = r.array; - - for(var i = this.t-1; i >= 0; --i) r_array[i] = this_array[i]; - r.t = this.t; - r.s = this.s; -} - -// (protected) set from integer value x, -DV <= x < DV -function bnpFromInt(x) { - var this_array = this.array; - this.t = 1; - this.s = (x<0)?-1:0; - if(x > 0) this_array[0] = x; - else if(x < -1) this_array[0] = x+DV; - else this.t = 0; -} - -// return bigint initialized to value -function nbv(i) { var r = nbi(); r.fromInt(i); return r; } - -// (protected) set from string and radix -function bnpFromString(s,b) { - var this_array = this.array; - var k; - if(b == 16) k = 4; - else if(b == 8) k = 3; - else if(b == 256) k = 8; // byte array - else if(b == 2) k = 1; - else if(b == 32) k = 5; - else if(b == 4) k = 2; - else { this.fromRadix(s,b); return; } - this.t = 0; - this.s = 0; - var i = s.length, mi = false, sh = 0; - while(--i >= 0) { - var x = (k==8)?s[i]&0xff:intAt(s,i); - if(x < 0) { - if(s.charAt(i) == "-") mi = true; - continue; - } - mi = false; - if(sh == 0) - this_array[this.t++] = x; - else if(sh+k > BI_DB) { - this_array[this.t-1] |= (x&((1<<(BI_DB-sh))-1))<<sh; - this_array[this.t++] = (x>>(BI_DB-sh)); - } - else - this_array[this.t-1] |= x<<sh; - sh += k; - if(sh >= BI_DB) sh -= BI_DB; - } - if(k == 8 && (s[0]&0x80) != 0) { - this.s = -1; - if(sh > 0) this_array[this.t-1] |= ((1<<(BI_DB-sh))-1)<<sh; - } - this.clamp(); - if(mi) BigInteger.ZERO.subTo(this,this); -} - -// (protected) clamp off excess high words -function bnpClamp() { - var this_array = this.array; - var c = this.s&BI_DM; - while(this.t > 0 && this_array[this.t-1] == c) --this.t; -} - -// (public) return string representation in given radix -function bnToString(b) { - var this_array = this.array; - if(this.s < 0) return "-"+this.negate().toString(b); - var k; - if(b == 16) k = 4; - else if(b == 8) k = 3; - else if(b == 2) k = 1; - else if(b == 32) k = 5; - else if(b == 4) k = 2; - else return this.toRadix(b); - var km = (1<<k)-1, d, m = false, r = "", i = this.t; - var p = BI_DB-(i*BI_DB)%k; - if(i-- > 0) { - if(p < BI_DB && (d = this_array[i]>>p) > 0) { m = true; r = int2char(d); } - while(i >= 0) { - if(p < k) { - d = (this_array[i]&((1<<p)-1))<<(k-p); - d |= this_array[--i]>>(p+=BI_DB-k); - } - else { - d = (this_array[i]>>(p-=k))&km; - if(p <= 0) { p += BI_DB; --i; } - } - if(d > 0) m = true; - if(m) r += int2char(d); - } - } - return m?r:"0"; -} - -// (public) -this -function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } - -// (public) |this| -function bnAbs() { return (this.s<0)?this.negate():this; } - -// (public) return + if this > a, - if this < a, 0 if equal -function bnCompareTo(a) { - var this_array = this.array; - var a_array = a.array; - - var r = this.s-a.s; - if(r != 0) return r; - var i = this.t; - r = i-a.t; - if(r != 0) return r; - while(--i >= 0) if((r=this_array[i]-a_array[i]) != 0) return r; - return 0; -} - -// returns bit length of the integer x -function nbits(x) { - var r = 1, t; - if((t=x>>>16) != 0) { x = t; r += 16; } - if((t=x>>8) != 0) { x = t; r += 8; } - if((t=x>>4) != 0) { x = t; r += 4; } - if((t=x>>2) != 0) { x = t; r += 2; } - if((t=x>>1) != 0) { x = t; r += 1; } - return r; -} - -// (public) return the number of bits in "this" -function bnBitLength() { - var this_array = this.array; - if(this.t <= 0) return 0; - return BI_DB*(this.t-1)+nbits(this_array[this.t-1]^(this.s&BI_DM)); -} - -// (protected) r = this << n*DB -function bnpDLShiftTo(n,r) { - var this_array = this.array; - var r_array = r.array; - var i; - for(i = this.t-1; i >= 0; --i) r_array[i+n] = this_array[i]; - for(i = n-1; i >= 0; --i) r_array[i] = 0; - r.t = this.t+n; - r.s = this.s; -} - -// (protected) r = this >> n*DB -function bnpDRShiftTo(n,r) { - var this_array = this.array; - var r_array = r.array; - for(var i = n; i < this.t; ++i) r_array[i-n] = this_array[i]; - r.t = Math.max(this.t-n,0); - r.s = this.s; -} - -// (protected) r = this << n -function bnpLShiftTo(n,r) { - var this_array = this.array; - var r_array = r.array; - var bs = n%BI_DB; - var cbs = BI_DB-bs; - var bm = (1<<cbs)-1; - var ds = Math.floor(n/BI_DB), c = (this.s<<bs)&BI_DM, i; - for(i = this.t-1; i >= 0; --i) { - r_array[i+ds+1] = (this_array[i]>>cbs)|c; - c = (this_array[i]&bm)<<bs; - } - for(i = ds-1; i >= 0; --i) r_array[i] = 0; - r_array[ds] = c; - r.t = this.t+ds+1; - r.s = this.s; - r.clamp(); -} - -// (protected) r = this >> n -function bnpRShiftTo(n,r) { - var this_array = this.array; - var r_array = r.array; - r.s = this.s; - var ds = Math.floor(n/BI_DB); - if(ds >= this.t) { r.t = 0; return; } - var bs = n%BI_DB; - var cbs = BI_DB-bs; - var bm = (1<<bs)-1; - r_array[0] = this_array[ds]>>bs; - for(var i = ds+1; i < this.t; ++i) { - r_array[i-ds-1] |= (this_array[i]&bm)<<cbs; - r_array[i-ds] = this_array[i]>>bs; - } - if(bs > 0) r_array[this.t-ds-1] |= (this.s&bm)<<cbs; - r.t = this.t-ds; - r.clamp(); -} - -// (protected) r = this - a -function bnpSubTo(a,r) { - var this_array = this.array; - var r_array = r.array; - var a_array = a.array; - var i = 0, c = 0, m = Math.min(a.t,this.t); - while(i < m) { - c += this_array[i]-a_array[i]; - r_array[i++] = c&BI_DM; - c >>= BI_DB; - } - if(a.t < this.t) { - c -= a.s; - while(i < this.t) { - c += this_array[i]; - r_array[i++] = c&BI_DM; - c >>= BI_DB; - } - c += this.s; - } - else { - c += this.s; - while(i < a.t) { - c -= a_array[i]; - r_array[i++] = c&BI_DM; - c >>= BI_DB; - } - c -= a.s; - } - r.s = (c<0)?-1:0; - if(c < -1) r_array[i++] = BI_DV+c; - else if(c > 0) r_array[i++] = c; - r.t = i; - r.clamp(); -} - -// (protected) r = this * a, r != this,a (HAC 14.12) -// "this" should be the larger one if appropriate. -function bnpMultiplyTo(a,r) { - var this_array = this.array; - var r_array = r.array; - var x = this.abs(), y = a.abs(); - var y_array = y.array; - - var i = x.t; - r.t = i+y.t; - while(--i >= 0) r_array[i] = 0; - for(i = 0; i < y.t; ++i) r_array[i+x.t] = x.am(0,y_array[i],r,i,0,x.t); - r.s = 0; - r.clamp(); - if(this.s != a.s) BigInteger.ZERO.subTo(r,r); -} - -// (protected) r = this^2, r != this (HAC 14.16) -function bnpSquareTo(r) { - var x = this.abs(); - var x_array = x.array; - var r_array = r.array; - - var i = r.t = 2*x.t; - while(--i >= 0) r_array[i] = 0; - for(i = 0; i < x.t-1; ++i) { - var c = x.am(i,x_array[i],r,2*i,0,1); - if((r_array[i+x.t]+=x.am(i+1,2*x_array[i],r,2*i+1,c,x.t-i-1)) >= BI_DV) { - r_array[i+x.t] -= BI_DV; - r_array[i+x.t+1] = 1; - } - } - if(r.t > 0) r_array[r.t-1] += x.am(i,x_array[i],r,2*i,0,1); - r.s = 0; - r.clamp(); -} - -// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) -// r != q, this != m. q or r may be null. -function bnpDivRemTo(m,q,r) { - var pm = m.abs(); - if(pm.t <= 0) return; - var pt = this.abs(); - if(pt.t < pm.t) { - if(q != null) q.fromInt(0); - if(r != null) this.copyTo(r); - return; - } - if(r == null) r = nbi(); - var y = nbi(), ts = this.s, ms = m.s; - var pm_array = pm.array; - var nsh = BI_DB-nbits(pm_array[pm.t-1]); // normalize modulus - if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } - else { pm.copyTo(y); pt.copyTo(r); } - var ys = y.t; - - var y_array = y.array; - var y0 = y_array[ys-1]; - if(y0 == 0) return; - var yt = y0*(1<<BI_F1)+((ys>1)?y_array[ys-2]>>BI_F2:0); - var d1 = BI_FV/yt, d2 = (1<<BI_F1)/yt, e = 1<<BI_F2; - var i = r.t, j = i-ys, t = (q==null)?nbi():q; - y.dlShiftTo(j,t); - - var r_array = r.array; - if(r.compareTo(t) >= 0) { - r_array[r.t++] = 1; - r.subTo(t,r); - } - BigInteger.ONE.dlShiftTo(ys,t); - t.subTo(y,y); // "negative" y so we can replace sub with am later - while(y.t < ys) y_array[y.t++] = 0; - while(--j >= 0) { - // Estimate quotient digit - var qd = (r_array[--i]==y0)?BI_DM:Math.floor(r_array[i]*d1+(r_array[i-1]+e)*d2); - if((r_array[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out - y.dlShiftTo(j,t); - r.subTo(t,r); - while(r_array[i] < --qd) r.subTo(t,r); - } - } - if(q != null) { - r.drShiftTo(ys,q); - if(ts != ms) BigInteger.ZERO.subTo(q,q); - } - r.t = ys; - r.clamp(); - if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder - if(ts < 0) BigInteger.ZERO.subTo(r,r); -} - -// (public) this mod a -function bnMod(a) { - var r = nbi(); - this.abs().divRemTo(a,null,r); - if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); - return r; -} - -// Modular reduction using "classic" algorithm -function Classic(m) { this.m = m; } -function cConvert(x) { - if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); - else return x; -} -function cRevert(x) { return x; } -function cReduce(x) { x.divRemTo(this.m,null,x); } -function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } -function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } - -Classic.prototype.convert = cConvert; -Classic.prototype.revert = cRevert; -Classic.prototype.reduce = cReduce; -Classic.prototype.mulTo = cMulTo; -Classic.prototype.sqrTo = cSqrTo; - -// (protected) return "-1/this % 2^DB"; useful for Mont. reduction -// justification: -// xy == 1 (mod m) -// xy = 1+km -// xy(2-xy) = (1+km)(1-km) -// x[y(2-xy)] = 1-k^2m^2 -// x[y(2-xy)] == 1 (mod m^2) -// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 -// should reduce x and y(2-xy) by m^2 at each step to keep size bounded. -// JS multiply "overflows" differently from C/C++, so care is needed here. -function bnpInvDigit() { - var this_array = this.array; - if(this.t < 1) return 0; - var x = this_array[0]; - if((x&1) == 0) return 0; - var y = x&3; // y == 1/x mod 2^2 - y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 - y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 - y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 - // last step - calculate inverse mod DV directly; - // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints - y = (y*(2-x*y%BI_DV))%BI_DV; // y == 1/x mod 2^dbits - // we really want the negative inverse, and -DV < y < DV - return (y>0)?BI_DV-y:-y; -} - -// Montgomery reduction -function Montgomery(m) { - this.m = m; - this.mp = m.invDigit(); - this.mpl = this.mp&0x7fff; - this.mph = this.mp>>15; - this.um = (1<<(BI_DB-15))-1; - this.mt2 = 2*m.t; -} - -// xR mod m -function montConvert(x) { - var r = nbi(); - x.abs().dlShiftTo(this.m.t,r); - r.divRemTo(this.m,null,r); - if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); - return r; -} - -// x/R mod m -function montRevert(x) { - var r = nbi(); - x.copyTo(r); - this.reduce(r); - return r; -} - -// x = x/R mod m (HAC 14.32) -function montReduce(x) { - var x_array = x.array; - while(x.t <= this.mt2) // pad x so am has enough room later - x_array[x.t++] = 0; - for(var i = 0; i < this.m.t; ++i) { - // faster way of calculating u0 = x[i]*mp mod DV - var j = x_array[i]&0x7fff; - var u0 = (j*this.mpl+(((j*this.mph+(x_array[i]>>15)*this.mpl)&this.um)<<15))&BI_DM; - // use am to combine the multiply-shift-add into one call - j = i+this.m.t; - x_array[j] += this.m.am(0,u0,x,i,0,this.m.t); - // propagate carry - while(x_array[j] >= BI_DV) { x_array[j] -= BI_DV; x_array[++j]++; } - } - x.clamp(); - x.drShiftTo(this.m.t,x); - if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); -} - -// r = "x^2/R mod m"; x != r -function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } - -// r = "xy/R mod m"; x,y != r -function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } - -Montgomery.prototype.convert = montConvert; -Montgomery.prototype.revert = montRevert; -Montgomery.prototype.reduce = montReduce; -Montgomery.prototype.mulTo = montMulTo; -Montgomery.prototype.sqrTo = montSqrTo; - -// (protected) true iff this is even -function bnpIsEven() { - var this_array = this.array; - return ((this.t>0)?(this_array[0]&1):this.s) == 0; -} - -// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) -function bnpExp(e,z) { - if(e > 0xffffffff || e < 1) return BigInteger.ONE; - var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; - g.copyTo(r); - while(--i >= 0) { - z.sqrTo(r,r2); - if((e&(1<<i)) > 0) z.mulTo(r2,g,r); - else { var t = r; r = r2; r2 = t; } - } - return z.revert(r); -} - -// (public) this^e % m, 0 <= e < 2^32 -function bnModPowInt(e,m) { - var z; - if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); - return this.exp(e,z); -} - -// protected -BigInteger.prototype.copyTo = bnpCopyTo; -BigInteger.prototype.fromInt = bnpFromInt; -BigInteger.prototype.fromString = bnpFromString; -BigInteger.prototype.clamp = bnpClamp; -BigInteger.prototype.dlShiftTo = bnpDLShiftTo; -BigInteger.prototype.drShiftTo = bnpDRShiftTo; -BigInteger.prototype.lShiftTo = bnpLShiftTo; -BigInteger.prototype.rShiftTo = bnpRShiftTo; -BigInteger.prototype.subTo = bnpSubTo; -BigInteger.prototype.multiplyTo = bnpMultiplyTo; -BigInteger.prototype.squareTo = bnpSquareTo; -BigInteger.prototype.divRemTo = bnpDivRemTo; -BigInteger.prototype.invDigit = bnpInvDigit; -BigInteger.prototype.isEven = bnpIsEven; -BigInteger.prototype.exp = bnpExp; - -// public -BigInteger.prototype.toString = bnToString; -BigInteger.prototype.negate = bnNegate; -BigInteger.prototype.abs = bnAbs; -BigInteger.prototype.compareTo = bnCompareTo; -BigInteger.prototype.bitLength = bnBitLength; -BigInteger.prototype.mod = bnMod; -BigInteger.prototype.modPowInt = bnModPowInt; - -// "constants" -BigInteger.ZERO = nbv(0); -BigInteger.ONE = nbv(1); -// Copyright (c) 2005 Tom Wu -// All Rights Reserved. -// See "LICENSE" for details. - -// Extended JavaScript BN functions, required for RSA private ops. - -// (public) -function bnClone() { var r = nbi(); this.copyTo(r); return r; } - -// (public) return value as integer -function bnIntValue() { - var this_array = this.array; - if(this.s < 0) { - if(this.t == 1) return this_array[0]-BI_DV; - else if(this.t == 0) return -1; - } - else if(this.t == 1) return this_array[0]; - else if(this.t == 0) return 0; - // assumes 16 < DB < 32 - return ((this_array[1]&((1<<(32-BI_DB))-1))<<BI_DB)|this_array[0]; -} - -// (public) return value as byte -function bnByteValue() { - var this_array = this.array; - return (this.t==0)?this.s:(this_array[0]<<24)>>24; -} - -// (public) return value as short (assumes DB>=16) -function bnShortValue() { - var this_array = this.array; - return (this.t==0)?this.s:(this_array[0]<<16)>>16; -} - -// (protected) return x s.t. r^x < DV -function bnpChunkSize(r) { return Math.floor(Math.LN2*BI_DB/Math.log(r)); } - -// (public) 0 if this == 0, 1 if this > 0 -function bnSigNum() { - var this_array = this.array; - if(this.s < 0) return -1; - else if(this.t <= 0 || (this.t == 1 && this_array[0] <= 0)) return 0; - else return 1; -} - -// (protected) convert to radix string -function bnpToRadix(b) { - if(b == null) b = 10; - if(this.signum() == 0 || b < 2 || b > 36) return "0"; - var cs = this.chunkSize(b); - var a = Math.pow(b,cs); - var d = nbv(a), y = nbi(), z = nbi(), r = ""; - this.divRemTo(d,y,z); - while(y.signum() > 0) { - r = (a+z.intValue()).toString(b).substr(1) + r; - y.divRemTo(d,y,z); - } - return z.intValue().toString(b) + r; -} - -// (protected) convert from radix string -function bnpFromRadix(s,b) { - this.fromInt(0); - if(b == null) b = 10; - var cs = this.chunkSize(b); - var d = Math.pow(b,cs), mi = false, j = 0, w = 0; - for(var i = 0; i < s.length; ++i) { - var x = intAt(s,i); - if(x < 0) { - if(s.charAt(i) == "-" && this.signum() == 0) mi = true; - continue; - } - w = b*w+x; - if(++j >= cs) { - this.dMultiply(d); - this.dAddOffset(w,0); - j = 0; - w = 0; - } - } - if(j > 0) { - this.dMultiply(Math.pow(b,j)); - this.dAddOffset(w,0); - } - if(mi) BigInteger.ZERO.subTo(this,this); -} - -// (protected) alternate constructor -function bnpFromNumber(a,b,c) { - if("number" == typeof b) { - // new BigInteger(int,int,RNG) - if(a < 2) this.fromInt(1); - else { - this.fromNumber(a,c); - if(!this.testBit(a-1)) // force MSB set - this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this); - if(this.isEven()) this.dAddOffset(1,0); // force odd - while(!this.isProbablePrime(b)) { - this.dAddOffset(2,0); - if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this); - } - } - } - else { - // new BigInteger(int,RNG) - var x = new Array(), t = a&7; - x.length = (a>>3)+1; - b.nextBytes(x); - if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0; - this.fromString(x,256); - } -} - -// (public) convert to bigendian byte array -function bnToByteArray() { - var this_array = this.array; - var i = this.t, r = new Array(); - r[0] = this.s; - var p = BI_DB-(i*BI_DB)%8, d, k = 0; - if(i-- > 0) { - if(p < BI_DB && (d = this_array[i]>>p) != (this.s&BI_DM)>>p) - r[k++] = d|(this.s<<(BI_DB-p)); - while(i >= 0) { - if(p < 8) { - d = (this_array[i]&((1<<p)-1))<<(8-p); - d |= this_array[--i]>>(p+=BI_DB-8); - } - else { - d = (this_array[i]>>(p-=8))&0xff; - if(p <= 0) { p += BI_DB; --i; } - } - if((d&0x80) != 0) d |= -256; - if(k == 0 && (this.s&0x80) != (d&0x80)) ++k; - if(k > 0 || d != this.s) r[k++] = d; - } - } - return r; -} - -function bnEquals(a) { return(this.compareTo(a)==0); } -function bnMin(a) { return(this.compareTo(a)<0)?this:a; } -function bnMax(a) { return(this.compareTo(a)>0)?this:a; } - -// (protected) r = this op a (bitwise) -function bnpBitwiseTo(a,op,r) { - var this_array = this.array; - var a_array = a.array; - var r_array = r.array; - var i, f, m = Math.min(a.t,this.t); - for(i = 0; i < m; ++i) r_array[i] = op(this_array[i],a_array[i]); - if(a.t < this.t) { - f = a.s&BI_DM; - for(i = m; i < this.t; ++i) r_array[i] = op(this_array[i],f); - r.t = this.t; - } - else { - f = this.s&BI_DM; - for(i = m; i < a.t; ++i) r_array[i] = op(f,a_array[i]); - r.t = a.t; - } - r.s = op(this.s,a.s); - r.clamp(); -} - -// (public) this & a -function op_and(x,y) { return x&y; } -function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; } - -// (public) this | a -function op_or(x,y) { return x|y; } -function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; } - -// (public) this ^ a -function op_xor(x,y) { return x^y; } -function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; } - -// (public) this & ~a -function op_andnot(x,y) { return x&~y; } -function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; } - -// (public) ~this -function bnNot() { - var this_array = this.array; - var r = nbi(); - var r_array = r.array; - - for(var i = 0; i < this.t; ++i) r_array[i] = BI_DM&~this_array[i]; - r.t = this.t; - r.s = ~this.s; - return r; -} - -// (public) this << n -function bnShiftLeft(n) { - var r = nbi(); - if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r); - return r; -} - -// (public) this >> n -function bnShiftRight(n) { - var r = nbi(); - if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r); - return r; -} - -// return index of lowest 1-bit in x, x < 2^31 -function lbit(x) { - if(x == 0) return -1; - var r = 0; - if((x&0xffff) == 0) { x >>= 16; r += 16; } - if((x&0xff) == 0) { x >>= 8; r += 8; } - if((x&0xf) == 0) { x >>= 4; r += 4; } - if((x&3) == 0) { x >>= 2; r += 2; } - if((x&1) == 0) ++r; - return r; -} - -// (public) returns index of lowest 1-bit (or -1 if none) -function bnGetLowestSetBit() { - var this_array = this.array; - for(var i = 0; i < this.t; ++i) - if(this_array[i] != 0) return i*BI_DB+lbit(this_array[i]); - if(this.s < 0) return this.t*BI_DB; - return -1; -} - -// return number of 1 bits in x -function cbit(x) { - var r = 0; - while(x != 0) { x &= x-1; ++r; } - return r; -} - -// (public) return number of set bits -function bnBitCount() { - var r = 0, x = this.s&BI_DM; - for(var i = 0; i < this.t; ++i) r += cbit(this_array[i]^x); - return r; -} - -// (public) true iff nth bit is set -function bnTestBit(n) { - var this_array = this.array; - var j = Math.floor(n/BI_DB); - if(j >= this.t) return(this.s!=0); - return((this_array[j]&(1<<(n%BI_DB)))!=0); -} - -// (protected) this op (1<<n) -function bnpChangeBit(n,op) { - var r = BigInteger.ONE.shiftLeft(n); - this.bitwiseTo(r,op,r); - return r; -} - -// (public) this | (1<<n) -function bnSetBit(n) { return this.changeBit(n,op_or); } - -// (public) this & ~(1<<n) -function bnClearBit(n) { return this.changeBit(n,op_andnot); } - -// (public) this ^ (1<<n) -function bnFlipBit(n) { return this.changeBit(n,op_xor); } - -// (protected) r = this + a -function bnpAddTo(a,r) { - var this_array = this.array; - var a_array = a.array; - var r_array = r.array; - var i = 0, c = 0, m = Math.min(a.t,this.t); - while(i < m) { - c += this_array[i]+a_array[i]; - r_array[i++] = c&BI_DM; - c >>= BI_DB; - } - if(a.t < this.t) { - c += a.s; - while(i < this.t) { - c += this_array[i]; - r_array[i++] = c&BI_DM; - c >>= BI_DB; - } - c += this.s; - } - else { - c += this.s; - while(i < a.t) { - c += a_array[i]; - r_array[i++] = c&BI_DM; - c >>= BI_DB; - } - c += a.s; - } - r.s = (c<0)?-1:0; - if(c > 0) r_array[i++] = c; - else if(c < -1) r_array[i++] = BI_DV+c; - r.t = i; - r.clamp(); -} - -// (public) this + a -function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; } - -// (public) this - a -function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; } - -// (public) this * a -function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; } - -// (public) this / a -function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; } - -// (public) this % a -function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; } - -// (public) [this/a,this%a] -function bnDivideAndRemainder(a) { - var q = nbi(), r = nbi(); - this.divRemTo(a,q,r); - return new Array(q,r); -} - -// (protected) this *= n, this >= 0, 1 < n < DV -function bnpDMultiply(n) { - var this_array = this.array; - this_array[this.t] = this.am(0,n-1,this,0,0,this.t); - ++this.t; - this.clamp(); -} - -// (protected) this += n << w words, this >= 0 -function bnpDAddOffset(n,w) { - var this_array = this.array; - while(this.t <= w) this_array[this.t++] = 0; - this_array[w] += n; - while(this_array[w] >= BI_DV) { - this_array[w] -= BI_DV; - if(++w >= this.t) this_array[this.t++] = 0; - ++this_array[w]; - } -} - -// A "null" reducer -function NullExp() {} -function nNop(x) { return x; } -function nMulTo(x,y,r) { x.multiplyTo(y,r); } -function nSqrTo(x,r) { x.squareTo(r); } - -NullExp.prototype.convert = nNop; -NullExp.prototype.revert = nNop; -NullExp.prototype.mulTo = nMulTo; -NullExp.prototype.sqrTo = nSqrTo; - -// (public) this^e -function bnPow(e) { return this.exp(e,new NullExp()); } - -// (protected) r = lower n words of "this * a", a.t <= n -// "this" should be the larger one if appropriate. -function bnpMultiplyLowerTo(a,n,r) { - var r_array = r.array; - var a_array = a.array; - var i = Math.min(this.t+a.t,n); - r.s = 0; // assumes a,this >= 0 - r.t = i; - while(i > 0) r_array[--i] = 0; - var j; - for(j = r.t-this.t; i < j; ++i) r_array[i+this.t] = this.am(0,a_array[i],r,i,0,this.t); - for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a_array[i],r,i,0,n-i); - r.clamp(); -} - -// (protected) r = "this * a" without lower n words, n > 0 -// "this" should be the larger one if appropriate. -function bnpMultiplyUpperTo(a,n,r) { - var r_array = r.array; - var a_array = a.array; - --n; - var i = r.t = this.t+a.t-n; - r.s = 0; // assumes a,this >= 0 - while(--i >= 0) r_array[i] = 0; - for(i = Math.max(n-this.t,0); i < a.t; ++i) - r_array[this.t+i-n] = this.am(n-i,a_array[i],r,0,0,this.t+i-n); - r.clamp(); - r.drShiftTo(1,r); -} - -// Barrett modular reduction -function Barrett(m) { - // setup Barrett - this.r2 = nbi(); - this.q3 = nbi(); - BigInteger.ONE.dlShiftTo(2*m.t,this.r2); - this.mu = this.r2.divide(m); - this.m = m; -} - -function barrettConvert(x) { - if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m); - else if(x.compareTo(this.m) < 0) return x; - else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } -} - -function barrettRevert(x) { return x; } - -// x = x mod m (HAC 14.42) -function barrettReduce(x) { - x.drShiftTo(this.m.t-1,this.r2); - if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); } - this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3); - this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2); - while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1); - x.subTo(this.r2,x); - while(x.compareTo(this.m) >= 0) x.subTo(this.m,x); -} - -// r = x^2 mod m; x != r -function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); } - -// r = x*y mod m; x,y != r -function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } - -Barrett.prototype.convert = barrettConvert; -Barrett.prototype.revert = barrettRevert; -Barrett.prototype.reduce = barrettReduce; -Barrett.prototype.mulTo = barrettMulTo; -Barrett.prototype.sqrTo = barrettSqrTo; - -// (public) this^e % m (HAC 14.85) -function bnModPow(e,m) { - var e_array = e.array; - var i = e.bitLength(), k, r = nbv(1), z; - if(i <= 0) return r; - else if(i < 18) k = 1; - else if(i < 48) k = 3; - else if(i < 144) k = 4; - else if(i < 768) k = 5; - else k = 6; - if(i < 8) - z = new Classic(m); - else if(m.isEven()) - z = new Barrett(m); - else - z = new Montgomery(m); - - // precomputation - var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1; - g[1] = z.convert(this); - if(k > 1) { - var g2 = nbi(); - z.sqrTo(g[1],g2); - while(n <= km) { - g[n] = nbi(); - z.mulTo(g2,g[n-2],g[n]); - n += 2; - } - } - - var j = e.t-1, w, is1 = true, r2 = nbi(), t; - i = nbits(e_array[j])-1; - while(j >= 0) { - if(i >= k1) w = (e_array[j]>>(i-k1))&km; - else { - w = (e_array[j]&((1<<(i+1))-1))<<(k1-i); - if(j > 0) w |= e_array[j-1]>>(BI_DB+i-k1); - } - - n = k; - while((w&1) == 0) { w >>= 1; --n; } - if((i -= n) < 0) { i += BI_DB; --j; } - if(is1) { // ret == 1, don't bother squaring or multiplying it - g[w].copyTo(r); - is1 = false; - } - else { - while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; } - if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; } - z.mulTo(r2,g[w],r); - } - - while(j >= 0 && (e_array[j]&(1<<i)) == 0) { - z.sqrTo(r,r2); t = r; r = r2; r2 = t; - if(--i < 0) { i = BI_DB-1; --j; } - } - } - return z.revert(r); -} - -// (public) gcd(this,a) (HAC 14.54) -function bnGCD(a) { - var x = (this.s<0)?this.negate():this.clone(); - var y = (a.s<0)?a.negate():a.clone(); - if(x.compareTo(y) < 0) { var t = x; x = y; y = t; } - var i = x.getLowestSetBit(), g = y.getLowestSetBit(); - if(g < 0) return x; - if(i < g) g = i; - if(g > 0) { - x.rShiftTo(g,x); - y.rShiftTo(g,y); - } - while(x.signum() > 0) { - if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x); - if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y); - if(x.compareTo(y) >= 0) { - x.subTo(y,x); - x.rShiftTo(1,x); - } - else { - y.subTo(x,y); - y.rShiftTo(1,y); - } - } - if(g > 0) y.lShiftTo(g,y); - return y; -} - -// (protected) this % n, n < 2^26 -function bnpModInt(n) { - var this_array = this.array; - if(n <= 0) return 0; - var d = BI_DV%n, r = (this.s<0)?n-1:0; - if(this.t > 0) - if(d == 0) r = this_array[0]%n; - else for(var i = this.t-1; i >= 0; --i) r = (d*r+this_array[i])%n; - return r; -} - -// (public) 1/this % m (HAC 14.61) -function bnModInverse(m) { - var ac = m.isEven(); - if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO; - var u = m.clone(), v = this.clone(); - var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); - while(u.signum() != 0) { - while(u.isEven()) { - u.rShiftTo(1,u); - if(ac) { - if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); } - a.rShiftTo(1,a); - } - else if(!b.isEven()) b.subTo(m,b); - b.rShiftTo(1,b); - } - while(v.isEven()) { - v.rShiftTo(1,v); - if(ac) { - if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); } - c.rShiftTo(1,c); - } - else if(!d.isEven()) d.subTo(m,d); - d.rShiftTo(1,d); - } - if(u.compareTo(v) >= 0) { - u.subTo(v,u); - if(ac) a.subTo(c,a); - b.subTo(d,b); - } - else { - v.subTo(u,v); - if(ac) c.subTo(a,c); - d.subTo(b,d); - } - } - if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; - if(d.compareTo(m) >= 0) return d.subtract(m); - if(d.signum() < 0) d.addTo(m,d); else return d; - if(d.signum() < 0) return d.add(m); else return d; -} - -var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509]; -var lplim = (1<<26)/lowprimes[lowprimes.length-1]; - -// (public) test primality with certainty >= 1-.5^t -function bnIsProbablePrime(t) { - var i, x = this.abs(); - var x_array = x.array; - if(x.t == 1 && x_array[0] <= lowprimes[lowprimes.length-1]) { - for(i = 0; i < lowprimes.length; ++i) - if(x_array[0] == lowprimes[i]) return true; - return false; - } - if(x.isEven()) return false; - i = 1; - while(i < lowprimes.length) { - var m = lowprimes[i], j = i+1; - while(j < lowprimes.length && m < lplim) m *= lowprimes[j++]; - m = x.modInt(m); - while(i < j) if(m%lowprimes[i++] == 0) return false; - } - return x.millerRabin(t); -} - -// (protected) true if probably prime (HAC 4.24, Miller-Rabin) -function bnpMillerRabin(t) { - var n1 = this.subtract(BigInteger.ONE); - var k = n1.getLowestSetBit(); - if(k <= 0) return false; - var r = n1.shiftRight(k); - t = (t+1)>>1; - if(t > lowprimes.length) t = lowprimes.length; - var a = nbi(); - for(var i = 0; i < t; ++i) { - a.fromInt(lowprimes[i]); - var y = a.modPow(r,this); - if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { - var j = 1; - while(j++ < k && y.compareTo(n1) != 0) { - y = y.modPowInt(2,this); - if(y.compareTo(BigInteger.ONE) == 0) return false; - } - if(y.compareTo(n1) != 0) return false; - } - } - return true; -} - -// protected -BigInteger.prototype.chunkSize = bnpChunkSize; -BigInteger.prototype.toRadix = bnpToRadix; -BigInteger.prototype.fromRadix = bnpFromRadix; -BigInteger.prototype.fromNumber = bnpFromNumber; -BigInteger.prototype.bitwiseTo = bnpBitwiseTo; -BigInteger.prototype.changeBit = bnpChangeBit; -BigInteger.prototype.addTo = bnpAddTo; -BigInteger.prototype.dMultiply = bnpDMultiply; -BigInteger.prototype.dAddOffset = bnpDAddOffset; -BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; -BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; -BigInteger.prototype.modInt = bnpModInt; -BigInteger.prototype.millerRabin = bnpMillerRabin; - -// public -BigInteger.prototype.clone = bnClone; -BigInteger.prototype.intValue = bnIntValue; -BigInteger.prototype.byteValue = bnByteValue; -BigInteger.prototype.shortValue = bnShortValue; -BigInteger.prototype.signum = bnSigNum; -BigInteger.prototype.toByteArray = bnToByteArray; -BigInteger.prototype.equals = bnEquals; -BigInteger.prototype.min = bnMin; -BigInteger.prototype.max = bnMax; -BigInteger.prototype.and = bnAnd; -BigInteger.prototype.or = bnOr; -BigInteger.prototype.xor = bnXor; -BigInteger.prototype.andNot = bnAndNot; -BigInteger.prototype.not = bnNot; -BigInteger.prototype.shiftLeft = bnShiftLeft; -BigInteger.prototype.shiftRight = bnShiftRight; -BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; -BigInteger.prototype.bitCount = bnBitCount; -BigInteger.prototype.testBit = bnTestBit; -BigInteger.prototype.setBit = bnSetBit; -BigInteger.prototype.clearBit = bnClearBit; -BigInteger.prototype.flipBit = bnFlipBit; -BigInteger.prototype.add = bnAdd; -BigInteger.prototype.subtract = bnSubtract; -BigInteger.prototype.multiply = bnMultiply; -BigInteger.prototype.divide = bnDivide; -BigInteger.prototype.remainder = bnRemainder; -BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; -BigInteger.prototype.modPow = bnModPow; -BigInteger.prototype.modInverse = bnModInverse; -BigInteger.prototype.pow = bnPow; -BigInteger.prototype.gcd = bnGCD; -BigInteger.prototype.isProbablePrime = bnIsProbablePrime; - -// BigInteger interfaces not implemented in jsbn: - -// BigInteger(int signum, byte[] magnitude) -// double doubleValue() -// float floatValue() -// int hashCode() -// long longValue() -// static BigInteger valueOf(long val) -// prng4.js - uses Arcfour as a PRNG - -function Arcfour() { - this.i = 0; - this.j = 0; - this.S = new Array(); -} - -// Initialize arcfour context from key, an array of ints, each from [0..255] -function ARC4init(key) { - var i, j, t; - for(i = 0; i < 256; ++i) - this.S[i] = i; - j = 0; - for(i = 0; i < 256; ++i) { - j = (j + this.S[i] + key[i % key.length]) & 255; - t = this.S[i]; - this.S[i] = this.S[j]; - this.S[j] = t; - } - this.i = 0; - this.j = 0; -} - -function ARC4next() { - var t; - this.i = (this.i + 1) & 255; - this.j = (this.j + this.S[this.i]) & 255; - t = this.S[this.i]; - this.S[this.i] = this.S[this.j]; - this.S[this.j] = t; - return this.S[(t + this.S[this.i]) & 255]; -} - -Arcfour.prototype.init = ARC4init; -Arcfour.prototype.next = ARC4next; - -// Plug in your RNG constructor here -function prng_newstate() { - return new Arcfour(); -} - -// Pool size must be a multiple of 4 and greater than 32. -// An array of bytes the size of the pool will be passed to init() -var rng_psize = 256; -// Random number generator - requires a PRNG backend, e.g. prng4.js - -// For best results, put code like -// <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'> -// in your main HTML document. - -var rng_state; -var rng_pool; -var rng_pptr; - -// Mix in a 32-bit integer into the pool -function rng_seed_int(x) { - rng_pool[rng_pptr++] ^= x & 255; - rng_pool[rng_pptr++] ^= (x >> 8) & 255; - rng_pool[rng_pptr++] ^= (x >> 16) & 255; - rng_pool[rng_pptr++] ^= (x >> 24) & 255; - if(rng_pptr >= rng_psize) rng_pptr -= rng_psize; -} - -// Mix in the current time (w/milliseconds) into the pool -function rng_seed_time() { - // Use pre-computed date to avoid making the benchmark - // results dependent on the current date. - rng_seed_int(1122926989487); -} - -// Initialize the pool with junk if needed. -if(rng_pool == null) { - rng_pool = new Array(); - rng_pptr = 0; - var t; - while(rng_pptr < rng_psize) { // extract some randomness from Math.random() - t = Math.floor(65536 * Math.random()); - rng_pool[rng_pptr++] = t >>> 8; - rng_pool[rng_pptr++] = t & 255; - } - rng_pptr = 0; - rng_seed_time(); - //rng_seed_int(window.screenX); - //rng_seed_int(window.screenY); -} - -function rng_get_byte() { - if(rng_state == null) { - rng_seed_time(); - rng_state = prng_newstate(); - rng_state.init(rng_pool); - for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) - rng_pool[rng_pptr] = 0; - rng_pptr = 0; - //rng_pool = null; - } - // TODO: allow reseeding after first request - return rng_state.next(); -} - -function rng_get_bytes(ba) { - var i; - for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); -} - -function SecureRandom() {} - -SecureRandom.prototype.nextBytes = rng_get_bytes; -// Depends on jsbn.js and rng.js - -// convert a (hex) string to a bignum object -function parseBigInt(str,r) { - return new BigInteger(str,r); -} - -function linebrk(s,n) { - var ret = ""; - var i = 0; - while(i + n < s.length) { - ret += s.substring(i,i+n) + "\n"; - i += n; - } - return ret + s.substring(i,s.length); -} - -function byte2Hex(b) { - if(b < 0x10) - return "0" + b.toString(16); - else - return b.toString(16); -} - -// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint -function pkcs1pad2(s,n) { - if(n < s.length + 11) { - alert("Message too long for RSA"); - return null; - } - var ba = new Array(); - var i = s.length - 1; - while(i >= 0 && n > 0) ba[--n] = s.charCodeAt(i--); - ba[--n] = 0; - var rng = new SecureRandom(); - var x = new Array(); - while(n > 2) { // random non-zero pad - x[0] = 0; - while(x[0] == 0) rng.nextBytes(x); - ba[--n] = x[0]; - } - ba[--n] = 2; - ba[--n] = 0; - return new BigInteger(ba); -} - -// "empty" RSA key constructor -function RSAKey() { - this.n = null; - this.e = 0; - this.d = null; - this.p = null; - this.q = null; - this.dmp1 = null; - this.dmq1 = null; - this.coeff = null; -} - -// Set the public key fields N and e from hex strings -function RSASetPublic(N,E) { - if(N != null && E != null && N.length > 0 && E.length > 0) { - this.n = parseBigInt(N,16); - this.e = parseInt(E,16); - } - else - alert("Invalid RSA public key"); -} - -// Perform raw public operation on "x": return x^e (mod n) -function RSADoPublic(x) { - return x.modPowInt(this.e, this.n); -} - -// Return the PKCS#1 RSA encryption of "text" as an even-length hex string -function RSAEncrypt(text) { - var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3); - if(m == null) return null; - var c = this.doPublic(m); - if(c == null) return null; - var h = c.toString(16); - if((h.length & 1) == 0) return h; else return "0" + h; -} - -// Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string -//function RSAEncryptB64(text) { -// var h = this.encrypt(text); -// if(h) return hex2b64(h); else return null; -//} - -// protected -RSAKey.prototype.doPublic = RSADoPublic; - -// public -RSAKey.prototype.setPublic = RSASetPublic; -RSAKey.prototype.encrypt = RSAEncrypt; -//RSAKey.prototype.encrypt_b64 = RSAEncryptB64; -// Depends on rsa.js and jsbn2.js - -// Undo PKCS#1 (type 2, random) padding and, if valid, return the plaintext -function pkcs1unpad2(d,n) { - var b = d.toByteArray(); - var i = 0; - while(i < b.length && b[i] == 0) ++i; - if(b.length-i != n-1 || b[i] != 2) - return null; - ++i; - while(b[i] != 0) - if(++i >= b.length) return null; - var ret = ""; - while(++i < b.length) - ret += String.fromCharCode(b[i]); - return ret; -} - -// Set the private key fields N, e, and d from hex strings -function RSASetPrivate(N,E,D) { - if(N != null && E != null && N.length > 0 && E.length > 0) { - this.n = parseBigInt(N,16); - this.e = parseInt(E,16); - this.d = parseBigInt(D,16); - } - else - alert("Invalid RSA private key"); -} - -// Set the private key fields N, e, d and CRT params from hex strings -function RSASetPrivateEx(N,E,D,P,Q,DP,DQ,C) { - if(N != null && E != null && N.length > 0 && E.length > 0) { - this.n = parseBigInt(N,16); - this.e = parseInt(E,16); - this.d = parseBigInt(D,16); - this.p = parseBigInt(P,16); - this.q = parseBigInt(Q,16); - this.dmp1 = parseBigInt(DP,16); - this.dmq1 = parseBigInt(DQ,16); - this.coeff = parseBigInt(C,16); - } - else - alert("Invalid RSA private key"); -} - -// Generate a new random private key B bits long, using public expt E -function RSAGenerate(B,E) { - var rng = new SecureRandom(); - var qs = B>>1; - this.e = parseInt(E,16); - var ee = new BigInteger(E,16); - for(;;) { - for(;;) { - this.p = new BigInteger(B-qs,1,rng); - if(this.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.p.isProbablePrime(10)) break; - } - for(;;) { - this.q = new BigInteger(qs,1,rng); - if(this.q.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.q.isProbablePrime(10)) break; - } - if(this.p.compareTo(this.q) <= 0) { - var t = this.p; - this.p = this.q; - this.q = t; - } - var p1 = this.p.subtract(BigInteger.ONE); - var q1 = this.q.subtract(BigInteger.ONE); - var phi = p1.multiply(q1); - if(phi.gcd(ee).compareTo(BigInteger.ONE) == 0) { - this.n = this.p.multiply(this.q); - this.d = ee.modInverse(phi); - this.dmp1 = this.d.mod(p1); - this.dmq1 = this.d.mod(q1); - this.coeff = this.q.modInverse(this.p); - break; - } - } -} - -// Perform raw private operation on "x": return x^d (mod n) -function RSADoPrivate(x) { - if(this.p == null || this.q == null) - return x.modPow(this.d, this.n); - - // TODO: re-calculate any missing CRT params - var xp = x.mod(this.p).modPow(this.dmp1, this.p); - var xq = x.mod(this.q).modPow(this.dmq1, this.q); - - while(xp.compareTo(xq) < 0) - xp = xp.add(this.p); - return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq); -} - -// Return the PKCS#1 RSA decryption of "ctext". -// "ctext" is an even-length hex string and the output is a plain string. -function RSADecrypt(ctext) { - var c = parseBigInt(ctext, 16); - var m = this.doPrivate(c); - if(m == null) return null; - return pkcs1unpad2(m, (this.n.bitLength()+7)>>3); -} - -// Return the PKCS#1 RSA decryption of "ctext". -// "ctext" is a Base64-encoded string and the output is a plain string. -//function RSAB64Decrypt(ctext) { -// var h = b64tohex(ctext); -// if(h) return this.decrypt(h); else return null; -//} - -// protected -RSAKey.prototype.doPrivate = RSADoPrivate; - -// public -RSAKey.prototype.setPrivate = RSASetPrivate; -RSAKey.prototype.setPrivateEx = RSASetPrivateEx; -RSAKey.prototype.generate = RSAGenerate; -RSAKey.prototype.decrypt = RSADecrypt; -//RSAKey.prototype.b64_decrypt = RSAB64Decrypt; - - -var nValue="a5261939975948bb7a58dffe5ff54e65f0498f9175f5a09288810b8975871e99af3b5dd94057b0fc07535f5f97444504fa35169d461d0d30cf0192e307727c065168c788771c561a9400fb49175e9e6aa4e23fe11af69e9412dd23b0cb6684c4c2429bce139e848ab26d0829073351f4acd36074eafd036a5eb83359d2a698d3"; -var eValue="10001"; -var dValue="8e9912f6d3645894e8d38cb58c0db81ff516cf4c7e5a14c7f1eddb1459d2cded4d8d293fc97aee6aefb861859c8b6a3d1dfe710463e1f9ddc72048c09751971c4a580aa51eb523357a3cc48d31cfad1d4a165066ed92d4748fb6571211da5cb14bc11b6e2df7c1a559e6d5ac1cd5c94703a22891464fba23d0d965086277a161"; -var pValue="d090ce58a92c75233a6486cb0a9209bf3583b64f540c76f5294bb97d285eed33aec220bde14b2417951178ac152ceab6da7090905b478195498b352048f15e7d"; -var qValue="cab575dc652bb66df15a0359609d51d1db184750c00c6698b90ef3465c99655103edbf0d54c56aec0ce3c4d22592338092a126a0cc49f65a4a30d222b411e58f"; -var dmp1Value="1a24bca8e273df2f0e47c199bbf678604e7df7215480c77c8db39f49b000ce2cf7500038acfff5433b7d582a01f1826e6f4d42e1c57f5e1fef7b12aabc59fd25"; -var dmq1Value="3d06982efbbe47339e1f6d36b1216b8a741d410b0c662f54f7118b27b9a4ec9d914337eb39841d8666f3034408cf94f5b62f11c402fc994fe15a05493150d9fd"; -var coeffValue="3a3e731acd8960b7ff9eb81a7ff93bd1cfa74cbd56987db58b4594fb09c09084db1734c8143f98b602b981aaa9243ca28deb69b5b280ee8dcee0fd2625e53250"; - -setupEngine(am3, 28); - -var TEXT = "The quick brown fox jumped over the extremely lazy frog! " + - "Now is the time for all good men to come to the party."; -var encrypted; - -function encrypt() { - var RSA = new RSAKey(); - RSA.setPublic(nValue, eValue); - RSA.setPrivateEx(nValue, eValue, dValue, pValue, qValue, dmp1Value, dmq1Value, coeffValue); - encrypted = RSA.encrypt(TEXT); -} - -function decrypt() { - var RSA = new RSAKey(); - RSA.setPublic(nValue, eValue); - RSA.setPrivateEx(nValue, eValue, dValue, pValue, qValue, dmp1Value, dmq1Value, coeffValue); - var decrypted = RSA.decrypt(encrypted); - if (decrypted != TEXT) { - throw new Error("Crypto operation failed"); - } -} - -for (var i = 0; i < 8; ++i) { - encrypt(); - decrypt(); -} diff --git a/implementation-contributed/javascriptcore/stress/v8-deltablue-strict.js b/implementation-contributed/javascriptcore/stress/v8-deltablue-strict.js deleted file mode 100644 index 8badbe947c..0000000000 --- a/implementation-contributed/javascriptcore/stress/v8-deltablue-strict.js +++ /dev/null @@ -1,878 +0,0 @@ -"use strict"; - -// Copyright 2008 the V8 project authors. All rights reserved. -// Copyright 1996 John Maloney and Mario Wolczko. - -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -// This implementation of the DeltaBlue benchmark is derived -// from the Smalltalk implementation by John Maloney and Mario -// Wolczko. Some parts have been translated directly, whereas -// others have been modified more aggresively to make it feel -// more like a JavaScript program. - -/** - * A JavaScript implementation of the DeltaBlue constraint-solving - * algorithm, as described in: - * - * "The DeltaBlue Algorithm: An Incremental Constraint Hierarchy Solver" - * Bjorn N. Freeman-Benson and John Maloney - * January 1990 Communications of the ACM, - * also available as University of Washington TR 89-08-06. - * - * Beware: this benchmark is written in a grotesque style where - * the constraint model is built by side-effects from constructors. - * I've kept it this way to avoid deviating too much from the original - * implementation. - */ - - -/* --- O b j e c t M o d e l --- */ - -Object.prototype.inheritsFrom = function (shuper) { - function Inheriter() { } - Inheriter.prototype = shuper.prototype; - this.prototype = new Inheriter(); - this.superConstructor = shuper; -} - -function OrderedCollection() { - this.elms = new Array(); -} - -OrderedCollection.prototype.add = function (elm) { - this.elms.push(elm); -} - -OrderedCollection.prototype.at = function (index) { - return this.elms[index]; -} - -OrderedCollection.prototype.size = function () { - return this.elms.length; -} - -OrderedCollection.prototype.removeFirst = function () { - return this.elms.pop(); -} - -OrderedCollection.prototype.remove = function (elm) { - var index = 0, skipped = 0; - for (var i = 0; i < this.elms.length; i++) { - var value = this.elms[i]; - if (value != elm) { - this.elms[index] = value; - index++; - } else { - skipped++; - } - } - for (var i = 0; i < skipped; i++) - this.elms.pop(); -} - -/* --- * - * S t r e n g t h - * --- */ - -/** - * Strengths are used to measure the relative importance of constraints. - * New strengths may be inserted in the strength hierarchy without - * disrupting current constraints. Strengths cannot be created outside - * this class, so pointer comparison can be used for value comparison. - */ -function Strength(strengthValue, name) { - this.strengthValue = strengthValue; - this.name = name; -} - -Strength.stronger = function (s1, s2) { - return s1.strengthValue < s2.strengthValue; -} - -Strength.weaker = function (s1, s2) { - return s1.strengthValue > s2.strengthValue; -} - -Strength.weakestOf = function (s1, s2) { - return this.weaker(s1, s2) ? s1 : s2; -} - -Strength.strongest = function (s1, s2) { - return this.stronger(s1, s2) ? s1 : s2; -} - -Strength.prototype.nextWeaker = function () { - switch (this.strengthValue) { - case 0: return Strength.WEAKEST; - case 1: return Strength.WEAK_DEFAULT; - case 2: return Strength.NORMAL; - case 3: return Strength.STRONG_DEFAULT; - case 4: return Strength.PREFERRED; - case 5: return Strength.REQUIRED; - } -} - -// Strength constants. -Strength.REQUIRED = new Strength(0, "required"); -Strength.STONG_PREFERRED = new Strength(1, "strongPreferred"); -Strength.PREFERRED = new Strength(2, "preferred"); -Strength.STRONG_DEFAULT = new Strength(3, "strongDefault"); -Strength.NORMAL = new Strength(4, "normal"); -Strength.WEAK_DEFAULT = new Strength(5, "weakDefault"); -Strength.WEAKEST = new Strength(6, "weakest"); - -/* --- * - * C o n s t r a i n t - * --- */ - -/** - * An abstract class representing a system-maintainable relationship - * (or "constraint") between a set of variables. A constraint supplies - * a strength instance variable; concrete subclasses provide a means - * of storing the constrained variables and other information required - * to represent a constraint. - */ -function Constraint(strength) { - this.strength = strength; -} - -/** - * Activate this constraint and attempt to satisfy it. - */ -Constraint.prototype.addConstraint = function () { - this.addToGraph(); - planner.incrementalAdd(this); -} - -/** - * Attempt to find a way to enforce this constraint. If successful, - * record the solution, perhaps modifying the current dataflow - * graph. Answer the constraint that this constraint overrides, if - * there is one, or nil, if there isn't. - * Assume: I am not already satisfied. - */ -Constraint.prototype.satisfy = function (mark) { - this.chooseMethod(mark); - if (!this.isSatisfied()) { - if (this.strength == Strength.REQUIRED) - alert("Could not satisfy a required constraint!"); - return null; - } - this.markInputs(mark); - var out = this.output(); - var overridden = out.determinedBy; - if (overridden != null) overridden.markUnsatisfied(); - out.determinedBy = this; - if (!planner.addPropagate(this, mark)) - alert("Cycle encountered"); - out.mark = mark; - return overridden; -} - -Constraint.prototype.destroyConstraint = function () { - if (this.isSatisfied()) planner.incrementalRemove(this); - else this.removeFromGraph(); -} - -/** - * Normal constraints are not input constraints. An input constraint - * is one that depends on external state, such as the mouse, the - * keybord, a clock, or some arbitraty piece of imperative code. - */ -Constraint.prototype.isInput = function () { - return false; -} - -/* --- * - * U n a r y C o n s t r a i n t - * --- */ - -/** - * Abstract superclass for constraints having a single possible output - * variable. - */ -function UnaryConstraint(v, strength) { - UnaryConstraint.superConstructor.call(this, strength); - this.myOutput = v; - this.satisfied = false; - this.addConstraint(); -} - -UnaryConstraint.inheritsFrom(Constraint); - -/** - * Adds this constraint to the constraint graph - */ -UnaryConstraint.prototype.addToGraph = function () { - this.myOutput.addConstraint(this); - this.satisfied = false; -} - -/** - * Decides if this constraint can be satisfied and records that - * decision. - */ -UnaryConstraint.prototype.chooseMethod = function (mark) { - this.satisfied = (this.myOutput.mark != mark) - && Strength.stronger(this.strength, this.myOutput.walkStrength); -} - -/** - * Returns true if this constraint is satisfied in the current solution. - */ -UnaryConstraint.prototype.isSatisfied = function () { - return this.satisfied; -} - -UnaryConstraint.prototype.markInputs = function (mark) { - // has no inputs -} - -/** - * Returns the current output variable. - */ -UnaryConstraint.prototype.output = function () { - return this.myOutput; -} - -/** - * Calculate the walkabout strength, the stay flag, and, if it is - * 'stay', the value for the current output of this constraint. Assume - * this constraint is satisfied. - */ -UnaryConstraint.prototype.recalculate = function () { - this.myOutput.walkStrength = this.strength; - this.myOutput.stay = !this.isInput(); - if (this.myOutput.stay) this.execute(); // Stay optimization -} - -/** - * Records that this constraint is unsatisfied - */ -UnaryConstraint.prototype.markUnsatisfied = function () { - this.satisfied = false; -} - -UnaryConstraint.prototype.inputsKnown = function () { - return true; -} - -UnaryConstraint.prototype.removeFromGraph = function () { - if (this.myOutput != null) this.myOutput.removeConstraint(this); - this.satisfied = false; -} - -/* --- * - * S t a y C o n s t r a i n t - * --- */ - -/** - * Variables that should, with some level of preference, stay the same. - * Planners may exploit the fact that instances, if satisfied, will not - * change their output during plan execution. This is called "stay - * optimization". - */ -function StayConstraint(v, str) { - StayConstraint.superConstructor.call(this, v, str); -} - -StayConstraint.inheritsFrom(UnaryConstraint); - -StayConstraint.prototype.execute = function () { - // Stay constraints do nothing -} - -/* --- * - * E d i t C o n s t r a i n t - * --- */ - -/** - * A unary input constraint used to mark a variable that the client - * wishes to change. - */ -function EditConstraint(v, str) { - EditConstraint.superConstructor.call(this, v, str); -} - -EditConstraint.inheritsFrom(UnaryConstraint); - -/** - * Edits indicate that a variable is to be changed by imperative code. - */ -EditConstraint.prototype.isInput = function () { - return true; -} - -EditConstraint.prototype.execute = function () { - // Edit constraints do nothing -} - -/* --- * - * B i n a r y C o n s t r a i n t - * --- */ - -var Direction = new Object(); -Direction.NONE = 0; -Direction.FORWARD = 1; -Direction.BACKWARD = -1; - -/** - * Abstract superclass for constraints having two possible output - * variables. - */ -function BinaryConstraint(var1, var2, strength) { - BinaryConstraint.superConstructor.call(this, strength); - this.v1 = var1; - this.v2 = var2; - this.direction = Direction.NONE; - this.addConstraint(); -} - -BinaryConstraint.inheritsFrom(Constraint); - -/** - * Decides if this constraint can be satisfied and which way it - * should flow based on the relative strength of the variables related, - * and record that decision. - */ -BinaryConstraint.prototype.chooseMethod = function (mark) { - if (this.v1.mark == mark) { - this.direction = (this.v2.mark != mark && Strength.stronger(this.strength, this.v2.walkStrength)) - ? Direction.FORWARD - : Direction.NONE; - } - if (this.v2.mark == mark) { - this.direction = (this.v1.mark != mark && Strength.stronger(this.strength, this.v1.walkStrength)) - ? Direction.BACKWARD - : Direction.NONE; - } - if (Strength.weaker(this.v1.walkStrength, this.v2.walkStrength)) { - this.direction = Strength.stronger(this.strength, this.v1.walkStrength) - ? Direction.BACKWARD - : Direction.NONE; - } else { - this.direction = Strength.stronger(this.strength, this.v2.walkStrength) - ? Direction.FORWARD - : Direction.BACKWARD - } -} - -/** - * Add this constraint to the constraint graph - */ -BinaryConstraint.prototype.addToGraph = function () { - this.v1.addConstraint(this); - this.v2.addConstraint(this); - this.direction = Direction.NONE; -} - -/** - * Answer true if this constraint is satisfied in the current solution. - */ -BinaryConstraint.prototype.isSatisfied = function () { - return this.direction != Direction.NONE; -} - -/** - * Mark the input variable with the given mark. - */ -BinaryConstraint.prototype.markInputs = function (mark) { - this.input().mark = mark; -} - -/** - * Returns the current input variable - */ -BinaryConstraint.prototype.input = function () { - return (this.direction == Direction.FORWARD) ? this.v1 : this.v2; -} - -/** - * Returns the current output variable - */ -BinaryConstraint.prototype.output = function () { - return (this.direction == Direction.FORWARD) ? this.v2 : this.v1; -} - -/** - * Calculate the walkabout strength, the stay flag, and, if it is - * 'stay', the value for the current output of this - * constraint. Assume this constraint is satisfied. - */ -BinaryConstraint.prototype.recalculate = function () { - var ihn = this.input(), out = this.output(); - out.walkStrength = Strength.weakestOf(this.strength, ihn.walkStrength); - out.stay = ihn.stay; - if (out.stay) this.execute(); -} - -/** - * Record the fact that this constraint is unsatisfied. - */ -BinaryConstraint.prototype.markUnsatisfied = function () { - this.direction = Direction.NONE; -} - -BinaryConstraint.prototype.inputsKnown = function (mark) { - var i = this.input(); - return i.mark == mark || i.stay || i.determinedBy == null; -} - -BinaryConstraint.prototype.removeFromGraph = function () { - if (this.v1 != null) this.v1.removeConstraint(this); - if (this.v2 != null) this.v2.removeConstraint(this); - this.direction = Direction.NONE; -} - -/* --- * - * S c a l e C o n s t r a i n t - * --- */ - -/** - * Relates two variables by the linear scaling relationship: "v2 = - * (v1 * scale) + offset". Either v1 or v2 may be changed to maintain - * this relationship but the scale factor and offset are considered - * read-only. - */ -function ScaleConstraint(src, scale, offset, dest, strength) { - this.direction = Direction.NONE; - this.scale = scale; - this.offset = offset; - ScaleConstraint.superConstructor.call(this, src, dest, strength); -} - -ScaleConstraint.inheritsFrom(BinaryConstraint); - -/** - * Adds this constraint to the constraint graph. - */ -ScaleConstraint.prototype.addToGraph = function () { - ScaleConstraint.superConstructor.prototype.addToGraph.call(this); - this.scale.addConstraint(this); - this.offset.addConstraint(this); -} - -ScaleConstraint.prototype.removeFromGraph = function () { - ScaleConstraint.superConstructor.prototype.removeFromGraph.call(this); - if (this.scale != null) this.scale.removeConstraint(this); - if (this.offset != null) this.offset.removeConstraint(this); -} - -ScaleConstraint.prototype.markInputs = function (mark) { - ScaleConstraint.superConstructor.prototype.markInputs.call(this, mark); - this.scale.mark = this.offset.mark = mark; -} - -/** - * Enforce this constraint. Assume that it is satisfied. - */ -ScaleConstraint.prototype.execute = function () { - if (this.direction == Direction.FORWARD) { - this.v2.value = this.v1.value * this.scale.value + this.offset.value; - } else { - this.v1.value = (this.v2.value - this.offset.value) / this.scale.value; - } -} - -/** - * Calculate the walkabout strength, the stay flag, and, if it is - * 'stay', the value for the current output of this constraint. Assume - * this constraint is satisfied. - */ -ScaleConstraint.prototype.recalculate = function () { - var ihn = this.input(), out = this.output(); - out.walkStrength = Strength.weakestOf(this.strength, ihn.walkStrength); - out.stay = ihn.stay && this.scale.stay && this.offset.stay; - if (out.stay) this.execute(); -} - -/* --- * - * E q u a l i t y C o n s t r a i n t - * --- */ - -/** - * Constrains two variables to have the same value. - */ -function EqualityConstraint(var1, var2, strength) { - EqualityConstraint.superConstructor.call(this, var1, var2, strength); -} - -EqualityConstraint.inheritsFrom(BinaryConstraint); - -/** - * Enforce this constraint. Assume that it is satisfied. - */ -EqualityConstraint.prototype.execute = function () { - this.output().value = this.input().value; -} - -/* --- * - * V a r i a b l e - * --- */ - -/** - * A constrained variable. In addition to its value, it maintain the - * structure of the constraint graph, the current dataflow graph, and - * various parameters of interest to the DeltaBlue incremental - * constraint solver. - **/ -function Variable(name, initialValue) { - this.value = initialValue || 0; - this.constraints = new OrderedCollection(); - this.determinedBy = null; - this.mark = 0; - this.walkStrength = Strength.WEAKEST; - this.stay = true; - this.name = name; -} - -/** - * Add the given constraint to the set of all constraints that refer - * this variable. - */ -Variable.prototype.addConstraint = function (c) { - this.constraints.add(c); -} - -/** - * Removes all traces of c from this variable. - */ -Variable.prototype.removeConstraint = function (c) { - this.constraints.remove(c); - if (this.determinedBy == c) this.determinedBy = null; -} - -/* --- * - * P l a n n e r - * --- */ - -/** - * The DeltaBlue planner - */ -function Planner() { - this.currentMark = 0; -} - -/** - * Attempt to satisfy the given constraint and, if successful, - * incrementally update the dataflow graph. Details: If satifying - * the constraint is successful, it may override a weaker constraint - * on its output. The algorithm attempts to resatisfy that - * constraint using some other method. This process is repeated - * until either a) it reaches a variable that was not previously - * determined by any constraint or b) it reaches a constraint that - * is too weak to be satisfied using any of its methods. The - * variables of constraints that have been processed are marked with - * a unique mark value so that we know where we've been. This allows - * the algorithm to avoid getting into an infinite loop even if the - * constraint graph has an inadvertent cycle. - */ -Planner.prototype.incrementalAdd = function (c) { - var mark = this.newMark(); - var overridden = c.satisfy(mark); - while (overridden != null) - overridden = overridden.satisfy(mark); -} - -/** - * Entry point for retracting a constraint. Remove the given - * constraint and incrementally update the dataflow graph. - * Details: Retracting the given constraint may allow some currently - * unsatisfiable downstream constraint to be satisfied. We therefore collect - * a list of unsatisfied downstream constraints and attempt to - * satisfy each one in turn. This list is traversed by constraint - * strength, strongest first, as a heuristic for avoiding - * unnecessarily adding and then overriding weak constraints. - * Assume: c is satisfied. - */ -Planner.prototype.incrementalRemove = function (c) { - var out = c.output(); - c.markUnsatisfied(); - c.removeFromGraph(); - var unsatisfied = this.removePropagateFrom(out); - var strength = Strength.REQUIRED; - do { - for (var i = 0; i < unsatisfied.size(); i++) { - var u = unsatisfied.at(i); - if (u.strength == strength) - this.incrementalAdd(u); - } - strength = strength.nextWeaker(); - } while (strength != Strength.WEAKEST); -} - -/** - * Select a previously unused mark value. - */ -Planner.prototype.newMark = function () { - return ++this.currentMark; -} - -/** - * Extract a plan for resatisfaction starting from the given source - * constraints, usually a set of input constraints. This method - * assumes that stay optimization is desired; the plan will contain - * only constraints whose output variables are not stay. Constraints - * that do no computation, such as stay and edit constraints, are - * not included in the plan. - * Details: The outputs of a constraint are marked when it is added - * to the plan under construction. A constraint may be appended to - * the plan when all its input variables are known. A variable is - * known if either a) the variable is marked (indicating that has - * been computed by a constraint appearing earlier in the plan), b) - * the variable is 'stay' (i.e. it is a constant at plan execution - * time), or c) the variable is not determined by any - * constraint. The last provision is for past states of history - * variables, which are not stay but which are also not computed by - * any constraint. - * Assume: sources are all satisfied. - */ -Planner.prototype.makePlan = function (sources) { - var mark = this.newMark(); - var plan = new Plan(); - var todo = sources; - while (todo.size() > 0) { - var c = todo.removeFirst(); - if (c.output().mark != mark && c.inputsKnown(mark)) { - plan.addConstraint(c); - c.output().mark = mark; - this.addConstraintsConsumingTo(c.output(), todo); - } - } - return plan; -} - -/** - * Extract a plan for resatisfying starting from the output of the - * given constraints, usually a set of input constraints. - */ -Planner.prototype.extractPlanFromConstraints = function (constraints) { - var sources = new OrderedCollection(); - for (var i = 0; i < constraints.size(); i++) { - var c = constraints.at(i); - if (c.isInput() && c.isSatisfied()) - // not in plan already and eligible for inclusion - sources.add(c); - } - return this.makePlan(sources); -} - -/** - * Recompute the walkabout strengths and stay flags of all variables - * downstream of the given constraint and recompute the actual - * values of all variables whose stay flag is true. If a cycle is - * detected, remove the given constraint and answer - * false. Otherwise, answer true. - * Details: Cycles are detected when a marked variable is - * encountered downstream of the given constraint. The sender is - * assumed to have marked the inputs of the given constraint with - * the given mark. Thus, encountering a marked node downstream of - * the output constraint means that there is a path from the - * constraint's output to one of its inputs. - */ -Planner.prototype.addPropagate = function (c, mark) { - var todo = new OrderedCollection(); - todo.add(c); - while (todo.size() > 0) { - var d = todo.removeFirst(); - if (d.output().mark == mark) { - this.incrementalRemove(c); - return false; - } - d.recalculate(); - this.addConstraintsConsumingTo(d.output(), todo); - } - return true; -} - - -/** - * Update the walkabout strengths and stay flags of all variables - * downstream of the given constraint. Answer a collection of - * unsatisfied constraints sorted in order of decreasing strength. - */ -Planner.prototype.removePropagateFrom = function (out) { - out.determinedBy = null; - out.walkStrength = Strength.WEAKEST; - out.stay = true; - var unsatisfied = new OrderedCollection(); - var todo = new OrderedCollection(); - todo.add(out); - while (todo.size() > 0) { - var v = todo.removeFirst(); - for (var i = 0; i < v.constraints.size(); i++) { - var c = v.constraints.at(i); - if (!c.isSatisfied()) - unsatisfied.add(c); - } - var determining = v.determinedBy; - for (var i = 0; i < v.constraints.size(); i++) { - var next = v.constraints.at(i); - if (next != determining && next.isSatisfied()) { - next.recalculate(); - todo.add(next.output()); - } - } - } - return unsatisfied; -} - -Planner.prototype.addConstraintsConsumingTo = function (v, coll) { - var determining = v.determinedBy; - var cc = v.constraints; - for (var i = 0; i < cc.size(); i++) { - var c = cc.at(i); - if (c != determining && c.isSatisfied()) - coll.add(c); - } -} - -/* --- * - * P l a n - * --- */ - -/** - * A Plan is an ordered list of constraints to be executed in sequence - * to resatisfy all currently satisfiable constraints in the face of - * one or more changing inputs. - */ -function Plan() { - this.v = new OrderedCollection(); -} - -Plan.prototype.addConstraint = function (c) { - this.v.add(c); -} - -Plan.prototype.size = function () { - return this.v.size(); -} - -Plan.prototype.constraintAt = function (index) { - return this.v.at(index); -} - -Plan.prototype.execute = function () { - for (var i = 0; i < this.size(); i++) { - var c = this.constraintAt(i); - c.execute(); - } -} - -/* --- * - * M a i n - * --- */ - -/** - * This is the standard DeltaBlue benchmark. A long chain of equality - * constraints is constructed with a stay constraint on one end. An - * edit constraint is then added to the opposite end and the time is - * measured for adding and removing this constraint, and extracting - * and executing a constraint satisfaction plan. There are two cases. - * In case 1, the added constraint is stronger than the stay - * constraint and values must propagate down the entire length of the - * chain. In case 2, the added constraint is weaker than the stay - * constraint so it cannot be accomodated. The cost in this case is, - * of course, very low. Typical situations lie somewhere between these - * two extremes. - */ -function chainTest(n) { - planner = new Planner(); - var prev = null, first = null, last = null; - - // Build chain of n equality constraints - for (var i = 0; i <= n; i++) { - var name = "v" + i; - var v = new Variable(name); - if (prev != null) - new EqualityConstraint(prev, v, Strength.REQUIRED); - if (i == 0) first = v; - if (i == n) last = v; - prev = v; - } - - new StayConstraint(last, Strength.STRONG_DEFAULT); - var edit = new EditConstraint(first, Strength.PREFERRED); - var edits = new OrderedCollection(); - edits.add(edit); - var plan = planner.extractPlanFromConstraints(edits); - for (var i = 0; i < 100; i++) { - first.value = i; - plan.execute(); - if (last.value != i) - alert("Chain test failed."); - } -} - -/** - * This test constructs a two sets of variables related to each - * other by a simple linear transformation (scale and offset). The - * time is measured to change a variable on either side of the - * mapping and to change the scale and offset factors. - */ -function projectionTest(n) { - planner = new Planner(); - var scale = new Variable("scale", 10); - var offset = new Variable("offset", 1000); - var src = null, dst = null; - - var dests = new OrderedCollection(); - for (var i = 0; i < n; i++) { - src = new Variable("src" + i, i); - dst = new Variable("dst" + i, i); - dests.add(dst); - new StayConstraint(src, Strength.NORMAL); - new ScaleConstraint(src, scale, offset, dst, Strength.REQUIRED); - } - - change(src, 17); - if (dst.value != 1170) alert("Projection 1 failed"); - change(dst, 1050); - if (src.value != 5) alert("Projection 2 failed"); - change(scale, 5); - for (var i = 0; i < n - 1; i++) { - if (dests.at(i).value != i * 5 + 1000) - alert("Projection 3 failed"); - } - change(offset, 2000); - for (var i = 0; i < n - 1; i++) { - if (dests.at(i).value != i * 5 + 2000) - alert("Projection 4 failed"); - } -} - -function change(v, newValue) { - var edit = new EditConstraint(v, Strength.PREFERRED); - var edits = new OrderedCollection(); - edits.add(edit); - var plan = planner.extractPlanFromConstraints(edits); - for (var i = 0; i < 10; i++) { - v.value = newValue; - plan.execute(); - } - edit.destroyConstraint(); -} - -// Global variable holding the current planner. -var planner = null; - -function deltaBlue() { - chainTest(100); - projectionTest(100); -} - -for (var i = 0; i < 155; ++i) - deltaBlue(); diff --git a/implementation-contributed/javascriptcore/stress/v8-earley-boyer-strict.js b/implementation-contributed/javascriptcore/stress/v8-earley-boyer-strict.js deleted file mode 100644 index 7794433609..0000000000 --- a/implementation-contributed/javascriptcore/stress/v8-earley-boyer-strict.js +++ /dev/null @@ -1,4592 +0,0 @@ -// [DFG] call-varargs-from-inlined-code-with-odd-number-of-arguments.js fails in POSIX environment if SamplingProfiler is enabled -// https://bugs.webkit.org/show_bug.cgi?id=153704 -//@ if $hostOS == "linux" then defaultNoSamplingProfilerRun else defaultRun end -// This file is automatically generated by scheme2js, except for the -// benchmark harness code at the beginning and end of the file. -"use strict"; - -/************* GENERATED FILE - DO NOT EDIT *************/ -/************* GENERATED FILE - DO NOT EDIT *************/ -/************* GENERATED FILE - DO NOT EDIT *************/ -/************* GENERATED FILE - DO NOT EDIT *************/ -/************* GENERATED FILE - DO NOT EDIT *************/ -/************* GENERATED FILE - DO NOT EDIT *************/ -/************* GENERATED FILE - DO NOT EDIT *************/ -/************* GENERATED FILE - DO NOT EDIT *************/ -/* - * To use write/prints/... the default-output port has to be set first. - * Simply setting SC_DEFAULT_OUT and SC_ERROR_OUT to the desired values - * should do the trick. - * In the following example the std-out and error-port are redirected to - * a DIV. -function initRuntime() { - function escapeHTML(s) { - var tmp = s; - tmp = tmp.replace(/&/g, "&"); - tmp = tmp.replace(/</g, "<"); - tmp = tmp.replace(/>/g, ">"); - tmp = tmp.replace(/ /g, " "); - tmp = tmp.replace(/\n/g, "<br />"); - tmp = tmp.replace(/\t/g, "  "); - return tmp; - - } - - document.write("<div id='stdout'></div>"); - SC_DEFAULT_OUT = new sc_GenericOutputPort( - function(s) { - var stdout = document.getElementById('stdout'); - stdout.innerHTML = stdout.innerHTML + escapeHTML(s); - }); - SC_ERROR_OUT = SC_DEFAULT_OUT; -} -*/ - - -function sc_print_debug() { - sc_print.apply(null, arguments); -} -/*** META ((export *js*)) */ -var sc_JS_GLOBALS = this; - -var __sc_LINE=-1; -var __sc_FILE=""; - -/*** META ((export #t)) */ -function sc_alert() { - var len = arguments.length; - var s = ""; - var i; - - for( i = 0; i < len; i++ ) { - s += sc_toDisplayString(arguments[ i ]); - } - - return alert( s ); -} - -/*** META ((export #t)) */ -function sc_typeof( x ) { - return typeof x; -} - -/*** META ((export #t)) */ -function sc_error() { - var a = [sc_jsstring2symbol("*error*")]; - for (var i = 0; i < arguments.length; i++) { - a[i+1] = arguments[i]; - } - throw a; -} - -/*** META ((export #t) - (peephole (prefix "throw "))) -*/ -function sc_raise(obj) { - throw obj; -} - -/*** META ((export with-handler-lambda)) */ -function sc_withHandlerLambda(handler, body) { - try { - return body(); - } catch(e) { - if (!e._internalException) - return handler(e); - else - throw e; - } -} - -var sc_properties = new Object(); - -/*** META ((export #t)) */ -function sc_putpropBang(sym, key, val) { - var ht = sc_properties[sym]; - if (!ht) { - ht = new Object(); - sc_properties[sym] = ht; - } - ht[key] = val; -} - -/*** META ((export #t)) */ -function sc_getprop(sym, key) { - var ht = sc_properties[sym]; - if (ht) { - if (key in ht) - return ht[key]; - else - return false; - } else - return false; -} - -/*** META ((export #t)) */ -function sc_rempropBang(sym, key) { - var ht = sc_properties[sym]; - if (ht) - delete ht[key]; -} - -/*** META ((export #t)) */ -function sc_any2String(o) { - return jsstring2string(sc_toDisplayString(o)); -} - -/*** META ((export #t) - (peephole (infix 2 2 "===")) - (type bool)) -*/ -function sc_isEqv(o1, o2) { - return (o1 === o2); -} - -/*** META ((export #t) - (peephole (infix 2 2 "===")) - (type bool)) -*/ -function sc_isEq(o1, o2) { - return (o1 === o2); -} - -/*** META ((export #t) - (type bool)) -*/ -function sc_isNumber(n) { - return (typeof n === "number"); -} - -/*** META ((export #t) - (type bool)) -*/ -function sc_isComplex(n) { - return sc_isNumber(n); -} - -/*** META ((export #t) - (type bool)) -*/ -function sc_isReal(n) { - return sc_isNumber(n); -} - -/*** META ((export #t) - (type bool)) -*/ -function sc_isRational(n) { - return sc_isReal(n); -} - -/*** META ((export #t) - (type bool)) -*/ -function sc_isInteger(n) { - return (parseInt(n) === n); -} - -/*** META ((export #t) - (type bool) - (peephole (postfix ", false"))) -*/ -// we don't have exact numbers... -function sc_isExact(n) { - return false; -} - -/*** META ((export #t) - (peephole (postfix ", true")) - (type bool)) -*/ -function sc_isInexact(n) { - return true; -} - -/*** META ((export = =fx =fl) - (type bool) - (peephole (infix 2 2 "==="))) -*/ -function sc_equal(x) { - for (var i = 1; i < arguments.length; i++) - if (x !== arguments[i]) - return false; - return true; -} - -/*** META ((export < <fx <fl) - (type bool) - (peephole (infix 2 2 "<"))) -*/ -function sc_less(x) { - for (var i = 1; i < arguments.length; i++) { - if (x >= arguments[i]) - return false; - x = arguments[i]; - } - return true; -} - -/*** META ((export > >fx >fl) - (type bool) - (peephole (infix 2 2 ">"))) -*/ -function sc_greater(x, y) { - for (var i = 1; i < arguments.length; i++) { - if (x <= arguments[i]) - return false; - x = arguments[i]; - } - return true; -} - -/*** META ((export <= <=fx <=fl) - (type bool) - (peephole (infix 2 2 "<="))) -*/ -function sc_lessEqual(x, y) { - for (var i = 1; i < arguments.length; i++) { - if (x > arguments[i]) - return false; - x = arguments[i]; - } - return true; -} - -/*** META ((export >= >=fl >=fx) - (type bool) - (peephole (infix 2 2 ">="))) -*/ -function sc_greaterEqual(x, y) { - for (var i = 1; i < arguments.length; i++) { - if (x < arguments[i]) - return false; - x = arguments[i]; - } - return true; -} - -/*** META ((export #t) - (type bool) - (peephole (postfix "=== 0"))) -*/ -function sc_isZero(x) { - return (x === 0); -} - -/*** META ((export #t) - (type bool) - (peephole (postfix "> 0"))) -*/ -function sc_isPositive(x) { - return (x > 0); -} - -/*** META ((export #t) - (type bool) - (peephole (postfix "< 0"))) -*/ -function sc_isNegative(x) { - return (x < 0); -} - -/*** META ((export #t) - (type bool) - (peephole (postfix "%2===1"))) -*/ -function sc_isOdd(x) { - return (x % 2 === 1); -} - -/*** META ((export #t) - (type bool) - (peephole (postfix "%2===0"))) -*/ -function sc_isEven(x) { - return (x % 2 === 0); -} - -/*** META ((export #t)) */ -var sc_max = Math.max; -/*** META ((export #t)) */ -var sc_min = Math.min; - -/*** META ((export + +fx +fl) - (peephole (infix 0 #f "+" "0"))) -*/ -function sc_plus() { - var sum = 0; - for (var i = 0; i < arguments.length; i++) - sum += arguments[i]; - return sum; -} - -/*** META ((export * *fx *fl) - (peephole (infix 0 #f "*" "1"))) -*/ -function sc_multi() { - var product = 1; - for (var i = 0; i < arguments.length; i++) - product *= arguments[i]; - return product; -} - -/*** META ((export - -fx -fl) - (peephole (minus))) -*/ -function sc_minus(x) { - if (arguments.length === 1) - return -x; - else { - var res = x; - for (var i = 1; i < arguments.length; i++) - res -= arguments[i]; - return res; - } -} - -/*** META ((export / /fl) - (peephole (div))) -*/ -function sc_div(x) { - if (arguments.length === 1) - return 1/x; - else { - var res = x; - for (var i = 1; i < arguments.length; i++) - res /= arguments[i]; - return res; - } -} - -/*** META ((export #t)) */ -var sc_abs = Math.abs; - -/*** META ((export quotient /fx) - (peephole (hole 2 "parseInt(" x "/" y ")"))) -*/ -function sc_quotient(x, y) { - return parseInt(x / y); -} - -/*** META ((export #t) - (peephole (infix 2 2 "%"))) -*/ -function sc_remainder(x, y) { - return x % y; -} - -/*** META ((export #t) - (peephole (modulo))) -*/ -function sc_modulo(x, y) { - var remainder = x % y; - // if they don't have the same sign - if ((remainder * y) < 0) - return remainder + y; - else - return remainder; -} - -function sc_euclid_gcd(a, b) { - var temp; - if (a === 0) return b; - if (b === 0) return a; - if (a < 0) {a = -a;}; - if (b < 0) {b = -b;}; - if (b > a) {temp = a; a = b; b = temp;}; - while (true) { - a %= b; - if(a === 0) {return b;}; - b %= a; - if(b === 0) {return a;}; - }; - return b; -} - -/*** META ((export #t)) */ -function sc_gcd() { - var gcd = 0; - for (var i = 0; i < arguments.length; i++) - gcd = sc_euclid_gcd(gcd, arguments[i]); - return gcd; -} - -/*** META ((export #t)) */ -function sc_lcm() { - var lcm = 1; - for (var i = 0; i < arguments.length; i++) { - var f = Math.round(arguments[i] / sc_euclid_gcd(arguments[i], lcm)); - lcm *= Math.abs(f); - } - return lcm; -} - -// LIMITATION: numerator and denominator don't make sense in floating point world. -//var SC_MAX_DECIMALS = 1000000 -// -// function sc_numerator(x) { -// var rounded = Math.round(x * SC_MAX_DECIMALS); -// return Math.round(rounded / sc_euclid_gcd(rounded, SC_MAX_DECIMALS)); -// } - -// function sc_denominator(x) { -// var rounded = Math.round(x * SC_MAX_DECIMALS); -// return Math.round(SC_MAX_DECIMALS / sc_euclid_gcd(rounded, SC_MAX_DECIMALS)); -// } - -/*** META ((export #t)) */ -var sc_floor = Math.floor; -/*** META ((export #t)) */ -var sc_ceiling = Math.ceil; -/*** META ((export #t)) */ -var sc_truncate = parseInt; -/*** META ((export #t)) */ -var sc_round = Math.round; - -// LIMITATION: sc_rationalize doesn't make sense in a floating point world. - -/*** META ((export #t)) */ -var sc_exp = Math.exp; -/*** META ((export #t)) */ -var sc_log = Math.log; -/*** META ((export #t)) */ -var sc_sin = Math.sin; -/*** META ((export #t)) */ -var sc_cos = Math.cos; -/*** META ((export #t)) */ -var sc_tan = Math.tan; -/*** META ((export #t)) */ -var sc_asin = Math.asin; -/*** META ((export #t)) */ -var sc_acos = Math.acos; -/*** META ((export #t)) */ -var sc_atan = Math.atan; - -/*** META ((export #t)) */ -var sc_sqrt = Math.sqrt; -/*** META ((export #t)) */ -var sc_expt = Math.pow; - -// LIMITATION: we don't have complex numbers. -// LIMITATION: the following functions are hence not implemented. -// LIMITATION: make-rectangular, make-polar, real-part, imag-part, magnitude, angle -// LIMITATION: 2 argument atan - -/*** META ((export #t) - (peephole (id))) -*/ -function sc_exact2inexact(x) { - return x; -} - -/*** META ((export #t) - (peephole (id))) -*/ -function sc_inexact2exact(x) { - return x; -} - -function sc_number2jsstring(x, radix) { - if (radix) - return x.toString(radix); - else - return x.toString(); -} - -function sc_jsstring2number(s, radix) { - if (s === "") return false; - - if (radix) { - var t = parseInt(s, radix); - if (!t && t !== 0) return false; - // verify that each char is in range. (parseInt ignores leading - // white and trailing chars) - var allowedChars = "01234567890abcdefghijklmnopqrstuvwxyz".substring(0, radix+1); - if ((new RegExp("^["+allowedChars+"]*$", "i")).test(s)) - return t; - else return false; - } else { - var t = +s; // does not ignore trailing chars. - if (!t && t !== 0) return false; - // simply verify that first char is not whitespace. - var c = s.charAt(0); - // if +c is 0, but the char is not "0", then we have a whitespace. - if (+c === 0 && c !== "0") return false; - return t; - } -} - -/*** META ((export #t) - (type bool) - (peephole (not))) -*/ -function sc_not(b) { - return b === false; -} - -/*** META ((export #t) - (type bool)) -*/ -function sc_isBoolean(b) { - return (b === true) || (b === false); -} - -function sc_Pair(car, cdr) { - this.car = car; - this.cdr = cdr; -} - -sc_Pair.prototype.toString = function() { - return sc_toDisplayString(this); -}; -sc_Pair.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) { - var current = this; - - var res = "("; - - while(true) { - res += writeOrDisplay(current.car); - if (sc_isPair(current.cdr)) { - res += " "; - current = current.cdr; - } else if (current.cdr !== null) { - res += " . " + writeOrDisplay(current.cdr); - break; - } else // current.cdr == null - break; - } - - res += ")"; - - return res; -}; -sc_Pair.prototype.sc_toDisplayString = function() { - return this.sc_toWriteOrDisplayString(sc_toDisplayString); -}; -sc_Pair.prototype.sc_toWriteString = function() { - return this.sc_toWriteOrDisplayString(sc_toWriteString); -}; -// sc_Pair.prototype.sc_toWriteCircleString in IO.js - -/*** META ((export #t) - (type bool) - (peephole (postfix " instanceof sc_Pair"))) -*/ -function sc_isPair(p) { - return (p instanceof sc_Pair); -} - -function sc_isPairEqual(p1, p2, comp) { - return (comp(p1.car, p2.car) && comp(p1.cdr, p2.cdr)); -} - -/*** META ((export #t) - (peephole (hole 2 "new sc_Pair(" car ", " cdr ")"))) -*/ -function sc_cons(car, cdr) { - return new sc_Pair(car, cdr); -} - -/*** META ((export cons*)) */ -function sc_consStar() { - var res = arguments[arguments.length - 1]; - for (var i = arguments.length-2; i >= 0; i--) - res = new sc_Pair(arguments[i], res); - return res; -} - -/*** META ((export #t) - (peephole (postfix ".car"))) -*/ -function sc_car(p) { - return p.car; -} - -/*** META ((export #t) - (peephole (postfix ".cdr"))) -*/ -function sc_cdr(p) { - return p.cdr; -} - -/*** META ((export #t) - (peephole (hole 2 p ".car = " val))) -*/ -function sc_setCarBang(p, val) { - p.car = val; -} - -/*** META ((export #t) - (peephole (hole 2 p ".cdr = " val))) -*/ -function sc_setCdrBang(p, val) { - p.cdr = val; -} - -/*** META ((export #t) - (peephole (postfix ".car.car"))) -*/ -function sc_caar(p) { return p.car.car; } -/*** META ((export #t) - (peephole (postfix ".cdr.car"))) -*/ -function sc_cadr(p) { return p.cdr.car; } -/*** META ((export #t) - (peephole (postfix ".car.cdr"))) -*/ -function sc_cdar(p) { return p.car.cdr; } -/*** META ((export #t) - (peephole (postfix ".cdr.cdr"))) -*/ -function sc_cddr(p) { return p.cdr.cdr; } -/*** META ((export #t) - (peephole (postfix ".car.car.car"))) -*/ -function sc_caaar(p) { return p.car.car.car; } -/*** META ((export #t) - (peephole (postfix ".car.cdr.car"))) -*/ -function sc_cadar(p) { return p.car.cdr.car; } -/*** META ((export #t) - (peephole (postfix ".cdr.car.car"))) -*/ -function sc_caadr(p) { return p.cdr.car.car; } -/*** META ((export #t) - (peephole (postfix ".cdr.cdr.car"))) -*/ -function sc_caddr(p) { return p.cdr.cdr.car; } -/*** META ((export #t) - (peephole (postfix ".car.car.cdr"))) -*/ -function sc_cdaar(p) { return p.car.car.cdr; } -/*** META ((export #t) - (peephole (postfix ".cdr.car.cdr"))) -*/ -function sc_cdadr(p) { return p.cdr.car.cdr; } -/*** META ((export #t) - (peephole (postfix ".car.cdr.cdr"))) -*/ -function sc_cddar(p) { return p.car.cdr.cdr; } -/*** META ((export #t) - (peephole (postfix ".cdr.cdr.cdr"))) -*/ -function sc_cdddr(p) { return p.cdr.cdr.cdr; } -/*** META ((export #t) - (peephole (postfix ".car.car.car.car"))) -*/ -function sc_caaaar(p) { return p.car.car.car.car; } -/*** META ((export #t) - (peephole (postfix ".car.cdr.car.car"))) -*/ -function sc_caadar(p) { return p.car.cdr.car.car; } -/*** META ((export #t) - (peephole (postfix ".cdr.car.car.car"))) -*/ -function sc_caaadr(p) { return p.cdr.car.car.car; } -/*** META ((export #t) - (peephole (postfix ".cdr.cdr.car.car"))) -*/ -function sc_caaddr(p) { return p.cdr.cdr.car.car; } -/*** META ((export #t) - (peephole (postfix ".car.car.car.cdr"))) -*/ -function sc_cdaaar(p) { return p.car.car.car.cdr; } -/*** META ((export #t) - (peephole (postfix ".car.cdr.car.cdr"))) -*/ -function sc_cdadar(p) { return p.car.cdr.car.cdr; } -/*** META ((export #t) - (peephole (postfix ".cdr.car.car.cdr"))) -*/ -function sc_cdaadr(p) { return p.cdr.car.car.cdr; } -/*** META ((export #t) - (peephole (postfix ".cdr.cdr.car.cdr"))) -*/ -function sc_cdaddr(p) { return p.cdr.cdr.car.cdr; } -/*** META ((export #t) - (peephole (postfix ".car.car.cdr.car"))) -*/ -function sc_cadaar(p) { return p.car.car.cdr.car; } -/*** META ((export #t) - (peephole (postfix ".car.cdr.cdr.car"))) -*/ -function sc_caddar(p) { return p.car.cdr.cdr.car; } -/*** META ((export #t) - (peephole (postfix ".cdr.car.cdr.car"))) -*/ -function sc_cadadr(p) { return p.cdr.car.cdr.car; } -/*** META ((export #t) - (peephole (postfix ".cdr.cdr.cdr.car"))) -*/ -function sc_cadddr(p) { return p.cdr.cdr.cdr.car; } -/*** META ((export #t) - (peephole (postfix ".car.car.cdr.cdr"))) -*/ -function sc_cddaar(p) { return p.car.car.cdr.cdr; } -/*** META ((export #t) - (peephole (postfix ".car.cdr.cdr.cdr"))) -*/ -function sc_cdddar(p) { return p.car.cdr.cdr.cdr; } -/*** META ((export #t) - (peephole (postfix ".cdr.car.cdr.cdr"))) -*/ -function sc_cddadr(p) { return p.cdr.car.cdr.cdr; } -/*** META ((export #t) - (peephole (postfix ".cdr.cdr.cdr.cdr"))) -*/ -function sc_cddddr(p) { return p.cdr.cdr.cdr.cdr; } - -/*** META ((export #t)) */ -function sc_lastPair(l) { - if (!sc_isPair(l)) sc_error("sc_lastPair: pair expected"); - var res = l; - var cdr = l.cdr; - while (sc_isPair(cdr)) { - res = cdr; - cdr = res.cdr; - } - return res; -} - -/*** META ((export #t) - (type bool) - (peephole (postfix " === null"))) -*/ -function sc_isNull(o) { - return (o === null); -} - -/*** META ((export #t) - (type bool)) -*/ -function sc_isList(o) { - var rabbit; - var turtle; - - var rabbit = o; - var turtle = o; - while (true) { - if (rabbit === null || - (rabbit instanceof sc_Pair && rabbit.cdr === null)) - return true; // end of list - else if ((rabbit instanceof sc_Pair) && - (rabbit.cdr instanceof sc_Pair)) { - rabbit = rabbit.cdr.cdr; - turtle = turtle.cdr; - if (rabbit === turtle) return false; // cycle - } else - return false; // not pair - } -} - -/*** META ((export #t)) */ -function sc_list() { - var res = null; - var a = arguments; - for (var i = a.length-1; i >= 0; i--) - res = new sc_Pair(a[i], res); - return res; -} - -/*** META ((export #t)) */ -function sc_iota(num, init) { - var res = null; - if (!init) init = 0; - for (var i = num - 1; i >= 0; i--) - res = new sc_Pair(i + init, res); - return res; -} - -/*** META ((export #t)) */ -function sc_makeList(nbEls, fill) { - var res = null; - for (var i = 0; i < nbEls; i++) - res = new sc_Pair(fill, res); - return res; -} - -/*** META ((export #t)) */ -function sc_length(l) { - var res = 0; - while (l !== null) { - res++; - l = l.cdr; - } - return res; -} - -/*** META ((export #t)) */ -function sc_remq(o, l) { - var dummy = { cdr : null }; - var tail = dummy; - while (l !== null) { - if (l.car !== o) { - tail.cdr = sc_cons(l.car, null); - tail = tail.cdr; - } - l = l.cdr; - } - return dummy.cdr; -} - -/*** META ((export #t)) */ -function sc_remqBang(o, l) { - var dummy = { cdr : null }; - var tail = dummy; - var needsAssig = true; - while (l !== null) { - if (l.car === o) { - needsAssig = true; - } else { - if (needsAssig) { - tail.cdr = l; - needsAssig = false; - } - tail = l; - } - l = l.cdr; - } - tail.cdr = null; - return dummy.cdr; -} - -/*** META ((export #t)) */ -function sc_delete(o, l) { - var dummy = { cdr : null }; - var tail = dummy; - while (l !== null) { - if (!sc_isEqual(l.car, o)) { - tail.cdr = sc_cons(l.car, null); - tail = tail.cdr; - } - l = l.cdr; - } - return dummy.cdr; -} - -/*** META ((export #t)) */ -function sc_deleteBang(o, l) { - var dummy = { cdr : null }; - var tail = dummy; - var needsAssig = true; - while (l !== null) { - if (sc_isEqual(l.car, o)) { - needsAssig = true; - } else { - if (needsAssig) { - tail.cdr = l; - needsAssig = false; - } - tail = l; - } - l = l.cdr; - } - tail.cdr = null; - return dummy.cdr; -} - -function sc_reverseAppendBang(l1, l2) { - var res = l2; - while (l1 !== null) { - var tmp = res; - res = l1; - l1 = l1.cdr; - res.cdr = tmp; - } - return res; -} - -function sc_dualAppend(l1, l2) { - if (l1 === null) return l2; - if (l2 === null) return l1; - var rev = sc_reverse(l1); - return sc_reverseAppendBang(rev, l2); -} - -/*** META ((export #t)) */ -function sc_append() { - if (arguments.length === 0) - return null; - var res = arguments[arguments.length - 1]; - for (var i = arguments.length - 2; i >= 0; i--) - res = sc_dualAppend(arguments[i], res); - return res; -} - -function sc_dualAppendBang(l1, l2) { - if (l1 === null) return l2; - if (l2 === null) return l1; - var tmp = l1; - while (tmp.cdr !== null) tmp=tmp.cdr; - tmp.cdr = l2; - return l1; -} - -/*** META ((export #t)) */ -function sc_appendBang() { - var res = null; - for (var i = 0; i < arguments.length; i++) - res = sc_dualAppendBang(res, arguments[i]); - return res; -} - -/*** META ((export #t)) */ -function sc_reverse(l1) { - var res = null; - while (l1 !== null) { - res = sc_cons(l1.car, res); - l1 = l1.cdr; - } - return res; -} - -/*** META ((export #t)) */ -function sc_reverseBang(l) { - return sc_reverseAppendBang(l, null); -} - -/*** META ((export #t)) */ -function sc_listTail(l, k) { - var res = l; - for (var i = 0; i < k; i++) { - res = res.cdr; - } - return res; -} - -/*** META ((export #t)) */ -function sc_listRef(l, k) { - return sc_listTail(l, k).car; -} - -/* // unoptimized generic versions -function sc_memX(o, l, comp) { - while (l != null) { - if (comp(l.car, o)) - return l; - l = l.cdr; - } - return false; -} -function sc_memq(o, l) { return sc_memX(o, l, sc_isEq); } -function sc_memv(o, l) { return sc_memX(o, l, sc_isEqv); } -function sc_member(o, l) { return sc_memX(o, l, sc_isEqual); } -*/ - -/* optimized versions */ -/*** META ((export #t)) */ -function sc_memq(o, l) { - while (l !== null) { - if (l.car === o) - return l; - l = l.cdr; - } - return false; -} -/*** META ((export #t)) */ -function sc_memv(o, l) { - while (l !== null) { - if (l.car === o) - return l; - l = l.cdr; - } - return false; -} -/*** META ((export #t)) */ -function sc_member(o, l) { - while (l !== null) { - if (sc_isEqual(l.car,o)) - return l; - l = l.cdr; - } - return false; -} - -/* // generic unoptimized versions -function sc_assX(o, al, comp) { - while (al != null) { - if (comp(al.car.car, o)) - return al.car; - al = al.cdr; - } - return false; -} -function sc_assq(o, al) { return sc_assX(o, al, sc_isEq); } -function sc_assv(o, al) { return sc_assX(o, al, sc_isEqv); } -function sc_assoc(o, al) { return sc_assX(o, al, sc_isEqual); } -*/ -// optimized versions -/*** META ((export #t)) */ -function sc_assq(o, al) { - while (al !== null) { - if (al.car.car === o) - return al.car; - al = al.cdr; - } - return false; -} -/*** META ((export #t)) */ -function sc_assv(o, al) { - while (al !== null) { - if (al.car.car === o) - return al.car; - al = al.cdr; - } - return false; -} -/*** META ((export #t)) */ -function sc_assoc(o, al) { - while (al !== null) { - if (sc_isEqual(al.car.car, o)) - return al.car; - al = al.cdr; - } - return false; -} - -/* can be used for mutable strings and characters */ -function sc_isCharStringEqual(cs1, cs2) { return cs1.val === cs2.val; } -function sc_isCharStringLess(cs1, cs2) { return cs1.val < cs2.val; } -function sc_isCharStringGreater(cs1, cs2) { return cs1.val > cs2.val; } -function sc_isCharStringLessEqual(cs1, cs2) { return cs1.val <= cs2.val; } -function sc_isCharStringGreaterEqual(cs1, cs2) { return cs1.val >= cs2.val; } -function sc_isCharStringCIEqual(cs1, cs2) - { return cs1.val.toLowerCase() === cs2.val.toLowerCase(); } -function sc_isCharStringCILess(cs1, cs2) - { return cs1.val.toLowerCase() < cs2.val.toLowerCase(); } -function sc_isCharStringCIGreater(cs1, cs2) - { return cs1.val.toLowerCase() > cs2.val.toLowerCase(); } -function sc_isCharStringCILessEqual(cs1, cs2) - { return cs1.val.toLowerCase() <= cs2.val.toLowerCase(); } -function sc_isCharStringCIGreaterEqual(cs1, cs2) - { return cs1.val.toLowerCase() >= cs2.val.toLowerCase(); } - - - - -function sc_Char(c) { - var cached = sc_Char.lazy[c]; - if (cached) - return cached; - this.val = c; - sc_Char.lazy[c] = this; - // add return, so FF does not complain. - return undefined; -} -sc_Char.lazy = new Object(); - -sc_Char.prototype.toString = function() { - return this.val; -}; -// sc_toDisplayString == toString -sc_Char.prototype.sc_toWriteString = function() { - return "#\\" + this.val; -}; - -/*** META ((export #t) - (type bool) - (peephole (postfix "instanceof sc_Char"))) -*/ -function sc_isChar(c) { - return (c instanceof sc_Char); -} - -/*** META ((export char=?) - (type bool) - (peephole (hole 2 c1 ".val === " c2 ".val"))) -*/ -var sc_isCharEqual = sc_isCharStringEqual; -/*** META ((export char<?) - (type bool) - (peephole (hole 2 c1 ".val < " c2 ".val"))) -*/ -var sc_isCharLess = sc_isCharStringLess; -/*** META ((export char>?) - (type bool) - (peephole (hole 2 c1 ".val > " c2 ".val"))) -*/ -var sc_isCharGreater = sc_isCharStringGreater; -/*** META ((export char<=?) - (type bool) - (peephole (hole 2 c1 ".val <= " c2 ".val"))) -*/ -var sc_isCharLessEqual = sc_isCharStringLessEqual; -/*** META ((export char>=?) - (type bool) - (peephole (hole 2 c1 ".val >= " c2 ".val"))) -*/ -var sc_isCharGreaterEqual = sc_isCharStringGreaterEqual; -/*** META ((export char-ci=?) - (type bool) - (peephole (hole 2 c1 ".val.toLowerCase() === " c2 ".val.toLowerCase()"))) -*/ -var sc_isCharCIEqual = sc_isCharStringCIEqual; -/*** META ((export char-ci<?) - (type bool) - (peephole (hole 2 c1 ".val.toLowerCase() < " c2 ".val.toLowerCase()"))) -*/ -var sc_isCharCILess = sc_isCharStringCILess; -/*** META ((export char-ci>?) - (type bool) - (peephole (hole 2 c1 ".val.toLowerCase() > " c2 ".val.toLowerCase()"))) -*/ -var sc_isCharCIGreater = sc_isCharStringCIGreater; -/*** META ((export char-ci<=?) - (type bool) - (peephole (hole 2 c1 ".val.toLowerCase() <= " c2 ".val.toLowerCase()"))) -*/ -var sc_isCharCILessEqual = sc_isCharStringCILessEqual; -/*** META ((export char-ci>=?) - (type bool) - (peephole (hole 2 c1 ".val.toLowerCase() >= " c2 ".val.toLowerCase()"))) -*/ -var sc_isCharCIGreaterEqual = sc_isCharStringCIGreaterEqual; - -var SC_NUMBER_CLASS = "0123456789"; -var SC_WHITESPACE_CLASS = ' \r\n\t\f'; -var SC_LOWER_CLASS = 'abcdefghijklmnopqrstuvwxyz'; -var SC_UPPER_CLASS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - -function sc_isCharOfClass(c, cl) { return (cl.indexOf(c) != -1); } -/*** META ((export #t) - (type bool)) -*/ -function sc_isCharAlphabetic(c) - { return sc_isCharOfClass(c.val, SC_LOWER_CLASS) || - sc_isCharOfClass(c.val, SC_UPPER_CLASS); } -/*** META ((export #t) - (type bool) - (peephole (hole 1 "SC_NUMBER_CLASS.indexOf(" c ".val) != -1"))) -*/ -function sc_isCharNumeric(c) - { return sc_isCharOfClass(c.val, SC_NUMBER_CLASS); } -/*** META ((export #t) - (type bool)) -*/ -function sc_isCharWhitespace(c) { - var tmp = c.val; - return tmp === " " || tmp === "\r" || tmp === "\n" || tmp === "\t" || tmp === "\f"; -} -/*** META ((export #t) - (type bool) - (peephole (hole 1 "SC_UPPER_CLASS.indexOf(" c ".val) != -1"))) -*/ -function sc_isCharUpperCase(c) - { return sc_isCharOfClass(c.val, SC_UPPER_CLASS); } -/*** META ((export #t) - (type bool) - (peephole (hole 1 "SC_LOWER_CLASS.indexOf(" c ".val) != -1"))) -*/ -function sc_isCharLowerCase(c) - { return sc_isCharOfClass(c.val, SC_LOWER_CLASS); } - -/*** META ((export #t) - (peephole (postfix ".val.charCodeAt(0)"))) -*/ -function sc_char2integer(c) - { return c.val.charCodeAt(0); } -/*** META ((export #t) - (peephole (hole 1 "new sc_Char(String.fromCharCode(" n "))"))) -*/ -function sc_integer2char(n) - { return new sc_Char(String.fromCharCode(n)); } - -/*** META ((export #t) - (peephole (hole 1 "new sc_Char(" c ".val.toUpperCase())"))) -*/ -function sc_charUpcase(c) - { return new sc_Char(c.val.toUpperCase()); } -/*** META ((export #t) - (peephole (hole 1 "new sc_Char(" c ".val.toLowerCase())"))) -*/ -function sc_charDowncase(c) - { return new sc_Char(c.val.toLowerCase()); } - -function sc_makeJSStringOfLength(k, c) { - var fill; - if (c === undefined) - fill = " "; - else - fill = c; - var res = ""; - var len = 1; - // every round doubles the size of fill. - while (k >= len) { - if (k & len) - res = res.concat(fill); - fill = fill.concat(fill); - len *= 2; - } - return res; -} - -function sc_makejsString(k, c) { - var fill; - if (c) - fill = c.val; - else - fill = " "; - return sc_makeJSStringOfLength(k, fill); -} - -function sc_jsstring2list(s) { - var res = null; - for (var i = s.length - 1; i >= 0; i--) - res = sc_cons(new sc_Char(s.charAt(i)), res); - return res; -} - -function sc_list2jsstring(l) { - var a = new Array(); - while(l !== null) { - a.push(l.car.val); - l = l.cdr; - } - return "".concat.apply("", a); -} - -var sc_Vector = Array; - -sc_Vector.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) { - if (this.length === 0) return "#()"; - - var res = "#(" + writeOrDisplay(this[0]); - for (var i = 1; i < this.length; i++) - res += " " + writeOrDisplay(this[i]); - res += ")"; - return res; -}; -sc_Vector.prototype.sc_toDisplayString = function() { - return this.sc_toWriteOrDisplayString(sc_toDisplayString); -}; -sc_Vector.prototype.sc_toWriteString = function() { - return this.sc_toWriteOrDisplayString(sc_toWriteString); -}; - -/*** META ((export vector? array?) - (type bool) - (peephole (postfix " instanceof sc_Vector"))) -*/ -function sc_isVector(v) { - return (v instanceof sc_Vector); -} - -// only applies to vectors -function sc_isVectorEqual(v1, v2, comp) { - if (v1.length !== v2.length) return false; - for (var i = 0; i < v1.length; i++) - if (!comp(v1[i], v2[i])) return false; - return true; -} - -/*** META ((export make-vector make-array)) */ -function sc_makeVector(size, fill) { - var a = new sc_Vector(size); - if (fill !== undefined) - sc_vectorFillBang(a, fill); - return a; -} - -/*** META ((export vector array) - (peephole (vector))) -*/ -function sc_vector() { - var a = new sc_Vector(); - for (var i = 0; i < arguments.length; i++) - a.push(arguments[i]); - return a; -} - -/*** META ((export vector-length array-length) - (peephole (postfix ".length"))) -*/ -function sc_vectorLength(v) { - return v.length; -} - -/*** META ((export vector-ref array-ref) - (peephole (hole 2 v "[" pos "]"))) -*/ -function sc_vectorRef(v, pos) { - return v[pos]; -} - -/*** META ((export vector-set! array-set!) - (peephole (hole 3 v "[" pos "] = " val))) -*/ -function sc_vectorSetBang(v, pos, val) { - v[pos] = val; -} - -/*** META ((export vector->list array->list)) */ -function sc_vector2list(a) { - var res = null; - for (var i = a.length-1; i >= 0; i--) - res = sc_cons(a[i], res); - return res; -} - -/*** META ((export list->vector list->array)) */ -function sc_list2vector(l) { - var a = new sc_Vector(); - while(l !== null) { - a.push(l.car); - l = l.cdr; - } - return a; -} - -/*** META ((export vector-fill! array-fill!)) */ -function sc_vectorFillBang(a, fill) { - for (var i = 0; i < a.length; i++) - a[i] = fill; -} - - -/*** META ((export #t)) */ -function sc_copyVector(a, len) { - if (len <= a.length) - return a.slice(0, len); - else { - var tmp = a.concat(); - tmp.length = len; - return tmp; - } -} - -/*** META ((export #t) - (peephole (hole 3 a ".slice(" start "," end ")"))) -*/ -function sc_vectorCopy(a, start, end) { - return a.slice(start, end); -} - -/*** META ((export #t)) */ -function sc_vectorCopyBang(target, tstart, source, sstart, send) { - if (!sstart) sstart = 0; - if (!send) send = source.length; - - // if target == source we don't want to overwrite not yet copied elements. - if (tstart <= sstart) { - for (var i = tstart, j = sstart; j < send; i++, j++) { - target[i] = source[j]; - } - } else { - var diff = send - sstart; - for (var i = tstart + diff - 1, j = send - 1; - j >= sstart; - i--, j--) { - target[i] = source[j]; - } - } - return target; -} - -/*** META ((export #t) - (type bool) - (peephole (hole 1 "typeof " o " === 'function'"))) -*/ -function sc_isProcedure(o) { - return (typeof o === "function"); -} - -/*** META ((export #t)) */ -function sc_apply(proc) { - var args = new Array(); - // first part of arguments are not in list-form. - for (var i = 1; i < arguments.length - 1; i++) - args.push(arguments[i]); - var l = arguments[arguments.length - 1]; - while (l !== null) { - args.push(l.car); - l = l.cdr; - } - return proc.apply(null, args); -} - -/*** META ((export #t)) */ -function sc_map(proc, l1) { - if (l1 === undefined) - return null; - // else - var nbApplyArgs = arguments.length - 1; - var applyArgs = new Array(nbApplyArgs); - var revres = null; - while (l1 !== null) { - for (var i = 0; i < nbApplyArgs; i++) { - applyArgs[i] = arguments[i + 1].car; - arguments[i + 1] = arguments[i + 1].cdr; - } - revres = sc_cons(proc.apply(null, applyArgs), revres); - } - return sc_reverseAppendBang(revres, null); -} - -/*** META ((export #t)) */ -function sc_mapBang(proc, l1) { - if (l1 === undefined) - return null; - // else - var l1_orig = l1; - var nbApplyArgs = arguments.length - 1; - var applyArgs = new Array(nbApplyArgs); - while (l1 !== null) { - var tmp = l1; - for (var i = 0; i < nbApplyArgs; i++) { - applyArgs[i] = arguments[i + 1].car; - arguments[i + 1] = arguments[i + 1].cdr; - } - tmp.car = proc.apply(null, applyArgs); - } - return l1_orig; -} - -/*** META ((export #t)) */ -function sc_forEach(proc, l1) { - if (l1 === undefined) - return undefined; - // else - var nbApplyArgs = arguments.length - 1; - var applyArgs = new Array(nbApplyArgs); - while (l1 !== null) { - for (var i = 0; i < nbApplyArgs; i++) { - applyArgs[i] = arguments[i + 1].car; - arguments[i + 1] = arguments[i + 1].cdr; - } - proc.apply(null, applyArgs); - } - // add return so FF does not complain. - return undefined; -} - -/*** META ((export #t)) */ -function sc_filter(proc, l1) { - var dummy = { cdr : null }; - var tail = dummy; - while (l1 !== null) { - if (proc(l1.car) !== false) { - tail.cdr = sc_cons(l1.car, null); - tail = tail.cdr; - } - l1 = l1.cdr; - } - return dummy.cdr; -} - -/*** META ((export #t)) */ -function sc_filterBang(proc, l1) { - var head = sc_cons("dummy", l1); - var it = head; - var next = l1; - while (next !== null) { - if (proc(next.car) !== false) { - it.cdr = next - it = next; - } - next = next.cdr; - } - it.cdr = null; - return head.cdr; -} - -function sc_filterMap1(proc, l1) { - var revres = null; - while (l1 !== null) { - var tmp = proc(l1.car) - if (tmp !== false) revres = sc_cons(tmp, revres); - l1 = l1.cdr; - } - return sc_reverseAppendBang(revres, null); -} -function sc_filterMap2(proc, l1, l2) { - var revres = null; - while (l1 !== null) { - var tmp = proc(l1.car, l2.car); - if(tmp !== false) revres = sc_cons(tmp, revres); - l1 = l1.cdr; - l2 = l2.cdr - } - return sc_reverseAppendBang(revres, null); -} - -/*** META ((export #t)) */ -function sc_filterMap(proc, l1, l2, l3) { - if (l2 === undefined) - return sc_filterMap1(proc, l1); - else if (l3 === undefined) - return sc_filterMap2(proc, l1, l2); - // else - var nbApplyArgs = arguments.length - 1; - var applyArgs = new Array(nbApplyArgs); - var revres = null; - while (l1 !== null) { - for (var i = 0; i < nbApplyArgs; i++) { - applyArgs[i] = arguments[i + 1].car; - arguments[i + 1] = arguments[i + 1].cdr; - } - var tmp = proc.apply(null, applyArgs); - if(tmp !== false) revres = sc_cons(tmp, revres); - } - return sc_reverseAppendBang(revres, null); -} - -/*** META ((export #t)) */ -function sc_any(proc, l) { - var revres = null; - while (l !== null) { - var tmp = proc(l.car); - if(tmp !== false) return tmp; - l = l.cdr; - } - return false; -} - -/*** META ((export any?) - (peephole (hole 2 "sc_any(" proc "," l ") !== false"))) -*/ -function sc_anyPred(proc, l) { - return sc_any(proc, l)!== false; -} - -/*** META ((export #t)) */ -function sc_every(proc, l) { - var revres = null; - var tmp = true; - while (l !== null) { - tmp = proc(l.car); - if (tmp === false) return false; - l = l.cdr; - } - return tmp; -} - -/*** META ((export every?) - (peephole (hole 2 "sc_every(" proc "," l ") !== false"))) -*/ -function sc_everyPred(proc, l) { - var tmp = sc_every(proc, l); - if (tmp !== false) return true; - return false; -} - -/*** META ((export #t) - (peephole (postfix "()"))) -*/ -function sc_force(o) { - return o(); -} - -/*** META ((export #t)) */ -function sc_makePromise(proc) { - var isResultReady = false; - var result = undefined; - return function() { - if (!isResultReady) { - var tmp = proc(); - if (!isResultReady) { - isResultReady = true; - result = tmp; - } - } - return result; - }; -} - -function sc_Values(values) { - this.values = values; -} - -/*** META ((export #t) - (peephole (values))) -*/ -function sc_values() { - if (arguments.length === 1) - return arguments[0]; - else - return new sc_Values(arguments); -} - -/*** META ((export #t)) */ -function sc_callWithValues(producer, consumer) { - var produced = producer(); - if (produced instanceof sc_Values) - return consumer.apply(null, produced.values); - else - return consumer(produced); -} - -/*** META ((export #t)) */ -function sc_dynamicWind(before, thunk, after) { - before(); - try { - var res = thunk(); - return res; - } finally { - after(); - } -} - - -// TODO: eval/scheme-report-environment/null-environment/interaction-environment - -// LIMITATION: 'load' doesn't exist without files. -// LIMITATION: transcript-on/transcript-off doesn't exist without files. - - -function sc_Struct(name) { - this.name = name; -} -sc_Struct.prototype.sc_toDisplayString = function() { - return "#<struct" + sc_hash(this) + ">"; -}; -sc_Struct.prototype.sc_toWriteString = sc_Struct.prototype.sc_toDisplayString; - -/*** META ((export #t) - (peephole (hole 1 "new sc_Struct(" name ")"))) -*/ -function sc_makeStruct(name) { - return new sc_Struct(name); -} - -/*** META ((export #t) - (type bool) - (peephole (postfix " instanceof sc_Struct"))) -*/ -function sc_isStruct(o) { - return (o instanceof sc_Struct); -} - -/*** META ((export #t) - (type bool) - (peephole (hole 2 "(" 1 " instanceof sc_Struct) && ( " 1 ".name === " 0 ")"))) -*/ -function sc_isStructNamed(name, s) { - return ((s instanceof sc_Struct) && (s.name === name)); -} - -/*** META ((export struct-field) - (peephole (hole 3 0 "[" 2 "]"))) -*/ -function sc_getStructField(s, name, field) { - return s[field]; -} - -/*** META ((export struct-field-set!) - (peephole (hole 4 0 "[" 2 "] = " 3))) -*/ -function sc_setStructFieldBang(s, name, field, val) { - s[field] = val; -} - -/*** META ((export #t) - (peephole (prefix "~"))) -*/ -function sc_bitNot(x) { - return ~x; -} - -/*** META ((export #t) - (peephole (infix 2 2 "&"))) -*/ -function sc_bitAnd(x, y) { - return x & y; -} - -/*** META ((export #t) - (peephole (infix 2 2 "|"))) -*/ -function sc_bitOr(x, y) { - return x | y; -} - -/*** META ((export #t) - (peephole (infix 2 2 "^"))) -*/ -function sc_bitXor(x, y) { - return x ^ y; -} - -/*** META ((export #t) - (peephole (infix 2 2 "<<"))) -*/ -function sc_bitLsh(x, y) { - return x << y; -} - -/*** META ((export #t) - (peephole (infix 2 2 ">>"))) -*/ -function sc_bitRsh(x, y) { - return x >> y; -} - -/*** META ((export #t) - (peephole (infix 2 2 ">>>"))) -*/ -function sc_bitUrsh(x, y) { - return x >>> y; -} - -/*** META ((export js-field js-property) - (peephole (hole 2 o "[" field "]"))) -*/ -function sc_jsField(o, field) { - return o[field]; -} - -/*** META ((export js-field-set! js-property-set!) - (peephole (hole 3 o "[" field "] = " val))) -*/ -function sc_setJsFieldBang(o, field, val) { - return o[field] = val; -} - -/*** META ((export js-field-delete! js-property-delete!) - (peephole (hole 2 "delete" o "[" field "]"))) -*/ -function sc_deleteJsFieldBang(o, field) { - delete o[field]; -} - -/*** META ((export #t) - (peephole (jsCall))) -*/ -function sc_jsCall(o, fun) { - var args = new Array(); - for (var i = 2; i < arguments.length; i++) - args[i-2] = arguments[i]; - return fun.apply(o, args); -} - -/*** META ((export #t) - (peephole (jsMethodCall))) -*/ -function sc_jsMethodCall(o, field) { - var args = new Array(); - for (var i = 2; i < arguments.length; i++) - args[i-2] = arguments[i]; - return o[field].apply(o, args); -} - -/*** META ((export new js-new) - (peephole (jsNew))) -*/ -function sc_jsNew(c) { - var evalStr = "new c("; - evalStr +=arguments.length > 1? "arguments[1]": ""; - for (var i = 2; i < arguments.length; i++) - evalStr += ", arguments[" + i + "]"; - evalStr +=")"; - return eval(evalStr); -} - -// ======================== RegExp ==================== -/*** META ((export #t)) */ -function sc_pregexp(re) { - return new RegExp(sc_string2jsstring(re)); -} - -/*** META ((export #t)) */ -function sc_pregexpMatch(re, s) { - var reg = (re instanceof RegExp) ? re : sc_pregexp(re); - var tmp = reg.exec(sc_string2jsstring(s)); - - if (tmp == null) return false; - - var res = null; - for (var i = tmp.length-1; i >= 0; i--) { - if (tmp[i] !== null) { - res = sc_cons(sc_jsstring2string(tmp[i]), res); - } else { - res = sc_cons(false, res); - } - } - return res; -} - -/*** META ((export #t)) */ -function sc_pregexpReplace(re, s1, s2) { - var reg; - var jss1 = sc_string2jsstring(s1); - var jss2 = sc_string2jsstring(s2); - - if (re instanceof RegExp) { - if (re.global) - reg = re; - else - reg = new RegExp(re.source); - } else { - reg = new RegExp(sc_string2jsstring(re)); - } - - return jss1.replace(reg, jss2); -} - -/*** META ((export pregexp-replace*)) */ -function sc_pregexpReplaceAll(re, s1, s2) { - var reg; - var jss1 = sc_string2jsstring(s1); - var jss2 = sc_string2jsstring(s2); - - if (re instanceof RegExp) { - if (re.global) - reg = re; - else - reg = new RegExp(re.source, "g"); - } else { - reg = new RegExp(sc_string2jsstring(re), "g"); - } - - return jss1.replace(reg, jss2); -} - -/*** META ((export #t)) */ -function sc_pregexpSplit(re, s) { - var reg = ((re instanceof RegExp) ? - re : - new RegExp(sc_string2jsstring(re))); - var jss = sc_string2jsstring(s); - var tmp = jss.split(reg); - - if (tmp == null) return false; - - return sc_vector2list(tmp); -} - - -/* =========================================================================== */ -/* Other library stuff */ -/* =========================================================================== */ - -/*** META ((export #t) - (peephole (hole 1 "Math.floor(Math.random()*" 'n ")"))) -*/ -function sc_random(n) { - return Math.floor(Math.random()*n); -} - -/*** META ((export current-date) - (peephole (hole 0 "new Date()"))) -*/ -function sc_currentDate() { - return new Date(); -} - -function sc_Hashtable() { -} -sc_Hashtable.prototype.toString = function() { - return "#{%hashtable}"; -}; -// sc_toWriteString == sc_toDisplayString == toString - -function sc_HashtableElement(key, val) { - this.key = key; - this.val = val; -} - -/*** META ((export #t) - (peephole (hole 0 "new sc_Hashtable()"))) -*/ -function sc_makeHashtable() { - return new sc_Hashtable(); -} - -/*** META ((export #t)) */ -function sc_hashtablePutBang(ht, key, val) { - var hash = sc_hash(key); - ht[hash] = new sc_HashtableElement(key, val); -} - -/*** META ((export #t)) */ -function sc_hashtableGet(ht, key) { - var hash = sc_hash(key); - if (hash in ht) - return ht[hash].val; - else - return false; -} - -/*** META ((export #t)) */ -function sc_hashtableForEach(ht, f) { - for (var v in ht) { - if (ht[v] instanceof sc_HashtableElement) - f(ht[v].key, ht[v].val); - } -} - -/*** META ((export hashtable-contains?) - (peephole (hole 2 "sc_hash(" 1 ") in " 0))) -*/ -function sc_hashtableContains(ht, key) { - var hash = sc_hash(key); - if (hash in ht) - return true; - else - return false; -} - -var SC_HASH_COUNTER = 0; - -function sc_hash(o) { - if (o === null) - return "null"; - else if (o === undefined) - return "undefined"; - else if (o === true) - return "true"; - else if (o === false) - return "false"; - else if (typeof o === "number") - return "num-" + o; - else if (typeof o === "string") - return "jsstr-" + o; - else if (o.sc_getHash) - return o.sc_getHash(); - else - return sc_counterHash.call(o); -} -function sc_counterHash() { - if (!this.sc_hash) { - this.sc_hash = "hash-" + SC_HASH_COUNTER; - SC_HASH_COUNTER++; - } - return this.sc_hash; -} - -function sc_Trampoline(args, maxTailCalls) { - this['__trampoline return__'] = true; - this.args = args; - this.MAX_TAIL_CALLs = maxTailCalls; -} -// TODO: call/cc stuff -sc_Trampoline.prototype.restart = function() { - var o = this; - while (true) { - // set both globals. - SC_TAIL_OBJECT.calls = o.MAX_TAIL_CALLs-1; - var fun = o.args.callee; - var res = fun.apply(SC_TAIL_OBJECT, o.args); - if (res instanceof sc_Trampoline) - o = res; - else - return res; - } -} - -/*** META ((export bind-exit-lambda)) */ -function sc_bindExitLambda(proc) { - var escape_obj = new sc_BindExitException(); - var escape = function(res) { - escape_obj.res = res; - throw escape_obj; - }; - try { - return proc(escape); - } catch(e) { - if (e === escape_obj) { - return e.res; - } - throw e; - } -} -function sc_BindExitException() { - this._internalException = true; -} - -var SC_SCM2JS_GLOBALS = new Object(); - -// default tail-call depth. -// normally the program should set it again. but just in case... -var SC_TAIL_OBJECT = new Object(); -SC_SCM2JS_GLOBALS.TAIL_OBJECT = SC_TAIL_OBJECT; -// ======================== I/O ======================= - -/*------------------------------------------------------------------*/ - -function sc_EOF() { -} -var SC_EOF_OBJECT = new sc_EOF(); - -function sc_Port() { -} - -/* --------------- Input ports -------------------------------------*/ - -function sc_InputPort() { -} -sc_InputPort.prototype = new sc_Port(); - -sc_InputPort.prototype.peekChar = function() { - if (!("peeked" in this)) - this.peeked = this.getNextChar(); - return this.peeked; -} -sc_InputPort.prototype.readChar = function() { - var tmp = this.peekChar(); - delete this.peeked; - return tmp; -} -sc_InputPort.prototype.isCharReady = function() { - return true; -} -sc_InputPort.prototype.close = function() { - // do nothing -} - -/* .............. String port ..........................*/ -function sc_ErrorInputPort() { -}; -sc_ErrorInputPort.prototype = new sc_InputPort(); -sc_ErrorInputPort.prototype.getNextChar = function() { - throw "can't read from error-port."; -}; -sc_ErrorInputPort.prototype.isCharReady = function() { - return false; -}; - - -/* .............. String port ..........................*/ - -function sc_StringInputPort(jsStr) { - // we are going to do some charAts on the str. - // instead of recreating all the time a String-object, we - // create one in the beginning. (not sure, if this is really an optim) - this.str = new String(jsStr); - this.pos = 0; -} -sc_StringInputPort.prototype = new sc_InputPort(); -sc_StringInputPort.prototype.getNextChar = function() { - if (this.pos >= this.str.length) - return SC_EOF_OBJECT; - return this.str.charAt(this.pos++); -}; - -/* ------------- Read and other lib-funs -------------------------------*/ -function sc_Token(type, val, pos) { - this.type = type; - this.val = val; - this.pos = pos; -} -sc_Token.EOF = 0/*EOF*/; -sc_Token.OPEN_PAR = 1/*OPEN_PAR*/; -sc_Token.CLOSE_PAR = 2/*CLOSE_PAR*/; -sc_Token.OPEN_BRACE = 3/*OPEN_BRACE*/; -sc_Token.CLOSE_BRACE = 4/*CLOSE_BRACE*/; -sc_Token.OPEN_BRACKET = 5/*OPEN_BRACKET*/; -sc_Token.CLOSE_BRACKET = 6/*CLOSE_BRACKET*/; -sc_Token.WHITESPACE = 7/*WHITESPACE*/; -sc_Token.QUOTE = 8/*QUOTE*/; -sc_Token.ID = 9/*ID*/; -sc_Token.DOT = 10/*DOT*/; -sc_Token.STRING = 11/*STRING*/; -sc_Token.NUMBER = 12/*NUMBER*/; -sc_Token.ERROR = 13/*ERROR*/; -sc_Token.VECTOR_BEGIN = 14/*VECTOR_BEGIN*/; -sc_Token.TRUE = 15/*TRUE*/; -sc_Token.FALSE = 16/*FALSE*/; -sc_Token.UNSPECIFIED = 17/*UNSPECIFIED*/; -sc_Token.REFERENCE = 18/*REFERENCE*/; -sc_Token.STORE = 19/*STORE*/; -sc_Token.CHAR = 20/*CHAR*/; - -var SC_ID_CLASS = SC_LOWER_CLASS + SC_UPPER_CLASS + "!$%*+-./:<=>?@^_~"; -function sc_Tokenizer(port) { - this.port = port; -} -sc_Tokenizer.prototype.peekToken = function() { - if (this.peeked) - return this.peeked; - var newToken = this.nextToken(); - this.peeked = newToken; - return newToken; -}; -sc_Tokenizer.prototype.readToken = function() { - var tmp = this.peekToken(); - delete this.peeked; - return tmp; -}; -sc_Tokenizer.prototype.nextToken = function() { - var port = this.port; - - function isNumberChar(c) { - return (c >= "0" && c <= "9"); - }; - function isIdOrNumberChar(c) { - return SC_ID_CLASS.indexOf(c) != -1 || // ID-char - (c >= "0" && c <= "9"); - } - function isWhitespace(c) { - return c === " " || c === "\r" || c === "\n" || c === "\t" || c === "\f"; - }; - function isWhitespaceOrEOF(c) { - return isWhitespace(c) || c === SC_EOF_OBJECT; - }; - - function readString() { - res = ""; - while (true) { - var c = port.readChar(); - switch (c) { - case '"': - return new sc_Token(11/*STRING*/, res); - case "\\": - var tmp = port.readChar(); - switch (tmp) { - case '0': res += "\0"; break; - case 'a': res += "\a"; break; - case 'b': res += "\b"; break; - case 'f': res += "\f"; break; - case 'n': res += "\n"; break; - case 'r': res += "\r"; break; - case 't': res += "\t"; break; - case 'v': res += "\v"; break; - case '"': res += '"'; break; - case '\\': res += '\\'; break; - case 'x': - /* hexa-number */ - var nb = 0; - while (true) { - var hexC = port.peekChar(); - if (hexC >= '0' && hexC <= '9') { - port.readChar(); - nb = nb * 16 + hexC.charCodeAt(0) - '0'.charCodeAt(0); - } else if (hexC >= 'a' && hexC <= 'f') { - port.readChar(); - nb = nb * 16 + hexC.charCodeAt(0) - 'a'.charCodeAt(0); - } else if (hexC >= 'A' && hexC <= 'F') { - port.readChar(); - nb = nb * 16 + hexC.charCodeAt(0) - 'A'.charCodeAt(0); - } else { - // next char isn't part of hex. - res += String.fromCharCode(nb); - break; - } - } - break; - default: - if (tmp === SC_EOF_OBJECT) { - return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res); - } - res += tmp; - } - break; - default: - if (c === SC_EOF_OBJECT) { - return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res); - } - res += c; - } - } - }; - function readIdOrNumber(firstChar) { - var res = firstChar; - while (isIdOrNumberChar(port.peekChar())) - res += port.readChar(); - if (isNaN(res)) - return new sc_Token(9/*ID*/, res); - else - return new sc_Token(12/*NUMBER*/, res - 0); - }; - - function skipWhitespaceAndComments() { - var done = false; - while (!done) { - done = true; - while (isWhitespace(port.peekChar())) - port.readChar(); - if (port.peekChar() === ';') { - port.readChar(); - done = false; - while (true) { - curChar = port.readChar(); - if (curChar === SC_EOF_OBJECT || - curChar === '\n') - break; - } - } - } - }; - - function readDot() { - if (isWhitespace(port.peekChar())) - return new sc_Token(10/*DOT*/); - else - return readIdOrNumber("."); - }; - - function readSharp() { - var c = port.readChar(); - if (isWhitespace(c)) - return new sc_Token(13/*ERROR*/, "bad #-pattern0."); - - // reference - if (isNumberChar(c)) { - var nb = c - 0; - while (isNumberChar(port.peekChar())) - nb = nb*10 + (port.readChar() - 0); - switch (port.readChar()) { - case '#': - return new sc_Token(18/*REFERENCE*/, nb); - case '=': - return new sc_Token(19/*STORE*/, nb); - default: - return new sc_Token(13/*ERROR*/, "bad #-pattern1." + nb); - } - } - - if (c === "(") - return new sc_Token(14/*VECTOR_BEGIN*/); - - if (c === "\\") { // character - var tmp = "" - while (!isWhitespaceOrEOF(port.peekChar())) - tmp += port.readChar(); - switch (tmp.length) { - case 0: // it's escaping a whitespace char: - if (sc_isEOFObject(port.peekChar)) - return new sc_Token(13/*ERROR*/, "bad #-pattern2."); - else - return new sc_Token(20/*CHAR*/, port.readChar()); - case 1: - return new sc_Token(20/*CHAR*/, tmp); - default: - return new sc_Token(13/*ERROR*/, "unknown character description: #\\" + tmp); - } - } - - // some constants (#t, #f, #unspecified) - var res; - var needing; - switch (c) { - case 't': res = new sc_Token(15/*TRUE*/, true); needing = ""; break; - case 'f': res = new sc_Token(16/*FALSE*/, false); needing = ""; break; - case 'u': res = new sc_Token(17/*UNSPECIFIED*/, undefined); needing = "nspecified"; break; - default: - return new sc_Token(13/*ERROR*/, "bad #-pattern3: " + c); - } - while(true) { - c = port.peekChar(); - if ((isWhitespaceOrEOF(c) || c === ')') && - needing == "") - return res; - else if (isWhitespace(c) || needing == "") - return new sc_Token(13/*ERROR*/, "bad #-pattern4 " + c + " " + needing); - else if (needing.charAt(0) == c) { - port.readChar(); // consume - needing = needing.slice(1); - } else - return new sc_Token(13/*ERROR*/, "bad #-pattern5"); - } - - }; - - skipWhitespaceAndComments(); - var curChar = port.readChar(); - if (curChar === SC_EOF_OBJECT) - return new sc_Token(0/*EOF*/, curChar); - switch (curChar) - { - case " ": - case "\n": - case "\t": - return readWhitespace(); - case "(": - return new sc_Token(1/*OPEN_PAR*/); - case ")": - return new sc_Token(2/*CLOSE_PAR*/); - case "{": - return new sc_Token(3/*OPEN_BRACE*/); - case "}": - return new sc_Token(4/*CLOSE_BRACE*/); - case "[": - return new sc_Token(5/*OPEN_BRACKET*/); - case "]": - return new sc_Token(6/*CLOSE_BRACKET*/); - case "'": - return new sc_Token(8/*QUOTE*/); - case "#": - return readSharp(); - case ".": - return readDot(); - case '"': - return readString(); - default: - if (isIdOrNumberChar(curChar)) - return readIdOrNumber(curChar); - throw "unexpected character: " + curChar; - } -}; - -function sc_Reader(tokenizer) { - this.tokenizer = tokenizer; - this.backref = new Array(); -} -sc_Reader.prototype.read = function() { - function readList(listBeginType) { - function matchesPeer(open, close) { - return open === 1/*OPEN_PAR*/ && close === 2/*CLOSE_PAR*/ - || open === 3/*OPEN_BRACE*/ && close === 4/*CLOSE_BRACE*/ - || open === 5/*OPEN_BRACKET*/ && close === 6/*CLOSE_BRACKET*/; - }; - var res = null; - - while (true) { - var token = tokenizer.peekToken(); - - switch (token.type) { - case 2/*CLOSE_PAR*/: - case 4/*CLOSE_BRACE*/: - case 6/*CLOSE_BRACKET*/: - if (matchesPeer(listBeginType, token.type)) { - tokenizer.readToken(); // consume token - return sc_reverseBang(res); - } else - throw "closing par doesn't match: " + listBeginType - + " " + listEndType; - - case 0/*EOF*/: - throw "unexpected end of file"; - - case 10/*DOT*/: - tokenizer.readToken(); // consume token - var cdr = this.read(); - var par = tokenizer.readToken(); - if (!matchesPeer(listBeginType, par.type)) - throw "closing par doesn't match: " + listBeginType - + " " + par.type; - else - return sc_reverseAppendBang(res, cdr); - - - default: - res = sc_cons(this.read(), res); - } - } - }; - function readQuote() { - return sc_cons("quote", sc_cons(this.read(), null)); - }; - function readVector() { - // opening-parenthesis is already consumed - var a = new Array(); - while (true) { - var token = tokenizer.peekToken(); - switch (token.type) { - case 2/*CLOSE_PAR*/: - tokenizer.readToken(); - return a; - - default: - a.push(this.read()); - } - } - }; - - function storeRefence(nb) { - var tmp = this.read(); - this.backref[nb] = tmp; - return tmp; - }; - - function readReference(nb) { - if (nb in this.backref) - return this.backref[nb]; - else - throw "bad reference: " + nb; - }; - - var tokenizer = this.tokenizer; - - var token = tokenizer.readToken(); - - // handle error - if (token.type === 13/*ERROR*/) - throw token.val; - - switch (token.type) { - case 1/*OPEN_PAR*/: - case 3/*OPEN_BRACE*/: - case 5/*OPEN_BRACKET*/: - return readList.call(this, token.type); - case 8/*QUOTE*/: - return readQuote.call(this); - case 11/*STRING*/: - return sc_jsstring2string(token.val); - case 20/*CHAR*/: - return new sc_Char(token.val); - case 14/*VECTOR_BEGIN*/: - return readVector.call(this); - case 18/*REFERENCE*/: - return readReference.call(this, token.val); - case 19/*STORE*/: - return storeRefence.call(this, token.val); - case 9/*ID*/: - return sc_jsstring2symbol(token.val); - case 0/*EOF*/: - case 12/*NUMBER*/: - case 15/*TRUE*/: - case 16/*FALSE*/: - case 17/*UNSPECIFIED*/: - return token.val; - default: - throw "unexpected token " + token.type + " " + token.val; - } -}; - -/*** META ((export #t)) */ -function sc_read(port) { - if (port === undefined) // we assume the port hasn't been given. - port = SC_DEFAULT_IN; // THREAD: shared var... - var reader = new sc_Reader(new sc_Tokenizer(port)); - return reader.read(); -} -/*** META ((export #t)) */ -function sc_readChar(port) { - if (port === undefined) // we assume the port hasn't been given. - port = SC_DEFAULT_IN; // THREAD: shared var... - var t = port.readChar(); - return t === SC_EOF_OBJECT? t: new sc_Char(t); -} -/*** META ((export #t)) */ -function sc_peekChar(port) { - if (port === undefined) // we assume the port hasn't been given. - port = SC_DEFAULT_IN; // THREAD: shared var... - var t = port.peekChar(); - return t === SC_EOF_OBJECT? t: new sc_Char(t); -} -/*** META ((export #t) - (type bool)) -*/ -function sc_isCharReady(port) { - if (port === undefined) // we assume the port hasn't been given. - port = SC_DEFAULT_IN; // THREAD: shared var... - return port.isCharReady(); -} -/*** META ((export #t) - (peephole (postfix ".close()"))) -*/ -function sc_closeInputPort(p) { - return p.close(); -} - -/*** META ((export #t) - (type bool) - (peephole (postfix " instanceof sc_InputPort"))) -*/ -function sc_isInputPort(o) { - return (o instanceof sc_InputPort); -} - -/*** META ((export eof-object?) - (type bool) - (peephole (postfix " === SC_EOF_OBJECT"))) -*/ -function sc_isEOFObject(o) { - return o === SC_EOF_OBJECT; -} - -/*** META ((export #t) - (peephole (hole 0 "SC_DEFAULT_IN"))) -*/ -function sc_currentInputPort() { - return SC_DEFAULT_IN; -} - -/* ------------ file operations are not supported -----------*/ -/*** META ((export #t)) */ -function sc_callWithInputFile(s, proc) { - throw "can't open " + s; -} - -/*** META ((export #t)) */ -function sc_callWithOutputFile(s, proc) { - throw "can't open " + s; -} - -/*** META ((export #t)) */ -function sc_withInputFromFile(s, thunk) { - throw "can't open " + s; -} - -/*** META ((export #t)) */ -function sc_withOutputToFile(s, thunk) { - throw "can't open " + s; -} - -/*** META ((export #t)) */ -function sc_openInputFile(s) { - throw "can't open " + s; -} - -/*** META ((export #t)) */ -function sc_openOutputFile(s) { - throw "can't open " + s; -} - -/* ----------------------------------------------------------------------------*/ -/*** META ((export #t)) */ -function sc_basename(p) { - var i = p.lastIndexOf('/'); - - if(i >= 0) - return p.substring(i + 1, p.length); - else - return ''; -} - -/*** META ((export #t)) */ -function sc_dirname(p) { - var i = p.lastIndexOf('/'); - - if(i >= 0) - return p.substring(0, i); - else - return ''; -} - -/* ----------------------------------------------------------------------------*/ - -/*** META ((export #t)) */ -function sc_withInputFromPort(p, thunk) { - try { - var tmp = SC_DEFAULT_IN; // THREAD: shared var. - SC_DEFAULT_IN = p; - return thunk(); - } finally { - SC_DEFAULT_IN = tmp; - } -} - -/*** META ((export #t)) */ -function sc_withInputFromString(s, thunk) { - return sc_withInputFromPort(new sc_StringInputPort(sc_string2jsstring(s)), thunk); -} - -/*** META ((export #t)) */ -function sc_withOutputToPort(p, thunk) { - try { - var tmp = SC_DEFAULT_OUT; // THREAD: shared var. - SC_DEFAULT_OUT = p; - return thunk(); - } finally { - SC_DEFAULT_OUT = tmp; - } -} - -/*** META ((export #t)) */ -function sc_withOutputToString(thunk) { - var p = new sc_StringOutputPort(); - sc_withOutputToPort(p, thunk); - return p.close(); -} - -/*** META ((export #t)) */ -function sc_withOutputToProcedure(proc, thunk) { - var t = function(s) { proc(sc_jsstring2string(s)); }; - return sc_withOutputToPort(new sc_GenericOutputPort(t), thunk); -} - -/*** META ((export #t) - (peephole (hole 0 "new sc_StringOutputPort()"))) -*/ -function sc_openOutputString() { - return new sc_StringOutputPort(); -} - -/*** META ((export #t)) */ -function sc_openInputString(str) { - return new sc_StringInputPort(sc_string2jsstring(str)); -} - -/* ----------------------------------------------------------------------------*/ - -function sc_OutputPort() { -} -sc_OutputPort.prototype = new sc_Port(); -sc_OutputPort.prototype.appendJSString = function(obj) { - /* do nothing */ -} -sc_OutputPort.prototype.close = function() { - /* do nothing */ -} - -function sc_StringOutputPort() { - this.res = ""; -} -sc_StringOutputPort.prototype = new sc_OutputPort(); -sc_StringOutputPort.prototype.appendJSString = function(s) { - this.res += s; -} -sc_StringOutputPort.prototype.close = function() { - return sc_jsstring2string(this.res); -} - -/*** META ((export #t)) */ -function sc_getOutputString(sp) { - return sc_jsstring2string(sp.res); -} - - -function sc_ErrorOutputPort() { -} -sc_ErrorOutputPort.prototype = new sc_OutputPort(); -sc_ErrorOutputPort.prototype.appendJSString = function(s) { - throw "don't write on ErrorPort!"; -} -sc_ErrorOutputPort.prototype.close = function() { - /* do nothing */ -} - -function sc_GenericOutputPort(appendJSString, close) { - this.appendJSString = appendJSString; - if (close) - this.close = close; -} -sc_GenericOutputPort.prototype = new sc_OutputPort(); - -/*** META ((export #t) - (type bool) - (peephole (postfix " instanceof sc_OutputPort"))) -*/ -function sc_isOutputPort(o) { - return (o instanceof sc_OutputPort); -} - -/*** META ((export #t) - (peephole (postfix ".close()"))) -*/ -function sc_closeOutputPort(p) { - return p.close(); -} - -/* ------------------ write ---------------------------------------------------*/ - -/*** META ((export #t)) */ -function sc_write(o, p) { - if (p === undefined) // we assume not given - p = SC_DEFAULT_OUT; - p.appendJSString(sc_toWriteString(o)); -} - -function sc_toWriteString(o) { - if (o === null) - return "()"; - else if (o === true) - return "#t"; - else if (o === false) - return "#f"; - else if (o === undefined) - return "#unspecified"; - else if (typeof o === 'function') - return "#<procedure " + sc_hash(o) + ">"; - else if (o.sc_toWriteString) - return o.sc_toWriteString(); - else - return o.toString(); -} - -function sc_escapeWriteString(s) { - var res = ""; - var j = 0; - for (i = 0; i < s.length; i++) { - switch (s.charAt(i)) { - case "\0": res += s.substring(j, i) + "\\0"; j = i + 1; break; - case "\b": res += s.substring(j, i) + "\\b"; j = i + 1; break; - case "\f": res += s.substring(j, i) + "\\f"; j = i + 1; break; - case "\n": res += s.substring(j, i) + "\\n"; j = i + 1; break; - case "\r": res += s.substring(j, i) + "\\r"; j = i + 1; break; - case "\t": res += s.substring(j, i) + "\\t"; j = i + 1; break; - case "\v": res += s.substring(j, i) + "\\v"; j = i + 1; break; - case '"': res += s.substring(j, i) + '\\"'; j = i + 1; break; - case "\\": res += s.substring(j, i) + "\\\\"; j = i + 1; break; - default: - var c = s.charAt(i); - if ("\a" !== "a" && c == "\a") { - res += s.substring(j, i) + "\\a"; j = i + 1; continue; - } - if ("\v" !== "v" && c == "\v") { - res += s.substring(j, i) + "\\v"; j = i + 1; continue; - } - //if (s.charAt(i) < ' ' || s.charCodeAt(i) > 127) { - // CARE: Manuel is this OK with HOP? - if (s.charAt(i) < ' ') { - /* non printable character and special chars */ - res += s.substring(j, i) + "\\x" + s.charCodeAt(i).toString(16); - j = i + 1; - } - // else just let i increase... - } - } - res += s.substring(j, i); - return res; -} - -/* ------------------ display ---------------------------------------------------*/ - -/*** META ((export #t)) */ -function sc_display(o, p) { - if (p === undefined) // we assume not given - p = SC_DEFAULT_OUT; - p.appendJSString(sc_toDisplayString(o)); -} - -function sc_toDisplayString(o) { - if (o === null) - return "()"; - else if (o === true) - return "#t"; - else if (o === false) - return "#f"; - else if (o === undefined) - return "#unspecified"; - else if (typeof o === 'function') - return "#<procedure " + sc_hash(o) + ">"; - else if (o.sc_toDisplayString) - return o.sc_toDisplayString(); - else - return o.toString(); -} - -/* ------------------ newline ---------------------------------------------------*/ - -/*** META ((export #t)) */ -function sc_newline(p) { - if (p === undefined) // we assume not given - p = SC_DEFAULT_OUT; - p.appendJSString("\n"); -} - -/* ------------------ write-char ---------------------------------------------------*/ - -/*** META ((export #t)) */ -function sc_writeChar(c, p) { - if (p === undefined) // we assume not given - p = SC_DEFAULT_OUT; - p.appendJSString(c.val); -} - -/* ------------------ write-circle ---------------------------------------------------*/ - -/*** META ((export #t)) */ -function sc_writeCircle(o, p) { - if (p === undefined) // we assume not given - p = SC_DEFAULT_OUT; - p.appendJSString(sc_toWriteCircleString(o)); -} - -function sc_toWriteCircleString(o) { - var symb = sc_gensym("writeCircle"); - var nbPointer = new Object(); - nbPointer.nb = 0; - sc_prepWriteCircle(o, symb, nbPointer); - return sc_genToWriteCircleString(o, symb); -} - -function sc_prepWriteCircle(o, symb, nbPointer) { - // TODO sc_Struct - if (o instanceof sc_Pair || - o instanceof sc_Vector) { - if (o[symb] !== undefined) { - // not the first visit. - o[symb]++; - // unless there is already a number, assign one. - if (!o[symb + "nb"]) o[symb + "nb"] = nbPointer.nb++; - return; - } - o[symb] = 0; - if (o instanceof sc_Pair) { - sc_prepWriteCircle(o.car, symb, nbPointer); - sc_prepWriteCircle(o.cdr, symb, nbPointer); - } else { - for (var i = 0; i < o.length; i++) - sc_prepWriteCircle(o[i], symb, nbPointer); - } - } -} - -function sc_genToWriteCircleString(o, symb) { - if (!(o instanceof sc_Pair || - o instanceof sc_Vector)) - return sc_toWriteString(o); - return o.sc_toWriteCircleString(symb); -} -sc_Pair.prototype.sc_toWriteCircleString = function(symb, inList) { - if (this[symb + "use"]) { // use-flag is set. Just use it. - var nb = this[symb + "nb"]; - if (this[symb]-- === 0) { // if we are the last use. remove all fields. - delete this[symb]; - delete this[symb + "nb"]; - delete this[symb + "use"]; - } - if (inList) - return '. #' + nb + '#'; - else - return '#' + nb + '#'; - } - if (this[symb]-- === 0) { // if we are the last use. remove all fields. - delete this[symb]; - delete this[symb + "nb"]; - delete this[symb + "use"]; - } - - var res = ""; - - if (this[symb] !== undefined) { // implies > 0 - this[symb + "use"] = true; - if (inList) - res += '. #' + this[symb + "nb"] + '='; - else - res += '#' + this[symb + "nb"] + '='; - inList = false; - } - - if (!inList) - res += "("; - - // print car - res += sc_genToWriteCircleString(this.car, symb); - - if (sc_isPair(this.cdr)) { - res += " " + this.cdr.sc_toWriteCircleString(symb, true); - } else if (this.cdr !== null) { - res += " . " + sc_genToWriteCircleString(this.cdr, symb); - } - if (!inList) - res += ")"; - return res; -}; -sc_Vector.prototype.sc_toWriteCircleString = function(symb) { - if (this[symb + "use"]) { // use-flag is set. Just use it. - var nb = this[symb + "nb"]; - if (this[symb]-- === 0) { // if we are the last use. remove all fields. - delete this[symb]; - delete this[symb + "nb"]; - delete this[symb + "use"]; - } - return '#' + nb + '#'; - } - if (this[symb]-- === 0) { // if we are the last use. remove all fields. - delete this[symb]; - delete this[symb + "nb"]; - delete this[symb + "use"]; - } - - var res = ""; - if (this[symb] !== undefined) { // implies > 0 - this[symb + "use"] = true; - res += '#' + this[symb + "nb"] + '='; - } - res += "#("; - for (var i = 0; i < this.length; i++) { - res += sc_genToWriteCircleString(this[i], symb); - if (i < this.length - 1) res += " "; - } - res += ")"; - return res; -}; - - -/* ------------------ print ---------------------------------------------------*/ - -/*** META ((export #t)) */ -function sc_print(s) { - if (arguments.length === 1) { - sc_display(s); - sc_newline(); - } - else { - for (var i = 0; i < arguments.length; i++) - sc_display(arguments[i]); - sc_newline(); - } -} - -/* ------------------ format ---------------------------------------------------*/ -/*** META ((export #t)) */ -function sc_format(s, args) { - var len = s.length; - var p = new sc_StringOutputPort(); - var i = 0, j = 1; - - while( i < len ) { - var i2 = s.indexOf("~", i); - - if (i2 == -1) { - p.appendJSString( s.substring( i, len ) ); - return p.close(); - } else { - if (i2 > i) { - if (i2 == (len - 1)) { - p.appendJSString(s.substring(i, len)); - return p.close(); - } else { - p.appendJSString(s.substring(i, i2)); - i = i2; - } - } - - switch(s.charCodeAt(i2 + 1)) { - case 65: - case 97: - // a - sc_display(arguments[j], p); - i += 2; j++; - break; - - case 83: - case 115: - // s - sc_write(arguments[j], p); - i += 2; j++; - break; - - case 86: - case 118: - // v - sc_display(arguments[j], p); - p.appendJSString("\n"); - i += 2; j++; - break; - - case 67: - case 99: - // c - p.appendJSString(String.fromCharCode(arguments[j])); - i += 2; j++; - break; - - case 88: - case 120: - // x - p.appendJSString(arguments[j].toString(6)); - i += 2; j++; - break; - - case 79: - case 111: - // o - p.appendJSString(arguments[j].toString(8)); - i += 2; j++; - break; - - case 66: - case 98: - // b - p.appendJSString(arguments[j].toString(2)); - i += 2; j++; - break; - - case 37: - case 110: - // %, n - p.appendJSString("\n"); - i += 2; break; - - case 114: - // r - p.appendJSString("\r"); - i += 2; break; - - case 126: - // ~ - p.appendJSString("~"); - i += 2; break; - - default: - sc_error( "format: illegal ~" - + String.fromCharCode(s.charCodeAt(i2 + 1)) - + " sequence" ); - return ""; - } - } - } - - return p.close(); -} - -/* ------------------ global ports ---------------------------------------------------*/ - -var SC_DEFAULT_IN = new sc_ErrorInputPort(); -var SC_DEFAULT_OUT = new sc_ErrorOutputPort(); -var SC_ERROR_OUT = new sc_ErrorOutputPort(); - -var sc_SYMBOL_PREFIX = "\u1E9C"; -var sc_KEYWORD_PREFIX = "\u1E9D"; - -/*** META ((export #t) - (peephole (id))) */ -function sc_jsstring2string(s) { - return s; -} - -/*** META ((export #t) - (peephole (prefix "'\\u1E9C' +"))) -*/ -function sc_jsstring2symbol(s) { - return sc_SYMBOL_PREFIX + s; -} - -/*** META ((export #t) - (peephole (id))) -*/ -function sc_string2jsstring(s) { - return s; -} - -/*** META ((export #t) - (peephole (symbol2jsstring_immutable))) -*/ -function sc_symbol2jsstring(s) { - return s.slice(1); -} - -/*** META ((export #t) - (peephole (postfix ".slice(1)"))) -*/ -function sc_keyword2jsstring(k) { - return k.slice(1); -} - -/*** META ((export #t) - (peephole (prefix "'\\u1E9D' +"))) -*/ -function sc_jsstring2keyword(s) { - return sc_KEYWORD_PREFIX + s; -} - -/*** META ((export #t) - (type bool)) -*/ -function sc_isKeyword(s) { - return (typeof s === "string") && - (s.charAt(0) === sc_KEYWORD_PREFIX); -} - - -/*** META ((export #t)) */ -var sc_gensym = function() { - var counter = 1000; - return function(sym) { - counter++; - if (!sym) sym = sc_SYMBOL_PREFIX; - return sym + "s" + counter + "~" + "^sC-GeNsYm "; - }; -}(); - - -/*** META ((export #t) - (type bool)) -*/ -function sc_isEqual(o1, o2) { - return ((o1 === o2) || - (sc_isPair(o1) && sc_isPair(o2) - && sc_isPairEqual(o1, o2, sc_isEqual)) || - (sc_isVector(o1) && sc_isVector(o2) - && sc_isVectorEqual(o1, o2, sc_isEqual))); -} - -/*** META ((export number->symbol integer->symbol)) */ -function sc_number2symbol(x, radix) { - return sc_SYMBOL_PREFIX + sc_number2jsstring(x, radix); -} - -/*** META ((export number->string integer->string)) */ -var sc_number2string = sc_number2jsstring; - -/*** META ((export #t)) */ -function sc_symbol2number(s, radix) { - return sc_jsstring2number(s.slice(1), radix); -} - -/*** META ((export #t)) */ -var sc_string2number = sc_jsstring2number; - -/*** META ((export #t) - (peephole (prefix "+" s))) - ;; peephole will only apply if no radix is given. -*/ -function sc_string2integer(s, radix) { - if (!radix) return +s; - return parseInt(s, radix); -} - -/*** META ((export #t) - (peephole (prefix "+"))) -*/ -function sc_string2real(s) { - return +s; -} - - -/*** META ((export #t) - (type bool)) -*/ -function sc_isSymbol(s) { - return (typeof s === "string") && - (s.charAt(0) === sc_SYMBOL_PREFIX); -} - -/*** META ((export #t) - (peephole (symbol2string_immutable))) -*/ -function sc_symbol2string(s) { - return s.slice(1); -} - -/*** META ((export #t) - (peephole (prefix "'\\u1E9C' +"))) -*/ -function sc_string2symbol(s) { - return sc_SYMBOL_PREFIX + s; -} - -/*** META ((export symbol-append) - (peephole (symbolAppend_immutable))) -*/ -function sc_symbolAppend() { - var res = sc_SYMBOL_PREFIX; - for (var i = 0; i < arguments.length; i++) - res += arguments[i].slice(1); - return res; -} - -/*** META ((export #t) - (peephole (postfix ".val"))) -*/ -function sc_char2string(c) { return c.val; } - -/*** META ((export #t) - (peephole (hole 1 "'\\u1E9C' + " c ".val"))) -*/ -function sc_char2symbol(c) { return sc_SYMBOL_PREFIX + c.val; } - -/*** META ((export #t) - (type bool)) -*/ -function sc_isString(s) { - return (typeof s === "string") && - (s.charAt(0) !== sc_SYMBOL_PREFIX); -} - -/*** META ((export #t)) */ -var sc_makeString = sc_makejsString; - - -/*** META ((export #t)) */ -function sc_string() { - for (var i = 0; i < arguments.length; i++) - arguments[i] = arguments[i].val; - return "".concat.apply("", arguments); -} - -/*** META ((export #t) - (peephole (postfix ".length"))) -*/ -function sc_stringLength(s) { return s.length; } - -/*** META ((export #t)) */ -function sc_stringRef(s, k) { - return new sc_Char(s.charAt(k)); -} - -/* there's no stringSet in the immutable version -function sc_stringSet(s, k, c) -*/ - - -/*** META ((export string=?) - (type bool) - (peephole (hole 2 str1 " === " str2))) -*/ -function sc_isStringEqual(s1, s2) { - return s1 === s2; -} -/*** META ((export string<?) - (type bool) - (peephole (hole 2 str1 " < " str2))) -*/ -function sc_isStringLess(s1, s2) { - return s1 < s2; -} -/*** META ((export string>?) - (type bool) - (peephole (hole 2 str1 " > " str2))) -*/ -function sc_isStringGreater(s1, s2) { - return s1 > s2; -} -/*** META ((export string<=?) - (type bool) - (peephole (hole 2 str1 " <= " str2))) -*/ -function sc_isStringLessEqual(s1, s2) { - return s1 <= s2; -} -/*** META ((export string>=?) - (type bool) - (peephole (hole 2 str1 " >= " str2))) -*/ -function sc_isStringGreaterEqual(s1, s2) { - return s1 >= s2; -} -/*** META ((export string-ci=?) - (type bool) - (peephole (hole 2 str1 ".toLowerCase() === " str2 ".toLowerCase()"))) -*/ -function sc_isStringCIEqual(s1, s2) { - return s1.toLowerCase() === s2.toLowerCase(); -} -/*** META ((export string-ci<?) - (type bool) - (peephole (hole 2 str1 ".toLowerCase() < " str2 ".toLowerCase()"))) -*/ -function sc_isStringCILess(s1, s2) { - return s1.toLowerCase() < s2.toLowerCase(); -} -/*** META ((export string-ci>?) - (type bool) - (peephole (hole 2 str1 ".toLowerCase() > " str2 ".toLowerCase()"))) -*/ -function sc_isStringCIGreater(s1, s2) { - return s1.toLowerCase() > s2.toLowerCase(); -} -/*** META ((export string-ci<=?) - (type bool) - (peephole (hole 2 str1 ".toLowerCase() <= " str2 ".toLowerCase()"))) -*/ -function sc_isStringCILessEqual(s1, s2) { - return s1.toLowerCase() <= s2.toLowerCase(); -} -/*** META ((export string-ci>=?) - (type bool) - (peephole (hole 2 str1 ".toLowerCase() >= " str2 ".toLowerCase()"))) -*/ -function sc_isStringCIGreaterEqual(s1, s2) { - return s1.toLowerCase() >= s2.toLowerCase(); -} - -/*** META ((export #t) - (peephole (hole 3 s ".substring(" start ", " end ")"))) -*/ -function sc_substring(s, start, end) { - return s.substring(start, end); -} - -/*** META ((export #t)) -*/ -function sc_isSubstring_at(s1, s2, i) { - return s2 == s1.substring(i, i+ s2.length); -} - -/*** META ((export #t) - (peephole (infix 0 #f "+" "''"))) -*/ -function sc_stringAppend() { - return "".concat.apply("", arguments); -} - -/*** META ((export #t)) */ -var sc_string2list = sc_jsstring2list; - -/*** META ((export #t)) */ -var sc_list2string = sc_list2jsstring; - -/*** META ((export #t) - (peephole (id))) -*/ -function sc_stringCopy(s) { - return s; -} - -/* there's no string-fill in the immutable version -function sc_stringFill(s, c) -*/ - -/*** META ((export #t) - (peephole (postfix ".slice(1)"))) -*/ -function sc_keyword2string(o) { - return o.slice(1); -} - -/*** META ((export #t) - (peephole (prefix "'\\u1E9D' +"))) -*/ -function sc_string2keyword(o) { - return sc_KEYWORD_PREFIX + o; -} - -String.prototype.sc_toDisplayString = function() { - if (this.charAt(0) === sc_SYMBOL_PREFIX) - // TODO: care for symbols with spaces (escape-chars symbols). - return this.slice(1); - else if (this.charAt(0) === sc_KEYWORD_PREFIX) - return ":" + this.slice(1); - else - return this.toString(); -}; - -String.prototype.sc_toWriteString = function() { - if (this.charAt(0) === sc_SYMBOL_PREFIX) - // TODO: care for symbols with spaces (escape-chars symbols). - return this.slice(1); - else if (this.charAt(0) === sc_KEYWORD_PREFIX) - return ":" + this.slice(1); - else - return '"' + sc_escapeWriteString(this) + '"'; -}; -/* Exported Variables */ -var BgL_testzd2boyerzd2; -var BgL_nboyerzd2benchmarkzd2; -var BgL_setupzd2boyerzd2; -/* End Exports */ - -var translate_term_nboyer; -var translate_args_nboyer; -var untranslate_term_nboyer; -var BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer; -var BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer; -var translate_alist_nboyer; -var apply_subst_nboyer; -var apply_subst_lst_nboyer; -var tautologyp_nboyer; -var if_constructor_nboyer; -var rewrite_count_nboyer; -var rewrite_nboyer; -var rewrite_args_nboyer; -var unify_subst_nboyer; -var one_way_unify1_nboyer; -var false_term_nboyer; -var true_term_nboyer; -var trans_of_implies1_nboyer; -var is_term_equal_nboyer; -var is_term_member_nboyer; -var const_nboyer; -var sc_const_3_nboyer; -var sc_const_4_nboyer; -{ - (sc_const_4_nboyer = (new sc_Pair("\u1E9Cimplies",(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cu",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cu",(new sc_Pair("\u1E9Cw",null)))))),null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cw",null)))))),null))))))); - (sc_const_3_nboyer = sc_list((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccompile",(new sc_Pair("\u1E9Cform",null)))),(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair((new sc_Pair("\u1E9Ccodegen",(new sc_Pair((new sc_Pair("\u1E9Coptimize",(new sc_Pair("\u1E9Cform",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ceqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreaterp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clesseqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatereqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cboolean",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ciff",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ceven1",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Codd",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccountps-",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Cpred",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccountps-loop",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Cpred",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfact-",(new sc_Pair("\u1E9Ci",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfact-loop",(new sc_Pair("\u1E9Ci",(new sc_Pair((1),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse-",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Creverse-loop",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdivides",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cassume-true",(new sc_Pair("\u1E9Cvar",(new sc_Pair("\u1E9Calist",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cvar",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))),(new sc_Pair("\u1E9Calist",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cassume-false",(new sc_Pair("\u1E9Cvar",(new sc_Pair("\u1E9Calist",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cvar",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))),(new sc_Pair("\u1E9Calist",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctautology-checker",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ctautologyp",(new sc_Pair((new sc_Pair("\u1E9Cnormalize",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfalsify",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfalsify1",(new sc_Pair((new sc_Pair("\u1E9Cnormalize",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cprime",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))),null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cprime1",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Cx",null)))),null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair("\u1E9Cp",(new sc_Pair("\u1E9Cq",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cq",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair("\u1E9Cp",(new sc_Pair("\u1E9Cq",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cq",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair("\u1E9Cp",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cp",(new sc_Pair("\u1E9Cq",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cq",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))))),(new sc_Pair("\u1E9Cd",(new sc_Pair("\u1E9Ce",null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cd",(new sc_Pair("\u1E9Ce",null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cd",(new sc_Pair("\u1E9Ce",null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Ca",null)))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cb",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cc",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair("\u1E9Ca",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair((new sc_Pair("\u1E9Cplus-fringe",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Ca",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cexec",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cpds",(new sc_Pair("\u1E9Cenvrn",null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cexec",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cexec",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cpds",(new sc_Pair("\u1E9Cenvrn",null)))))))),(new sc_Pair("\u1E9Cenvrn",null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmc-flatten",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Cy",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cb",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cy",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Cintersect",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Ck",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Ck",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Ck",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),(new sc_Pair("\u1E9Ck",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse-loop",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Cy",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse-loop",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccount-list",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Csort-lp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Ccount-list",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccount-list",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cbig-plus1",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair("\u1E9Ci",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cbig-plus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cbase",null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Ci",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cj",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cj",(new sc_Pair((1),null)))))),null)))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cpower-rep",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Ci",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cbig-plus",(new sc_Pair((new sc_Pair("\u1E9Cpower-rep",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cpower-rep",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair("\u1E9Cbase",null)))))))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair("\u1E9Cb",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Ca",null)))),null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cy",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cy",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cw",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cw",(new sc_Pair("\u1E9Cx",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cb",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cy",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cz",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cvalue",(new sc_Pair((new sc_Pair("\u1E9Cnormalize",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cvalue",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnlistp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair((new sc_Pair("\u1E9Cgopher",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csamefringe",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatest-factor",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatest-factor",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((1),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((1),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair((new sc_Pair("\u1E9Cgreatest-factor",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes-list",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Ctimes-list",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ctimes-list",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cprime-list",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cprime-list",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cprime-list",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cw",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cz",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cw",(new sc_Pair((1),null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatereqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((1),null)))))),(new sc_Pair(sc_list("\u1E9Cand", (new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))), (new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cb",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))), (new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Ca",null)))), (new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cb",null)))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Ca",null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cl",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cl",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cl",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csort2",(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cl",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Csort2",(new sc_Pair("\u1E9Cl",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdsort",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Csort2",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx1",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx2",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx3",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx4",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx5",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx6",(new sc_Pair("\u1E9Cx7",null)))))),null)))))),null)))))),null)))))),null)))))),null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((6),(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cx7",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((2),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((2),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair("\u1E9Cy",(new sc_Pair((2),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csigma",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Ci",null)))),null)))))),(new sc_Pair((2),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cy",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cx",null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cz",null)))),null)))))),null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair("\u1E9Ca",null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cy",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Ci",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clast",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Clast",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Ca",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Ccar",(new sc_Pair((new sc_Pair("\u1E9Clast",(new sc_Pair("\u1E9Ca",null)))),null)))),(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair("\u1E9Cb",null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),(new sc_Pair("\u1E9Cz",null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cassignment",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cassignedp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cassignment",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cassignment",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cb",null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccar",(new sc_Pair((new sc_Pair("\u1E9Cgopher",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccar",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair((new sc_Pair("\u1E9Ccdr",(new sc_Pair((new sc_Pair("\u1E9Cgopher",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccdr",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cget",(new sc_Pair("\u1E9Cj",(new sc_Pair((new sc_Pair("\u1E9Cset",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cval",(new sc_Pair("\u1E9Cmem",null)))))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Ceqp",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair("\u1E9Cval",(new sc_Pair((new sc_Pair("\u1E9Cget",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Cmem",null)))))),null)))))))),null)))))))); - (const_nboyer = (new sc_Pair((new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cf",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cc",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cf",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cd",null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cf",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cu",(new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cw",(new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cb",null)))),null)))))),null)))))))),null))))))))))); - BgL_nboyerzd2benchmarkzd2 = function() { - var args = null; - for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) { - args = sc_cons(arguments[sc_tmp], args); - } - var n; - return ((n = ((args === null)?(0):(args.car))), (BgL_setupzd2boyerzd2()), (BgL_runzd2benchmarkzd2(("nboyer"+(sc_number2string(n))), (1), function() { - return (BgL_testzd2boyerzd2(n)); - }, function(rewrites) { - if ((sc_isNumber(rewrites))) - switch (n) { - case (0): - return (rewrites===(95024)); - break; - case (1): - return (rewrites===(591777)); - break; - case (2): - return (rewrites===(1813975)); - break; - case (3): - return (rewrites===(5375678)); - break; - case (4): - return (rewrites===(16445406)); - break; - case (5): - return (rewrites===(51507739)); - break; - default: - return true; - break; - } - else - return false; - }))); - }; - BgL_setupzd2boyerzd2 = function() { - return true; - }; - BgL_testzd2boyerzd2 = function() { - return true; - }; - translate_term_nboyer = function(term) { - var lst; - return (!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), ((lst = (term.cdr)), ((lst === null)?null:(new sc_Pair((translate_term_nboyer((lst.car))), (translate_args_nboyer((lst.cdr)))))))))); - }; - translate_args_nboyer = function(lst) { - var sc_lst_5; - var term; - return ((lst === null)?null:(new sc_Pair(((term = (lst.car)), (!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), (translate_args_nboyer((term.cdr))))))), ((sc_lst_5 = (lst.cdr)), ((sc_lst_5 === null)?null:(new sc_Pair((translate_term_nboyer((sc_lst_5.car))), (translate_args_nboyer((sc_lst_5.cdr)))))))))); - }; - untranslate_term_nboyer = function(term) { - var optrOpnd; - var tail1131; - var L1127; - var falseHead1130; - var symbol_record; - if (!(term instanceof sc_Pair)) - return term; - else - { - (falseHead1130 = (new sc_Pair(null, null))); - (L1127 = (term.cdr)); - (tail1131 = falseHead1130); - while (!(L1127 === null)) { - { - (tail1131.cdr = (new sc_Pair((untranslate_term_nboyer((L1127.car))), null))); - (tail1131 = (tail1131.cdr)); - (L1127 = (L1127.cdr)); - } - } - (optrOpnd = (falseHead1130.cdr)); - return (new sc_Pair(((symbol_record = (term.car)), (symbol_record[(0)])), optrOpnd)); - } - }; - BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer = function(sym) { - var r; - var x; - return ((x = (sc_assq(sym, BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer))), ((x!== false)?(x.cdr):((r = [sym, null]), (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = (new sc_Pair((new sc_Pair(sym, r)), BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer))), r))); - }; - (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null); - translate_alist_nboyer = function(alist) { - var sc_alist_6; - var term; - return ((alist === null)?null:(new sc_Pair((new sc_Pair((alist.car.car), ((term = (alist.car.cdr)), (!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), (translate_args_nboyer((term.cdr))))))))), ((sc_alist_6 = (alist.cdr)), ((sc_alist_6 === null)?null:(new sc_Pair((new sc_Pair((sc_alist_6.car.car), (translate_term_nboyer((sc_alist_6.car.cdr))))), (translate_alist_nboyer((sc_alist_6.cdr)))))))))); - }; - apply_subst_nboyer = function(alist, term) { - var lst; - var temp_temp; - return (!(term instanceof sc_Pair)?((temp_temp = (sc_assq(term, alist))), ((temp_temp!== false)?(temp_temp.cdr):term)):(new sc_Pair((term.car), ((lst = (term.cdr)), ((lst === null)?null:(new sc_Pair((apply_subst_nboyer(alist, (lst.car))), (apply_subst_lst_nboyer(alist, (lst.cdr)))))))))); - }; - apply_subst_lst_nboyer = function(alist, lst) { - var sc_lst_7; - return ((lst === null)?null:(new sc_Pair((apply_subst_nboyer(alist, (lst.car))), ((sc_lst_7 = (lst.cdr)), ((sc_lst_7 === null)?null:(new sc_Pair((apply_subst_nboyer(alist, (sc_lst_7.car))), (apply_subst_lst_nboyer(alist, (sc_lst_7.cdr)))))))))); - }; - tautologyp_nboyer = function(sc_x_11, true_lst, false_lst) { - var tmp1125; - var x; - var tmp1126; - var sc_x_8; - var sc_tmp1125_9; - var sc_tmp1126_10; - var sc_x_11; - var true_lst; - var false_lst; - while (true) { - if ((((sc_tmp1126_10 = (is_term_equal_nboyer(sc_x_11, true_term_nboyer))), ((sc_tmp1126_10!== false)?sc_tmp1126_10:(is_term_member_nboyer(sc_x_11, true_lst))))!== false)) - return true; - else - if ((((sc_tmp1125_9 = (is_term_equal_nboyer(sc_x_11, false_term_nboyer))), ((sc_tmp1125_9!== false)?sc_tmp1125_9:(is_term_member_nboyer(sc_x_11, false_lst))))!== false)) - return false; - else - if (!(sc_x_11 instanceof sc_Pair)) - return false; - else - if (((sc_x_11.car)===if_constructor_nboyer)) - if ((((sc_x_8 = (sc_x_11.cdr.car)), (tmp1126 = (is_term_equal_nboyer(sc_x_8, true_term_nboyer))), ((tmp1126!== false)?tmp1126:(is_term_member_nboyer(sc_x_8, true_lst))))!== false)) - (sc_x_11 = (sc_x_11.cdr.cdr.car)); - else - if ((((x = (sc_x_11.cdr.car)), (tmp1125 = (is_term_equal_nboyer(x, false_term_nboyer))), ((tmp1125!== false)?tmp1125:(is_term_member_nboyer(x, false_lst))))!== false)) - (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car)); - else - if (((tautologyp_nboyer((sc_x_11.cdr.cdr.car), (new sc_Pair((sc_x_11.cdr.car), true_lst)), false_lst))!== false)) - { - (false_lst = (new sc_Pair((sc_x_11.cdr.car), false_lst))); - (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car)); - } - else - return false; - else - return false; - } - }; - (if_constructor_nboyer = "\u1E9C*"); - (rewrite_count_nboyer = (0)); - rewrite_nboyer = function(term) { - var term2; - var sc_term_12; - var lst; - var symbol_record; - var sc_lst_13; - { - (++rewrite_count_nboyer); - if (!(term instanceof sc_Pair)) - return term; - else - { - (sc_term_12 = (new sc_Pair((term.car), ((sc_lst_13 = (term.cdr)), ((sc_lst_13 === null)?null:(new sc_Pair((rewrite_nboyer((sc_lst_13.car))), (rewrite_args_nboyer((sc_lst_13.cdr)))))))))); - (lst = ((symbol_record = (term.car)), (symbol_record[(1)]))); - while (true) { - if ((lst === null)) - return sc_term_12; - else - if ((((term2 = ((lst.car).cdr.car)), (unify_subst_nboyer = null), (one_way_unify1_nboyer(sc_term_12, term2)))!== false)) - return (rewrite_nboyer((apply_subst_nboyer(unify_subst_nboyer, ((lst.car).cdr.cdr.car))))); - else - (lst = (lst.cdr)); - } - } - } - }; - rewrite_args_nboyer = function(lst) { - var sc_lst_14; - return ((lst === null)?null:(new sc_Pair((rewrite_nboyer((lst.car))), ((sc_lst_14 = (lst.cdr)), ((sc_lst_14 === null)?null:(new sc_Pair((rewrite_nboyer((sc_lst_14.car))), (rewrite_args_nboyer((sc_lst_14.cdr)))))))))); - }; - (unify_subst_nboyer = "\u1E9C*"); - one_way_unify1_nboyer = function(term1, term2) { - var lst1; - var lst2; - var temp_temp; - if (!(term2 instanceof sc_Pair)) - { - (temp_temp = (sc_assq(term2, unify_subst_nboyer))); - if ((temp_temp!== false)) - return (is_term_equal_nboyer(term1, (temp_temp.cdr))); - else - if ((sc_isNumber(term2))) - return (sc_isEqual(term1, term2)); - else - { - (unify_subst_nboyer = (new sc_Pair((new sc_Pair(term2, term1)), unify_subst_nboyer))); - return true; - } - } - else - if (!(term1 instanceof sc_Pair)) - return false; - else - if (((term1.car)===(term2.car))) - { - (lst1 = (term1.cdr)); - (lst2 = (term2.cdr)); - while (true) { - if ((lst1 === null)) - return (lst2 === null); - else - if ((lst2 === null)) - return false; - else - if (((one_way_unify1_nboyer((lst1.car), (lst2.car)))!== false)) - { - (lst1 = (lst1.cdr)); - (lst2 = (lst2.cdr)); - } - else - return false; - } - } - else - return false; - }; - (false_term_nboyer = "\u1E9C*"); - (true_term_nboyer = "\u1E9C*"); - trans_of_implies1_nboyer = function(n) { - var sc_n_15; - return ((sc_isEqual(n, (1)))?(sc_list("\u1E9Cimplies", (0), (1))):(sc_list("\u1E9Cand", (sc_list("\u1E9Cimplies", (n-(1)), n)), ((sc_n_15 = (n-(1))), ((sc_isEqual(sc_n_15, (1)))?(sc_list("\u1E9Cimplies", (0), (1))):(sc_list("\u1E9Cand", (sc_list("\u1E9Cimplies", (sc_n_15-(1)), sc_n_15)), (trans_of_implies1_nboyer((sc_n_15-(1))))))))))); - }; - is_term_equal_nboyer = function(x, y) { - var lst1; - var lst2; - var r2; - var r1; - if ((x instanceof sc_Pair)) - if ((y instanceof sc_Pair)) - if ((((r1 = (x.car)), (r2 = (y.car)), (r1===r2))!== false)) - { - (lst1 = (x.cdr)); - (lst2 = (y.cdr)); - while (true) { - if ((lst1 === null)) - return (lst2 === null); - else - if ((lst2 === null)) - return false; - else - if (((is_term_equal_nboyer((lst1.car), (lst2.car)))!== false)) - { - (lst1 = (lst1.cdr)); - (lst2 = (lst2.cdr)); - } - else - return false; - } - } - else - return false; - else - return false; - else - return (sc_isEqual(x, y)); - }; - is_term_member_nboyer = function(x, lst) { - var x; - var lst; - while (true) { - if ((lst === null)) - return false; - else - if (((is_term_equal_nboyer(x, (lst.car)))!== false)) - return true; - else - (lst = (lst.cdr)); - } - }; - BgL_setupzd2boyerzd2 = function() { - var symbol_record; - var value; - var BgL_sc_symbolzd2record_16zd2; - var sym; - var sc_sym_17; - var term; - var lst; - var sc_term_18; - var sc_term_19; - { - (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null); - (if_constructor_nboyer = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer("\u1E9Cif"))); - (false_term_nboyer = ((sc_term_19 = (new sc_Pair("\u1E9Cf",null))), (!(sc_term_19 instanceof sc_Pair)?sc_term_19:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_19.car))), (translate_args_nboyer((sc_term_19.cdr)))))))); - (true_term_nboyer = ((sc_term_18 = (new sc_Pair("\u1E9Ct",null))), (!(sc_term_18 instanceof sc_Pair)?sc_term_18:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_18.car))), (translate_args_nboyer((sc_term_18.cdr)))))))); - (lst = sc_const_3_nboyer); - while (!(lst === null)) { - { - (term = (lst.car)); - if (((term instanceof sc_Pair)&&(((term.car)==="\u1E9Cequal")&&((term.cdr.car) instanceof sc_Pair)))) - { - (sc_sym_17 = ((term.cdr.car).car)); - (value = (new sc_Pair((!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), (translate_args_nboyer((term.cdr)))))), ((sym = ((term.cdr.car).car)), (BgL_sc_symbolzd2record_16zd2 = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer(sym))), (BgL_sc_symbolzd2record_16zd2[(1)]))))); - (symbol_record = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer(sc_sym_17))); - (symbol_record[(1)] = value); - } - else - (sc_error("ADD-LEMMA did not like term: ", term)); - (lst = (lst.cdr)); - } - } - return true; - } - }; - BgL_testzd2boyerzd2 = function(n) { - var optrOpnd; - var term; - var sc_n_20; - var answer; - var sc_term_21; - var sc_term_22; - { - (rewrite_count_nboyer = (0)); - (term = sc_const_4_nboyer); - (sc_n_20 = n); - while (!(sc_n_20=== 0)) { - { - (term = (sc_list("\u1E9Cor", term, (new sc_Pair("\u1E9Cf",null))))); - (--sc_n_20); - } - } - (sc_term_22 = term); - if (!(sc_term_22 instanceof sc_Pair)) - (optrOpnd = sc_term_22); - else - (optrOpnd = (new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_22.car))), (translate_args_nboyer((sc_term_22.cdr)))))); - (sc_term_21 = (apply_subst_nboyer(((const_nboyer === null)?null:(new sc_Pair((new sc_Pair((const_nboyer.car.car), (translate_term_nboyer((const_nboyer.car.cdr))))), (translate_alist_nboyer((const_nboyer.cdr)))))), optrOpnd))); - (answer = (tautologyp_nboyer((rewrite_nboyer(sc_term_21)), null, null))); - (sc_write(rewrite_count_nboyer)); - (sc_display(" rewrites")); - (sc_newline()); - if ((answer!== false)) - return rewrite_count_nboyer; - else - return false; - } - }; -} -/* Exported Variables */ -var BgL_parsezd2ze3nbzd2treesze3; -var BgL_earleyzd2benchmarkzd2; -var BgL_parsezd2ze3parsedzf3zc2; -var test; -var BgL_parsezd2ze3treesz31; -var BgL_makezd2parserzd2; -/* End Exports */ - -var const_earley; -{ - (const_earley = (new sc_Pair((new sc_Pair("\u1E9Cs",(new sc_Pair((new sc_Pair("\u1E9Ca",null)),(new sc_Pair((new sc_Pair("\u1E9Cs",(new sc_Pair("\u1E9Cs",null)))),null)))))),null))); - BgL_makezd2parserzd2 = function(grammar, lexer) { - var i; - var parser_descr; - var def_loop; - var nb_nts; - var names; - var steps; - var predictors; - var enders; - var starters; - var nts; - var sc_names_1; - var sc_steps_2; - var sc_predictors_3; - var sc_enders_4; - var sc_starters_5; - var nb_confs; - var BgL_sc_defzd2loop_6zd2; - var BgL_sc_nbzd2nts_7zd2; - var sc_nts_8; - var BgL_sc_defzd2loop_9zd2; - var ind; - { - ind = function(nt, sc_nts_10) { - var i; - { - (i = ((sc_nts_10.length)-(1))); - while (true) { - if ((i>=(0))) - if ((sc_isEqual((sc_nts_10[i]), nt))) - return i; - else - (--i); - else - return false; - } - } - }; - (sc_nts_8 = ((BgL_sc_defzd2loop_9zd2 = function(defs, sc_nts_11) { - var rule_loop; - var head; - var def; - return ((defs instanceof sc_Pair)?((def = (defs.car)), (head = (def.car)), (rule_loop = function(rules, sc_nts_12) { - var nt; - var l; - var sc_nts_13; - var rule; - if ((rules instanceof sc_Pair)) - { - (rule = (rules.car)); - (l = rule); - (sc_nts_13 = sc_nts_12); - while ((l instanceof sc_Pair)) { - { - (nt = (l.car)); - (l = (l.cdr)); - (sc_nts_13 = (((sc_member(nt, sc_nts_13))!== false)?sc_nts_13:(new sc_Pair(nt, sc_nts_13)))); - } - } - return (rule_loop((rules.cdr), sc_nts_13)); - } - else - return (BgL_sc_defzd2loop_9zd2((defs.cdr), sc_nts_12)); - }), (rule_loop((def.cdr), (((sc_member(head, sc_nts_11))!== false)?sc_nts_11:(new sc_Pair(head, sc_nts_11)))))):(sc_list2vector((sc_reverse(sc_nts_11))))); - }), (BgL_sc_defzd2loop_9zd2(grammar, null)))); - (BgL_sc_nbzd2nts_7zd2 = (sc_nts_8.length)); - (nb_confs = (((BgL_sc_defzd2loop_6zd2 = function(defs, BgL_sc_nbzd2confs_14zd2) { - var rule_loop; - var def; - return ((defs instanceof sc_Pair)?((def = (defs.car)), (rule_loop = function(rules, BgL_sc_nbzd2confs_15zd2) { - var l; - var BgL_sc_nbzd2confs_16zd2; - var rule; - if ((rules instanceof sc_Pair)) - { - (rule = (rules.car)); - (l = rule); - (BgL_sc_nbzd2confs_16zd2 = BgL_sc_nbzd2confs_15zd2); - while ((l instanceof sc_Pair)) { - { - (l = (l.cdr)); - (++BgL_sc_nbzd2confs_16zd2); - } - } - return (rule_loop((rules.cdr), (BgL_sc_nbzd2confs_16zd2+(1)))); - } - else - return (BgL_sc_defzd2loop_6zd2((defs.cdr), BgL_sc_nbzd2confs_15zd2)); - }), (rule_loop((def.cdr), BgL_sc_nbzd2confs_14zd2))):BgL_sc_nbzd2confs_14zd2); - }), (BgL_sc_defzd2loop_6zd2(grammar, (0))))+BgL_sc_nbzd2nts_7zd2)); - (sc_starters_5 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null))); - (sc_enders_4 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null))); - (sc_predictors_3 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null))); - (sc_steps_2 = (sc_makeVector(nb_confs, false))); - (sc_names_1 = (sc_makeVector(nb_confs, false))); - (nts = sc_nts_8); - (starters = sc_starters_5); - (enders = sc_enders_4); - (predictors = sc_predictors_3); - (steps = sc_steps_2); - (names = sc_names_1); - (nb_nts = (sc_nts_8.length)); - (i = (nb_nts-(1))); - while ((i>=(0))) { - { - (sc_steps_2[i] = (i-nb_nts)); - (sc_names_1[i] = (sc_list((sc_nts_8[i]), (0)))); - (sc_enders_4[i] = (sc_list(i))); - (--i); - } - } - def_loop = function(defs, conf) { - var rule_loop; - var head; - var def; - return ((defs instanceof sc_Pair)?((def = (defs.car)), (head = (def.car)), (rule_loop = function(rules, conf, rule_num) { - var i; - var sc_i_17; - var nt; - var l; - var sc_conf_18; - var sc_i_19; - var rule; - if ((rules instanceof sc_Pair)) - { - (rule = (rules.car)); - (names[conf] = (sc_list(head, rule_num))); - (sc_i_19 = (ind(head, nts))); - (starters[sc_i_19] = (new sc_Pair(conf, (starters[sc_i_19])))); - (l = rule); - (sc_conf_18 = conf); - while ((l instanceof sc_Pair)) { - { - (nt = (l.car)); - (steps[sc_conf_18] = (ind(nt, nts))); - (sc_i_17 = (ind(nt, nts))); - (predictors[sc_i_17] = (new sc_Pair(sc_conf_18, (predictors[sc_i_17])))); - (l = (l.cdr)); - (++sc_conf_18); - } - } - (steps[sc_conf_18] = ((ind(head, nts))-nb_nts)); - (i = (ind(head, nts))); - (enders[i] = (new sc_Pair(sc_conf_18, (enders[i])))); - return (rule_loop((rules.cdr), (sc_conf_18+(1)), (rule_num+(1)))); - } - else - return (def_loop((defs.cdr), conf)); - }), (rule_loop((def.cdr), conf, (1)))):undefined); - }; - (def_loop(grammar, (sc_nts_8.length))); - (parser_descr = [lexer, sc_nts_8, sc_starters_5, sc_enders_4, sc_predictors_3, sc_steps_2, sc_names_1]); - return function(input) { - var optrOpnd; - var sc_optrOpnd_20; - var sc_optrOpnd_21; - var sc_optrOpnd_22; - var loop1; - var BgL_sc_stateza2_23za2; - var toks; - var BgL_sc_nbzd2nts_24zd2; - var sc_steps_25; - var sc_enders_26; - var state_num; - var BgL_sc_statesza2_27za2; - var states; - var i; - var conf; - var l; - var tok_nts; - var sc_i_28; - var sc_i_29; - var l1; - var l2; - var tok; - var tail1129; - var L1125; - var goal_enders; - var BgL_sc_statesza2_30za2; - var BgL_sc_nbzd2nts_31zd2; - var BgL_sc_nbzd2confs_32zd2; - var nb_toks; - var goal_starters; - var sc_states_33; - var BgL_sc_nbzd2confs_34zd2; - var BgL_sc_nbzd2toks_35zd2; - var sc_toks_36; - var falseHead1128; - var sc_names_37; - var sc_steps_38; - var sc_predictors_39; - var sc_enders_40; - var sc_starters_41; - var sc_nts_42; - var lexer; - var sc_ind_43; - var make_states; - var BgL_sc_confzd2setzd2getza2_44za2; - var conf_set_merge_new_bang; - var conf_set_adjoin; - var BgL_sc_confzd2setzd2adjoinza2_45za2; - var BgL_sc_confzd2setzd2adjoinza2za2_46z00; - var conf_set_union; - var forw; - var is_parsed; - var deriv_trees; - var BgL_sc_derivzd2treesza2_47z70; - var nb_deriv_trees; - var BgL_sc_nbzd2derivzd2treesza2_48za2; - { - sc_ind_43 = function(nt, sc_nts_49) { - var i; - { - (i = ((sc_nts_49.length)-(1))); - while (true) { - if ((i>=(0))) - if ((sc_isEqual((sc_nts_49[i]), nt))) - return i; - else - (--i); - else - return false; - } - } - }; - make_states = function(BgL_sc_nbzd2toks_50zd2, BgL_sc_nbzd2confs_51zd2) { - var v; - var i; - var sc_states_52; - { - (sc_states_52 = (sc_makeVector((BgL_sc_nbzd2toks_50zd2+(1)), false))); - (i = BgL_sc_nbzd2toks_50zd2); - while ((i>=(0))) { - { - (v = (sc_makeVector((BgL_sc_nbzd2confs_51zd2+(1)), false))); - (v[(0)] = (-1)); - (sc_states_52[i] = v); - (--i); - } - } - return sc_states_52; - } - }; - BgL_sc_confzd2setzd2getza2_44za2 = function(state, BgL_sc_statezd2num_53zd2, sc_conf_54) { - var conf_set; - var BgL_sc_confzd2set_55zd2; - return ((BgL_sc_confzd2set_55zd2 = (state[(sc_conf_54+(1))])), ((BgL_sc_confzd2set_55zd2!== false)?BgL_sc_confzd2set_55zd2:((conf_set = (sc_makeVector((BgL_sc_statezd2num_53zd2+(6)), false))), (conf_set[(1)] = (-3)), (conf_set[(2)] = (-1)), (conf_set[(3)] = (-1)), (conf_set[(4)] = (-1)), (state[(sc_conf_54+(1))] = conf_set), conf_set))); - }; - conf_set_merge_new_bang = function(conf_set) { - return ((conf_set[((conf_set[(1)])+(5))] = (conf_set[(4)])), (conf_set[(1)] = (conf_set[(3)])), (conf_set[(3)] = (-1)), (conf_set[(4)] = (-1))); - }; - conf_set_adjoin = function(state, conf_set, sc_conf_56, i) { - var tail; - return ((tail = (conf_set[(3)])), (conf_set[(i+(5))] = (-1)), (conf_set[(tail+(5))] = i), (conf_set[(3)] = i), ((tail<(0))?((conf_set[(0)] = (state[(0)])), (state[(0)] = sc_conf_56)):undefined)); - }; - BgL_sc_confzd2setzd2adjoinza2_45za2 = function(sc_states_57, BgL_sc_statezd2num_58zd2, l, i) { - var conf_set; - var sc_conf_59; - var l1; - var state; - { - (state = (sc_states_57[BgL_sc_statezd2num_58zd2])); - (l1 = l); - while ((l1 instanceof sc_Pair)) { - { - (sc_conf_59 = (l1.car)); - (conf_set = (BgL_sc_confzd2setzd2getza2_44za2(state, BgL_sc_statezd2num_58zd2, sc_conf_59))); - if (((conf_set[(i+(5))])=== false)) - { - (conf_set_adjoin(state, conf_set, sc_conf_59, i)); - (l1 = (l1.cdr)); - } - else - (l1 = (l1.cdr)); - } - } - return undefined; - } - }; - BgL_sc_confzd2setzd2adjoinza2za2_46z00 = function(sc_states_60, BgL_sc_statesza2_61za2, BgL_sc_statezd2num_62zd2, sc_conf_63, i) { - var BgL_sc_confzd2setza2_64z70; - var BgL_sc_stateza2_65za2; - var conf_set; - var state; - return ((state = (sc_states_60[BgL_sc_statezd2num_62zd2])), ((((conf_set = (state[(sc_conf_63+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)?((BgL_sc_stateza2_65za2 = (BgL_sc_statesza2_61za2[BgL_sc_statezd2num_62zd2])), (BgL_sc_confzd2setza2_64z70 = (BgL_sc_confzd2setzd2getza2_44za2(BgL_sc_stateza2_65za2, BgL_sc_statezd2num_62zd2, sc_conf_63))), (((BgL_sc_confzd2setza2_64z70[(i+(5))])=== false)?(conf_set_adjoin(BgL_sc_stateza2_65za2, BgL_sc_confzd2setza2_64z70, sc_conf_63, i)):undefined), true):false)); - }; - conf_set_union = function(state, conf_set, sc_conf_66, other_set) { - var i; - { - (i = (other_set[(2)])); - while ((i>=(0))) { - if (((conf_set[(i+(5))])=== false)) - { - (conf_set_adjoin(state, conf_set, sc_conf_66, i)); - (i = (other_set[(i+(5))])); - } - else - (i = (other_set[(i+(5))])); - } - return undefined; - } - }; - forw = function(sc_states_67, BgL_sc_statezd2num_68zd2, sc_starters_69, sc_enders_70, sc_predictors_71, sc_steps_72, sc_nts_73) { - var next_set; - var next; - var conf_set; - var ender; - var l; - var starter_set; - var starter; - var sc_l_74; - var sc_loop1_75; - var head; - var BgL_sc_confzd2set_76zd2; - var BgL_sc_statezd2num_77zd2; - var state; - var sc_states_78; - var preds; - var BgL_sc_confzd2set_79zd2; - var step; - var sc_conf_80; - var BgL_sc_nbzd2nts_81zd2; - var sc_state_82; - { - (sc_state_82 = (sc_states_67[BgL_sc_statezd2num_68zd2])); - (BgL_sc_nbzd2nts_81zd2 = (sc_nts_73.length)); - while (true) { - { - (sc_conf_80 = (sc_state_82[(0)])); - if ((sc_conf_80>=(0))) - { - (step = (sc_steps_72[sc_conf_80])); - (BgL_sc_confzd2set_79zd2 = (sc_state_82[(sc_conf_80+(1))])); - (head = (BgL_sc_confzd2set_79zd2[(4)])); - (sc_state_82[(0)] = (BgL_sc_confzd2set_79zd2[(0)])); - (conf_set_merge_new_bang(BgL_sc_confzd2set_79zd2)); - if ((step>=(0))) - { - (sc_l_74 = (sc_starters_69[step])); - while ((sc_l_74 instanceof sc_Pair)) { - { - (starter = (sc_l_74.car)); - (starter_set = (BgL_sc_confzd2setzd2getza2_44za2(sc_state_82, BgL_sc_statezd2num_68zd2, starter))); - if (((starter_set[(BgL_sc_statezd2num_68zd2+(5))])=== false)) - { - (conf_set_adjoin(sc_state_82, starter_set, starter, BgL_sc_statezd2num_68zd2)); - (sc_l_74 = (sc_l_74.cdr)); - } - else - (sc_l_74 = (sc_l_74.cdr)); - } - } - (l = (sc_enders_70[step])); - while ((l instanceof sc_Pair)) { - { - (ender = (l.car)); - if ((((conf_set = (sc_state_82[(ender+(1))])), ((conf_set!== false)?(conf_set[(BgL_sc_statezd2num_68zd2+(5))]):false))!== false)) - { - (next = (sc_conf_80+(1))); - (next_set = (BgL_sc_confzd2setzd2getza2_44za2(sc_state_82, BgL_sc_statezd2num_68zd2, next))); - (conf_set_union(sc_state_82, next_set, next, BgL_sc_confzd2set_79zd2)); - (l = (l.cdr)); - } - else - (l = (l.cdr)); - } - } - } - else - { - (preds = (sc_predictors_71[(step+BgL_sc_nbzd2nts_81zd2)])); - (sc_states_78 = sc_states_67); - (state = sc_state_82); - (BgL_sc_statezd2num_77zd2 = BgL_sc_statezd2num_68zd2); - (BgL_sc_confzd2set_76zd2 = BgL_sc_confzd2set_79zd2); - sc_loop1_75 = function(l) { - var sc_state_83; - var BgL_sc_nextzd2set_84zd2; - var sc_next_85; - var pred_set; - var i; - var pred; - if ((l instanceof sc_Pair)) - { - (pred = (l.car)); - (i = head); - while ((i>=(0))) { - { - (pred_set = ((sc_state_83 = (sc_states_78[i])), (sc_state_83[(pred+(1))]))); - if ((pred_set!== false)) - { - (sc_next_85 = (pred+(1))); - (BgL_sc_nextzd2set_84zd2 = (BgL_sc_confzd2setzd2getza2_44za2(state, BgL_sc_statezd2num_77zd2, sc_next_85))); - (conf_set_union(state, BgL_sc_nextzd2set_84zd2, sc_next_85, pred_set)); - } - (i = (BgL_sc_confzd2set_76zd2[(i+(5))])); - } - } - return (sc_loop1_75((l.cdr))); - } - else - return undefined; - }; - (sc_loop1_75(preds)); - } - } - else - return undefined; - } - } - } - }; - is_parsed = function(nt, i, j, sc_nts_86, sc_enders_87, sc_states_88) { - var conf_set; - var state; - var sc_conf_89; - var l; - var BgL_sc_ntza2_90za2; - { - (BgL_sc_ntza2_90za2 = (sc_ind_43(nt, sc_nts_86))); - if ((BgL_sc_ntza2_90za2!== false)) - { - (sc_nts_86.length); - (l = (sc_enders_87[BgL_sc_ntza2_90za2])); - while (true) { - if ((l instanceof sc_Pair)) - { - (sc_conf_89 = (l.car)); - if ((((state = (sc_states_88[j])), (conf_set = (state[(sc_conf_89+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)) - return true; - else - (l = (l.cdr)); - } - else - return false; - } - } - else - return false; - } - }; - deriv_trees = function(sc_conf_91, i, j, sc_enders_92, sc_steps_93, sc_names_94, sc_toks_95, sc_states_96, BgL_sc_nbzd2nts_97zd2) { - var sc_loop1_98; - var prev; - var name; - return ((name = (sc_names_94[sc_conf_91])), ((name!== false)?((sc_conf_91<BgL_sc_nbzd2nts_97zd2)?(sc_list((sc_list(name, ((sc_toks_95[i]).car))))):(sc_list((sc_list(name))))):((prev = (sc_conf_91-(1))), (sc_loop1_98 = function(l1, l2) { - var loop2; - var ender_set; - var state; - var ender; - var l1; - var l2; - while (true) { - if ((l1 instanceof sc_Pair)) - { - (ender = (l1.car)); - (ender_set = ((state = (sc_states_96[j])), (state[(ender+(1))]))); - if ((ender_set!== false)) - { - loop2 = function(k, l2) { - var loop3; - var ender_trees; - var prev_trees; - var conf_set; - var sc_state_99; - var k; - var l2; - while (true) { - if ((k>=(0))) - if (((k>=i)&&(((sc_state_99 = (sc_states_96[k])), (conf_set = (sc_state_99[(prev+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))) - { - (prev_trees = (deriv_trees(prev, i, k, sc_enders_92, sc_steps_93, sc_names_94, sc_toks_95, sc_states_96, BgL_sc_nbzd2nts_97zd2))); - (ender_trees = (deriv_trees(ender, k, j, sc_enders_92, sc_steps_93, sc_names_94, sc_toks_95, sc_states_96, BgL_sc_nbzd2nts_97zd2))); - loop3 = function(l3, l2) { - var l4; - var sc_l2_100; - var ender_tree; - if ((l3 instanceof sc_Pair)) - { - (ender_tree = (sc_list((l3.car)))); - (l4 = prev_trees); - (sc_l2_100 = l2); - while ((l4 instanceof sc_Pair)) { - { - (sc_l2_100 = (new sc_Pair((sc_append((l4.car), ender_tree)), sc_l2_100))); - (l4 = (l4.cdr)); - } - } - return (loop3((l3.cdr), sc_l2_100)); - } - else - return (loop2((ender_set[(k+(5))]), l2)); - }; - return (loop3(ender_trees, l2)); - } - else - (k = (ender_set[(k+(5))])); - else - return (sc_loop1_98((l1.cdr), l2)); - } - }; - return (loop2((ender_set[(2)]), l2)); - } - else - (l1 = (l1.cdr)); - } - else - return l2; - } - }), (sc_loop1_98((sc_enders_92[(sc_steps_93[prev])]), null))))); - }; - BgL_sc_derivzd2treesza2_47z70 = function(nt, i, j, sc_nts_101, sc_enders_102, sc_steps_103, sc_names_104, sc_toks_105, sc_states_106) { - var conf_set; - var state; - var sc_conf_107; - var l; - var trees; - var BgL_sc_nbzd2nts_108zd2; - var BgL_sc_ntza2_109za2; - { - (BgL_sc_ntza2_109za2 = (sc_ind_43(nt, sc_nts_101))); - if ((BgL_sc_ntza2_109za2!== false)) - { - (BgL_sc_nbzd2nts_108zd2 = (sc_nts_101.length)); - (l = (sc_enders_102[BgL_sc_ntza2_109za2])); - (trees = null); - while ((l instanceof sc_Pair)) { - { - (sc_conf_107 = (l.car)); - if ((((state = (sc_states_106[j])), (conf_set = (state[(sc_conf_107+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)) - { - (l = (l.cdr)); - (trees = (sc_append((deriv_trees(sc_conf_107, i, j, sc_enders_102, sc_steps_103, sc_names_104, sc_toks_105, sc_states_106, BgL_sc_nbzd2nts_108zd2)), trees))); - } - else - (l = (l.cdr)); - } - } - return trees; - } - else - return false; - } - }; - nb_deriv_trees = function(sc_conf_110, i, j, sc_enders_111, sc_steps_112, sc_toks_113, sc_states_114, BgL_sc_nbzd2nts_115zd2) { - var sc_loop1_116; - var tmp1124; - var prev; - return ((prev = (sc_conf_110-(1))), ((((tmp1124 = (sc_conf_110<BgL_sc_nbzd2nts_115zd2)), ((tmp1124!== false)?tmp1124:((sc_steps_112[prev])<(0))))!== false)?(1):((sc_loop1_116 = function(l, sc_n_118) { - var nb_ender_trees; - var nb_prev_trees; - var conf_set; - var state; - var k; - var n; - var ender_set; - var sc_state_117; - var ender; - var l; - var sc_n_118; - while (true) { - if ((l instanceof sc_Pair)) - { - (ender = (l.car)); - (ender_set = ((sc_state_117 = (sc_states_114[j])), (sc_state_117[(ender+(1))]))); - if ((ender_set!== false)) - { - (k = (ender_set[(2)])); - (n = sc_n_118); - while ((k>=(0))) { - if (((k>=i)&&(((state = (sc_states_114[k])), (conf_set = (state[(prev+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))) - { - (nb_prev_trees = (nb_deriv_trees(prev, i, k, sc_enders_111, sc_steps_112, sc_toks_113, sc_states_114, BgL_sc_nbzd2nts_115zd2))); - (nb_ender_trees = (nb_deriv_trees(ender, k, j, sc_enders_111, sc_steps_112, sc_toks_113, sc_states_114, BgL_sc_nbzd2nts_115zd2))); - (k = (ender_set[(k+(5))])); - (n +=(nb_prev_trees*nb_ender_trees)); - } - else - (k = (ender_set[(k+(5))])); - } - return (sc_loop1_116((l.cdr), n)); - } - else - (l = (l.cdr)); - } - else - return sc_n_118; - } - }), (sc_loop1_116((sc_enders_111[(sc_steps_112[prev])]), (0)))))); - }; - BgL_sc_nbzd2derivzd2treesza2_48za2 = function(nt, i, j, sc_nts_119, sc_enders_120, sc_steps_121, sc_toks_122, sc_states_123) { - var conf_set; - var state; - var sc_conf_124; - var l; - var nb_trees; - var BgL_sc_nbzd2nts_125zd2; - var BgL_sc_ntza2_126za2; - { - (BgL_sc_ntza2_126za2 = (sc_ind_43(nt, sc_nts_119))); - if ((BgL_sc_ntza2_126za2!== false)) - { - (BgL_sc_nbzd2nts_125zd2 = (sc_nts_119.length)); - (l = (sc_enders_120[BgL_sc_ntza2_126za2])); - (nb_trees = (0)); - while ((l instanceof sc_Pair)) { - { - (sc_conf_124 = (l.car)); - if ((((state = (sc_states_123[j])), (conf_set = (state[(sc_conf_124+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)) - { - (l = (l.cdr)); - (nb_trees = ((nb_deriv_trees(sc_conf_124, i, j, sc_enders_120, sc_steps_121, sc_toks_122, sc_states_123, BgL_sc_nbzd2nts_125zd2))+nb_trees)); - } - else - (l = (l.cdr)); - } - } - return nb_trees; - } - else - return false; - } - }; - (lexer = (parser_descr[(0)])); - (sc_nts_42 = (parser_descr[(1)])); - (sc_starters_41 = (parser_descr[(2)])); - (sc_enders_40 = (parser_descr[(3)])); - (sc_predictors_39 = (parser_descr[(4)])); - (sc_steps_38 = (parser_descr[(5)])); - (sc_names_37 = (parser_descr[(6)])); - (falseHead1128 = (new sc_Pair(null, null))); - (L1125 = (lexer(input))); - (tail1129 = falseHead1128); - while (!(L1125 === null)) { - { - (tok = (L1125.car)); - (l1 = (tok.cdr)); - (l2 = null); - while ((l1 instanceof sc_Pair)) { - { - (sc_i_29 = (sc_ind_43((l1.car), sc_nts_42))); - if ((sc_i_29!== false)) - { - (l1 = (l1.cdr)); - (l2 = (new sc_Pair(sc_i_29, l2))); - } - else - (l1 = (l1.cdr)); - } - } - (sc_optrOpnd_22 = (new sc_Pair((tok.car), (sc_reverse(l2))))); - (sc_optrOpnd_21 = (new sc_Pair(sc_optrOpnd_22, null))); - (tail1129.cdr = sc_optrOpnd_21); - (tail1129 = (tail1129.cdr)); - (L1125 = (L1125.cdr)); - } - } - (sc_optrOpnd_20 = (falseHead1128.cdr)); - (sc_toks_36 = (sc_list2vector(sc_optrOpnd_20))); - (BgL_sc_nbzd2toks_35zd2 = (sc_toks_36.length)); - (BgL_sc_nbzd2confs_34zd2 = (sc_steps_38.length)); - (sc_states_33 = (make_states(BgL_sc_nbzd2toks_35zd2, BgL_sc_nbzd2confs_34zd2))); - (goal_starters = (sc_starters_41[(0)])); - (BgL_sc_confzd2setzd2adjoinza2_45za2(sc_states_33, (0), goal_starters, (0))); - (forw(sc_states_33, (0), sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_nts_42)); - (sc_i_28 = (0)); - while ((sc_i_28<BgL_sc_nbzd2toks_35zd2)) { - { - (tok_nts = ((sc_toks_36[sc_i_28]).cdr)); - (BgL_sc_confzd2setzd2adjoinza2_45za2(sc_states_33, (sc_i_28+(1)), tok_nts, sc_i_28)); - (forw(sc_states_33, (sc_i_28+(1)), sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_nts_42)); - (++sc_i_28); - } - } - (nb_toks = (sc_toks_36.length)); - (BgL_sc_nbzd2confs_32zd2 = (sc_steps_38.length)); - (BgL_sc_nbzd2nts_31zd2 = (sc_nts_42.length)); - (BgL_sc_statesza2_30za2 = (make_states(nb_toks, BgL_sc_nbzd2confs_32zd2))); - (goal_enders = (sc_enders_40[(0)])); - (l = goal_enders); - while ((l instanceof sc_Pair)) { - { - (conf = (l.car)); - (BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_33, BgL_sc_statesza2_30za2, nb_toks, conf, (0))); - (l = (l.cdr)); - } - } - (i = nb_toks); - while ((i>=(0))) { - { - (states = sc_states_33); - (BgL_sc_statesza2_27za2 = BgL_sc_statesza2_30za2); - (state_num = i); - (sc_enders_26 = sc_enders_40); - (sc_steps_25 = sc_steps_38); - (BgL_sc_nbzd2nts_24zd2 = BgL_sc_nbzd2nts_31zd2); - (toks = sc_toks_36); - (BgL_sc_stateza2_23za2 = (BgL_sc_statesza2_30za2[i])); - loop1 = function() { - var sc_loop1_127; - var prev; - var BgL_sc_statesza2_128za2; - var sc_states_129; - var j; - var i; - var sc_i_130; - var head; - var conf_set; - var sc_conf_131; - { - (sc_conf_131 = (BgL_sc_stateza2_23za2[(0)])); - if ((sc_conf_131>=(0))) - { - (conf_set = (BgL_sc_stateza2_23za2[(sc_conf_131+(1))])); - (head = (conf_set[(4)])); - (BgL_sc_stateza2_23za2[(0)] = (conf_set[(0)])); - (conf_set_merge_new_bang(conf_set)); - (sc_i_130 = head); - while ((sc_i_130>=(0))) { - { - (i = sc_i_130); - (j = state_num); - (sc_states_129 = states); - (BgL_sc_statesza2_128za2 = BgL_sc_statesza2_27za2); - (prev = (sc_conf_131-(1))); - if (((sc_conf_131>=BgL_sc_nbzd2nts_24zd2)&&((sc_steps_25[prev])>=(0)))) - { - sc_loop1_127 = function(l) { - var k; - var ender_set; - var state; - var ender; - var l; - while (true) { - if ((l instanceof sc_Pair)) - { - (ender = (l.car)); - (ender_set = ((state = (sc_states_129[j])), (state[(ender+(1))]))); - if ((ender_set!== false)) - { - (k = (ender_set[(2)])); - while ((k>=(0))) { - { - if ((k>=i)) - if (((BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_129, BgL_sc_statesza2_128za2, k, prev, i))!== false)) - (BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_129, BgL_sc_statesza2_128za2, j, ender, k)); - (k = (ender_set[(k+(5))])); - } - } - return (sc_loop1_127((l.cdr))); - } - else - (l = (l.cdr)); - } - else - return undefined; - } - }; - (sc_loop1_127((sc_enders_26[(sc_steps_25[prev])]))); - } - (sc_i_130 = (conf_set[(sc_i_130+(5))])); - } - } - return (loop1()); - } - else - return undefined; - } - }; - (loop1()); - (--i); - } - } - (optrOpnd = BgL_sc_statesza2_30za2); - return [sc_nts_42, sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_names_37, sc_toks_36, optrOpnd, is_parsed, BgL_sc_derivzd2treesza2_47z70, BgL_sc_nbzd2derivzd2treesza2_48za2]; - } - }; - } - }; - BgL_parsezd2ze3parsedzf3zc2 = function(parse, nt, i, j) { - var is_parsed; - var states; - var enders; - var nts; - return ((nts = (parse[(0)])), (enders = (parse[(2)])), (states = (parse[(7)])), (is_parsed = (parse[(8)])), (is_parsed(nt, i, j, nts, enders, states))); - }; - BgL_parsezd2ze3treesz31 = function(parse, nt, i, j) { - var BgL_sc_derivzd2treesza2_132z70; - var states; - var toks; - var names; - var steps; - var enders; - var nts; - return ((nts = (parse[(0)])), (enders = (parse[(2)])), (steps = (parse[(4)])), (names = (parse[(5)])), (toks = (parse[(6)])), (states = (parse[(7)])), (BgL_sc_derivzd2treesza2_132z70 = (parse[(9)])), (BgL_sc_derivzd2treesza2_132z70(nt, i, j, nts, enders, steps, names, toks, states))); - }; - BgL_parsezd2ze3nbzd2treesze3 = function(parse, nt, i, j) { - var BgL_sc_nbzd2derivzd2treesza2_133za2; - var states; - var toks; - var steps; - var enders; - var nts; - return ((nts = (parse[(0)])), (enders = (parse[(2)])), (steps = (parse[(4)])), (toks = (parse[(6)])), (states = (parse[(7)])), (BgL_sc_nbzd2derivzd2treesza2_133za2 = (parse[(10)])), (BgL_sc_nbzd2derivzd2treesza2_133za2(nt, i, j, nts, enders, steps, toks, states))); - }; - test = function(k) { - var x; - var p; - return ((p = (BgL_makezd2parserzd2(const_earley, function(l) { - var sc_x_134; - var tail1134; - var L1130; - var falseHead1133; - { - (falseHead1133 = (new sc_Pair(null, null))); - (tail1134 = falseHead1133); - (L1130 = l); - while (!(L1130 === null)) { - { - (tail1134.cdr = (new sc_Pair(((sc_x_134 = (L1130.car)), (sc_list(sc_x_134, sc_x_134))), null))); - (tail1134 = (tail1134.cdr)); - (L1130 = (L1130.cdr)); - } - } - return (falseHead1133.cdr); - } - }))), (x = (p((sc_vector2list((sc_makeVector(k, "\u1E9Ca"))))))), (sc_length((BgL_parsezd2ze3treesz31(x, "\u1E9Cs", (0), k))))); - }; - BgL_earleyzd2benchmarkzd2 = function() { - var args = null; - for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) { - args = sc_cons(arguments[sc_tmp], args); - } - var k; - return ((k = ((args === null)?(7):(args.car))), (BgL_runzd2benchmarkzd2("earley", (1), function() { - return (test(k)); - }, function(result) { - return ((sc_display(result)), (sc_newline()), result == 132); - }))); - }; -} - - -/************* END OF GENERATED CODE *************/ -// Invoke this function to run a benchmark. -// The first argument is a string identifying the benchmark. -// The second argument is the number of times to run the benchmark. -// The third argument is a function that runs the benchmark. -// The fourth argument is a unary function that warns if the result -// returned by the benchmark is incorrect. -// -// Example: -// RunBenchmark("new Array()", -// 1, -// function () { new Array(1000000); } -// function (v) { -// return (v instanceof Array) && (v.length == 1000000); -// }); - -SC_DEFAULT_OUT = new sc_GenericOutputPort(function(s) {}); -SC_ERROR_OUT = SC_DEFAULT_OUT; - -function RunBenchmark(name, count, run, warn) { - for (var n = 0; n < count; ++n) { - var result = run(); - if (!warn(result)) { - throw new Error("Earley or Boyer did incorrect number of rewrites"); - } - } -} - -var BgL_runzd2benchmarkzd2 = RunBenchmark; - -for (var i = 0; i < 4; ++i) { - BgL_earleyzd2benchmarkzd2(); - BgL_nboyerzd2benchmarkzd2(); -} diff --git a/implementation-contributed/javascriptcore/stress/v8-parameter-scoping.js b/implementation-contributed/javascriptcore/stress/v8-parameter-scoping.js deleted file mode 100644 index 46b0eb6ab3..0000000000 --- a/implementation-contributed/javascriptcore/stress/v8-parameter-scoping.js +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2014, the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -function assert(b) { - if (!b) - throw new Error("bad"); -} - -function assertEquals(a, b) { - assert(a === b); -} - -function assertTrue(a) { - assert(a === true); -} - -;(function testExpressionTypes() { - "use strict"; - ((x, y = x) => assertEquals(42, y))(42); - - ((x, y = (x)) => assertEquals(42, y))(42); - ((x, y = `${x}`) => assertEquals("42", y))(42); - ((x, y = x = x + 1) => assertEquals(43, y))(42); - ((x, y = x()) => assertEquals(42, y))(() => 42); - ((x, y = new x()) => assertEquals(42, y.z))(function() { this.z = 42 }); - ((x, y = -x) => assertEquals(-42, y))(42); - ((x, y = ++x) => assertEquals(43, y))(42); - ((x, y = x === 42) => assertTrue(y))(42); - ((x, y = (x == 42 ? x : 0)) => assertEquals(42, y))(42); - - ((x, y = function() { return x }) => assertEquals(42, y()))(42); - ((x, y = () => x) => assertEquals(42, y()))(42); - - // Literals - ((x, y = {z: x}) => assertEquals(42, y.z))(42); - ((x, y = {[x]: x}) => assertEquals(42, y[42]))(42); - ((x, y = [x]) => assertEquals(42, y[0]))(42); - ((x, y = [...x]) => assertEquals(42, y[0]))([42]); - - ((x, y = class { - static [x]() { return x } - }) => assertEquals(42, y[42]()))(42); - ((x, y = (new class { - z() { return x } - })) => assertEquals(42, y.z()))(42); - - ((x, y = (new class Y { - static [x]() { return x } - z() { return Y[42]() } - })) => assertEquals(42, y.z()))(42); - - ((x, y = (new class { - constructor() { this.z = x } - })) => assertEquals(42, y.z))(42); - ((x, y = (new class Y { - constructor() { this.z = x } - })) => assertEquals(42, y.z))(42); - - ((x, y = (new class extends x { - })) => assertEquals(42, y.z()))(class { z() { return 42 } }); - - // Defaults inside destructuring - ((x, {y = x}) => assertEquals(42, y))(42, {}); - ((x, [y = x]) => assertEquals(42, y))(42, []); -})(); - -;(function testMultiScopeCapture() { - "use strict"; - var x = 1; - { - let y = 2; - ((x, y, a = x, b = y) => { - assertEquals(3, x); - assertEquals(3, a); - assertEquals(4, y); - assertEquals(4, b); - })(3, 4); - } -})(); diff --git a/implementation-contributed/javascriptcore/stress/v8-raytrace-strict.js b/implementation-contributed/javascriptcore/stress/v8-raytrace-strict.js deleted file mode 100644 index 46ca6e8923..0000000000 --- a/implementation-contributed/javascriptcore/stress/v8-raytrace-strict.js +++ /dev/null @@ -1,904 +0,0 @@ -"use strict"; - -// The ray tracer code in this file is written by Adam Burmister. It -// is available in its original form from: -// -// http://labs.flog.nz.co/raytracer/ -// -// It has been modified slightly by Google to work as a standalone -// benchmark, but the all the computational code remains -// untouched. This file also contains a copy of parts of the Prototype -// JavaScript framework which is used by the ray tracer. - -// Variable used to hold a number that can be used to verify that -// the scene was ray traced correctly. -var checkNumber; - - -// ------------------------------------------------------------------------ -// ------------------------------------------------------------------------ - -// The following is a copy of parts of the Prototype JavaScript library: - -// Prototype JavaScript framework, version 1.5.0 -// (c) 2005-2007 Sam Stephenson -// -// Prototype is freely distributable under the terms of an MIT-style license. -// For details, see the Prototype web site: http://prototype.conio.net/ - - -var Class = { - create: function() { - return function() { - this.initialize.apply(this, arguments); - } - } -}; - - -Object.extend = function(destination, source) { - for (var property in source) { - destination[property] = source[property]; - } - return destination; -}; - - -// ------------------------------------------------------------------------ -// ------------------------------------------------------------------------ - -// The rest of this file is the actual ray tracer written by Adam -// Burmister. It's a concatenation of the following files: -// -// flog/color.js -// flog/light.js -// flog/vector.js -// flog/ray.js -// flog/scene.js -// flog/material/basematerial.js -// flog/material/solid.js -// flog/material/chessboard.js -// flog/shape/baseshape.js -// flog/shape/sphere.js -// flog/shape/plane.js -// flog/intersectioninfo.js -// flog/camera.js -// flog/background.js -// flog/engine.js - - -/* Fake a Flog.* namespace */ -if(typeof(Flog) == 'undefined') var Flog = {}; -if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; - -Flog.RayTracer.Color = Class.create(); - -Flog.RayTracer.Color.prototype = { - red : 0.0, - green : 0.0, - blue : 0.0, - - initialize : function(r, g, b) { - if(!r) r = 0.0; - if(!g) g = 0.0; - if(!b) b = 0.0; - - this.red = r; - this.green = g; - this.blue = b; - }, - - add : function(c1, c2){ - var result = new Flog.RayTracer.Color(0,0,0); - - result.red = c1.red + c2.red; - result.green = c1.green + c2.green; - result.blue = c1.blue + c2.blue; - - return result; - }, - - addScalar: function(c1, s){ - var result = new Flog.RayTracer.Color(0,0,0); - - result.red = c1.red + s; - result.green = c1.green + s; - result.blue = c1.blue + s; - - result.limit(); - - return result; - }, - - subtract: function(c1, c2){ - var result = new Flog.RayTracer.Color(0,0,0); - - result.red = c1.red - c2.red; - result.green = c1.green - c2.green; - result.blue = c1.blue - c2.blue; - - return result; - }, - - multiply : function(c1, c2) { - var result = new Flog.RayTracer.Color(0,0,0); - - result.red = c1.red * c2.red; - result.green = c1.green * c2.green; - result.blue = c1.blue * c2.blue; - - return result; - }, - - multiplyScalar : function(c1, f) { - var result = new Flog.RayTracer.Color(0,0,0); - - result.red = c1.red * f; - result.green = c1.green * f; - result.blue = c1.blue * f; - - return result; - }, - - divideFactor : function(c1, f) { - var result = new Flog.RayTracer.Color(0,0,0); - - result.red = c1.red / f; - result.green = c1.green / f; - result.blue = c1.blue / f; - - return result; - }, - - limit: function(){ - this.red = (this.red > 0.0) ? ( (this.red > 1.0) ? 1.0 : this.red ) : 0.0; - this.green = (this.green > 0.0) ? ( (this.green > 1.0) ? 1.0 : this.green ) : 0.0; - this.blue = (this.blue > 0.0) ? ( (this.blue > 1.0) ? 1.0 : this.blue ) : 0.0; - }, - - distance : function(color) { - var d = Math.abs(this.red - color.red) + Math.abs(this.green - color.green) + Math.abs(this.blue - color.blue); - return d; - }, - - blend: function(c1, c2, w){ - var result = new Flog.RayTracer.Color(0,0,0); - result = Flog.RayTracer.Color.prototype.add( - Flog.RayTracer.Color.prototype.multiplyScalar(c1, 1 - w), - Flog.RayTracer.Color.prototype.multiplyScalar(c2, w) - ); - return result; - }, - - brightness : function() { - var r = Math.floor(this.red*255); - var g = Math.floor(this.green*255); - var b = Math.floor(this.blue*255); - return (r * 77 + g * 150 + b * 29) >> 8; - }, - - toString : function () { - var r = Math.floor(this.red*255); - var g = Math.floor(this.green*255); - var b = Math.floor(this.blue*255); - - return "rgb("+ r +","+ g +","+ b +")"; - } -} -/* Fake a Flog.* namespace */ -if(typeof(Flog) == 'undefined') var Flog = {}; -if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; - -Flog.RayTracer.Light = Class.create(); - -Flog.RayTracer.Light.prototype = { - position: null, - color: null, - intensity: 10.0, - - initialize : function(pos, color, intensity) { - this.position = pos; - this.color = color; - this.intensity = (intensity ? intensity : 10.0); - }, - - toString : function () { - return 'Light [' + this.position.x + ',' + this.position.y + ',' + this.position.z + ']'; - } -} -/* Fake a Flog.* namespace */ -if(typeof(Flog) == 'undefined') var Flog = {}; -if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; - -Flog.RayTracer.Vector = Class.create(); - -Flog.RayTracer.Vector.prototype = { - x : 0.0, - y : 0.0, - z : 0.0, - - initialize : function(x, y, z) { - this.x = (x ? x : 0); - this.y = (y ? y : 0); - this.z = (z ? z : 0); - }, - - copy: function(vector){ - this.x = vector.x; - this.y = vector.y; - this.z = vector.z; - }, - - normalize : function() { - var m = this.magnitude(); - return new Flog.RayTracer.Vector(this.x / m, this.y / m, this.z / m); - }, - - magnitude : function() { - return Math.sqrt((this.x * this.x) + (this.y * this.y) + (this.z * this.z)); - }, - - cross : function(w) { - return new Flog.RayTracer.Vector( - -this.z * w.y + this.y * w.z, - this.z * w.x - this.x * w.z, - -this.y * w.x + this.x * w.y); - }, - - dot : function(w) { - return this.x * w.x + this.y * w.y + this.z * w.z; - }, - - add : function(v, w) { - return new Flog.RayTracer.Vector(w.x + v.x, w.y + v.y, w.z + v.z); - }, - - subtract : function(v, w) { - if(!w || !v) throw 'Vectors must be defined [' + v + ',' + w + ']'; - return new Flog.RayTracer.Vector(v.x - w.x, v.y - w.y, v.z - w.z); - }, - - multiplyVector : function(v, w) { - return new Flog.RayTracer.Vector(v.x * w.x, v.y * w.y, v.z * w.z); - }, - - multiplyScalar : function(v, w) { - return new Flog.RayTracer.Vector(v.x * w, v.y * w, v.z * w); - }, - - toString : function () { - return 'Vector [' + this.x + ',' + this.y + ',' + this.z + ']'; - } -} -/* Fake a Flog.* namespace */ -if(typeof(Flog) == 'undefined') var Flog = {}; -if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; - -Flog.RayTracer.Ray = Class.create(); - -Flog.RayTracer.Ray.prototype = { - position : null, - direction : null, - initialize : function(pos, dir) { - this.position = pos; - this.direction = dir; - }, - - toString : function () { - return 'Ray [' + this.position + ',' + this.direction + ']'; - } -} -/* Fake a Flog.* namespace */ -if(typeof(Flog) == 'undefined') var Flog = {}; -if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; - -Flog.RayTracer.Scene = Class.create(); - -Flog.RayTracer.Scene.prototype = { - camera : null, - shapes : [], - lights : [], - background : null, - - initialize : function() { - this.camera = new Flog.RayTracer.Camera( - new Flog.RayTracer.Vector(0,0,-5), - new Flog.RayTracer.Vector(0,0,1), - new Flog.RayTracer.Vector(0,1,0) - ); - this.shapes = new Array(); - this.lights = new Array(); - this.background = new Flog.RayTracer.Background(new Flog.RayTracer.Color(0,0,0.5), 0.2); - } -} -/* Fake a Flog.* namespace */ -if(typeof(Flog) == 'undefined') var Flog = {}; -if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; -if(typeof(Flog.RayTracer.Material) == 'undefined') Flog.RayTracer.Material = {}; - -Flog.RayTracer.Material.BaseMaterial = Class.create(); - -Flog.RayTracer.Material.BaseMaterial.prototype = { - - gloss: 2.0, // [0...infinity] 0 = matt - transparency: 0.0, // 0=opaque - reflection: 0.0, // [0...infinity] 0 = no reflection - refraction: 0.50, - hasTexture: false, - - initialize : function() { - - }, - - getColor: function(u, v){ - - }, - - wrapUp: function(t){ - t = t % 2.0; - if(t < -1) t += 2.0; - if(t >= 1) t -= 2.0; - return t; - }, - - toString : function () { - return 'Material [gloss=' + this.gloss + ', transparency=' + this.transparency + ', hasTexture=' + this.hasTexture +']'; - } -} -/* Fake a Flog.* namespace */ -if(typeof(Flog) == 'undefined') var Flog = {}; -if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; - -Flog.RayTracer.Material.Solid = Class.create(); - -Flog.RayTracer.Material.Solid.prototype = Object.extend( - new Flog.RayTracer.Material.BaseMaterial(), { - initialize : function(color, reflection, refraction, transparency, gloss) { - this.color = color; - this.reflection = reflection; - this.transparency = transparency; - this.gloss = gloss; - this.hasTexture = false; - }, - - getColor: function(u, v){ - return this.color; - }, - - toString : function () { - return 'SolidMaterial [gloss=' + this.gloss + ', transparency=' + this.transparency + ', hasTexture=' + this.hasTexture +']'; - } - } -); -/* Fake a Flog.* namespace */ -if(typeof(Flog) == 'undefined') var Flog = {}; -if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; - -Flog.RayTracer.Material.Chessboard = Class.create(); - -Flog.RayTracer.Material.Chessboard.prototype = Object.extend( - new Flog.RayTracer.Material.BaseMaterial(), { - colorEven: null, - colorOdd: null, - density: 0.5, - - initialize : function(colorEven, colorOdd, reflection, transparency, gloss, density) { - this.colorEven = colorEven; - this.colorOdd = colorOdd; - this.reflection = reflection; - this.transparency = transparency; - this.gloss = gloss; - this.density = density; - this.hasTexture = true; - }, - - getColor: function(u, v){ - var t = this.wrapUp(u * this.density) * this.wrapUp(v * this.density); - - if(t < 0.0) - return this.colorEven; - else - return this.colorOdd; - }, - - toString : function () { - return 'ChessMaterial [gloss=' + this.gloss + ', transparency=' + this.transparency + ', hasTexture=' + this.hasTexture +']'; - } - } -); -/* Fake a Flog.* namespace */ -if(typeof(Flog) == 'undefined') var Flog = {}; -if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; -if(typeof(Flog.RayTracer.Shape) == 'undefined') Flog.RayTracer.Shape = {}; - -Flog.RayTracer.Shape.Sphere = Class.create(); - -Flog.RayTracer.Shape.Sphere.prototype = { - initialize : function(pos, radius, material) { - this.radius = radius; - this.position = pos; - this.material = material; - }, - - intersect: function(ray){ - var info = new Flog.RayTracer.IntersectionInfo(); - info.shape = this; - - var dst = Flog.RayTracer.Vector.prototype.subtract(ray.position, this.position); - - var B = dst.dot(ray.direction); - var C = dst.dot(dst) - (this.radius * this.radius); - var D = (B * B) - C; - - if(D > 0){ // intersection! - info.isHit = true; - info.distance = (-B) - Math.sqrt(D); - info.position = Flog.RayTracer.Vector.prototype.add( - ray.position, - Flog.RayTracer.Vector.prototype.multiplyScalar( - ray.direction, - info.distance - ) - ); - info.normal = Flog.RayTracer.Vector.prototype.subtract( - info.position, - this.position - ).normalize(); - - info.color = this.material.getColor(0,0); - } else { - info.isHit = false; - } - return info; - }, - - toString : function () { - return 'Sphere [position=' + this.position + ', radius=' + this.radius + ']'; - } -} -/* Fake a Flog.* namespace */ -if(typeof(Flog) == 'undefined') var Flog = {}; -if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; -if(typeof(Flog.RayTracer.Shape) == 'undefined') Flog.RayTracer.Shape = {}; - -Flog.RayTracer.Shape.Plane = Class.create(); - -Flog.RayTracer.Shape.Plane.prototype = { - d: 0.0, - - initialize : function(pos, d, material) { - this.position = pos; - this.d = d; - this.material = material; - }, - - intersect: function(ray){ - var info = new Flog.RayTracer.IntersectionInfo(); - - var Vd = this.position.dot(ray.direction); - if(Vd == 0) return info; // no intersection - - var t = -(this.position.dot(ray.position) + this.d) / Vd; - if(t <= 0) return info; - - info.shape = this; - info.isHit = true; - info.position = Flog.RayTracer.Vector.prototype.add( - ray.position, - Flog.RayTracer.Vector.prototype.multiplyScalar( - ray.direction, - t - ) - ); - info.normal = this.position; - info.distance = t; - - if(this.material.hasTexture){ - var vU = new Flog.RayTracer.Vector(this.position.y, this.position.z, -this.position.x); - var vV = vU.cross(this.position); - var u = info.position.dot(vU); - var v = info.position.dot(vV); - info.color = this.material.getColor(u,v); - } else { - info.color = this.material.getColor(0,0); - } - - return info; - }, - - toString : function () { - return 'Plane [' + this.position + ', d=' + this.d + ']'; - } -} -/* Fake a Flog.* namespace */ -if(typeof(Flog) == 'undefined') var Flog = {}; -if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; - -Flog.RayTracer.IntersectionInfo = Class.create(); - -Flog.RayTracer.IntersectionInfo.prototype = { - isHit: false, - hitCount: 0, - shape: null, - position: null, - normal: null, - color: null, - distance: null, - - initialize : function() { - this.color = new Flog.RayTracer.Color(0,0,0); - }, - - toString : function () { - return 'Intersection [' + this.position + ']'; - } -} -/* Fake a Flog.* namespace */ -if(typeof(Flog) == 'undefined') var Flog = {}; -if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; - -Flog.RayTracer.Camera = Class.create(); - -Flog.RayTracer.Camera.prototype = { - position: null, - lookAt: null, - equator: null, - up: null, - screen: null, - - initialize : function(pos, lookAt, up) { - this.position = pos; - this.lookAt = lookAt; - this.up = up; - this.equator = lookAt.normalize().cross(this.up); - this.screen = Flog.RayTracer.Vector.prototype.add(this.position, this.lookAt); - }, - - getRay: function(vx, vy){ - var pos = Flog.RayTracer.Vector.prototype.subtract( - this.screen, - Flog.RayTracer.Vector.prototype.subtract( - Flog.RayTracer.Vector.prototype.multiplyScalar(this.equator, vx), - Flog.RayTracer.Vector.prototype.multiplyScalar(this.up, vy) - ) - ); - pos.y = pos.y * -1; - var dir = Flog.RayTracer.Vector.prototype.subtract( - pos, - this.position - ); - - var ray = new Flog.RayTracer.Ray(pos, dir.normalize()); - - return ray; - }, - - toString : function () { - return 'Ray []'; - } -} -/* Fake a Flog.* namespace */ -if(typeof(Flog) == 'undefined') var Flog = {}; -if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; - -Flog.RayTracer.Background = Class.create(); - -Flog.RayTracer.Background.prototype = { - color : null, - ambience : 0.0, - - initialize : function(color, ambience) { - this.color = color; - this.ambience = ambience; - } -} -/* Fake a Flog.* namespace */ -if(typeof(Flog) == 'undefined') var Flog = {}; -if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; - -Flog.RayTracer.Engine = Class.create(); - -Flog.RayTracer.Engine.prototype = { - canvas: null, /* 2d context we can render to */ - - initialize: function(options){ - this.options = Object.extend({ - canvasHeight: 100, - canvasWidth: 100, - pixelWidth: 2, - pixelHeight: 2, - renderDiffuse: false, - renderShadows: false, - renderHighlights: false, - renderReflections: false, - rayDepth: 2 - }, options || {}); - - this.options.canvasHeight /= this.options.pixelHeight; - this.options.canvasWidth /= this.options.pixelWidth; - - /* TODO: dynamically include other scripts */ - }, - - setPixel: function(x, y, color){ - var pxW, pxH; - pxW = this.options.pixelWidth; - pxH = this.options.pixelHeight; - - if (this.canvas) { - this.canvas.fillStyle = color.toString(); - this.canvas.fillRect (x * pxW, y * pxH, pxW, pxH); - } else { - if (x === y) { - checkNumber += color.brightness(); - } - // print(x * pxW, y * pxH, pxW, pxH); - } - }, - - renderScene: function(scene, canvas){ - checkNumber = 0; - /* Get canvas */ - if (canvas) { - this.canvas = canvas.getContext("2d"); - } else { - this.canvas = null; - } - - var canvasHeight = this.options.canvasHeight; - var canvasWidth = this.options.canvasWidth; - - for(var y=0; y < canvasHeight; y++){ - for(var x=0; x < canvasWidth; x++){ - var yp = y * 1.0 / canvasHeight * 2 - 1; - var xp = x * 1.0 / canvasWidth * 2 - 1; - - var ray = scene.camera.getRay(xp, yp); - - var color = this.getPixelColor(ray, scene); - - this.setPixel(x, y, color); - } - } - if (checkNumber !== 2321) { - throw new Error("Scene rendered incorrectly"); - } - }, - - getPixelColor: function(ray, scene){ - var info = this.testIntersection(ray, scene, null); - if(info.isHit){ - var color = this.rayTrace(info, ray, scene, 0); - return color; - } - return scene.background.color; - }, - - testIntersection: function(ray, scene, exclude){ - var hits = 0; - var best = new Flog.RayTracer.IntersectionInfo(); - best.distance = 2000; - - for(var i=0; i<scene.shapes.length; i++){ - var shape = scene.shapes[i]; - - if(shape != exclude){ - var info = shape.intersect(ray); - if(info.isHit && info.distance >= 0 && info.distance < best.distance){ - best = info; - hits++; - } - } - } - best.hitCount = hits; - return best; - }, - - getReflectionRay: function(P,N,V){ - var c1 = -N.dot(V); - var R1 = Flog.RayTracer.Vector.prototype.add( - Flog.RayTracer.Vector.prototype.multiplyScalar(N, 2*c1), - V - ); - return new Flog.RayTracer.Ray(P, R1); - }, - - rayTrace: function(info, ray, scene, depth){ - // Calc ambient - var color = Flog.RayTracer.Color.prototype.multiplyScalar(info.color, scene.background.ambience); - var oldColor = color; - var shininess = Math.pow(10, info.shape.material.gloss + 1); - - for(var i=0; i<scene.lights.length; i++){ - var light = scene.lights[i]; - - // Calc diffuse lighting - var v = Flog.RayTracer.Vector.prototype.subtract( - light.position, - info.position - ).normalize(); - - if(this.options.renderDiffuse){ - var L = v.dot(info.normal); - if(L > 0.0){ - color = Flog.RayTracer.Color.prototype.add( - color, - Flog.RayTracer.Color.prototype.multiply( - info.color, - Flog.RayTracer.Color.prototype.multiplyScalar( - light.color, - L - ) - ) - ); - } - } - - // The greater the depth the more accurate the colours, but - // this is exponentially (!) expensive - if(depth <= this.options.rayDepth){ - // calculate reflection ray - if(this.options.renderReflections && info.shape.material.reflection > 0) - { - var reflectionRay = this.getReflectionRay(info.position, info.normal, ray.direction); - var refl = this.testIntersection(reflectionRay, scene, info.shape); - - if (refl.isHit && refl.distance > 0){ - refl.color = this.rayTrace(refl, reflectionRay, scene, depth + 1); - } else { - refl.color = scene.background.color; - } - - color = Flog.RayTracer.Color.prototype.blend( - color, - refl.color, - info.shape.material.reflection - ); - } - - // Refraction - /* TODO */ - } - - /* Render shadows and highlights */ - - var shadowInfo = new Flog.RayTracer.IntersectionInfo(); - - if(this.options.renderShadows){ - var shadowRay = new Flog.RayTracer.Ray(info.position, v); - - shadowInfo = this.testIntersection(shadowRay, scene, info.shape); - if(shadowInfo.isHit && shadowInfo.shape != info.shape /*&& shadowInfo.shape.type != 'PLANE'*/){ - var vA = Flog.RayTracer.Color.prototype.multiplyScalar(color, 0.5); - var dB = (0.5 * Math.pow(shadowInfo.shape.material.transparency, 0.5)); - color = Flog.RayTracer.Color.prototype.addScalar(vA,dB); - } - } - - // Phong specular highlights - if(this.options.renderHighlights && !shadowInfo.isHit && info.shape.material.gloss > 0){ - var Lv = Flog.RayTracer.Vector.prototype.subtract( - info.shape.position, - light.position - ).normalize(); - - var E = Flog.RayTracer.Vector.prototype.subtract( - scene.camera.position, - info.shape.position - ).normalize(); - - var H = Flog.RayTracer.Vector.prototype.subtract( - E, - Lv - ).normalize(); - - var glossWeight = Math.pow(Math.max(info.normal.dot(H), 0), shininess); - color = Flog.RayTracer.Color.prototype.add( - Flog.RayTracer.Color.prototype.multiplyScalar(light.color, glossWeight), - color - ); - } - } - color.limit(); - return color; - } -}; - - -function renderScene(){ - var scene = new Flog.RayTracer.Scene(); - - scene.camera = new Flog.RayTracer.Camera( - new Flog.RayTracer.Vector(0, 0, -15), - new Flog.RayTracer.Vector(-0.2, 0, 5), - new Flog.RayTracer.Vector(0, 1, 0) - ); - - scene.background = new Flog.RayTracer.Background( - new Flog.RayTracer.Color(0.5, 0.5, 0.5), - 0.4 - ); - - var sphere = new Flog.RayTracer.Shape.Sphere( - new Flog.RayTracer.Vector(-1.5, 1.5, 2), - 1.5, - new Flog.RayTracer.Material.Solid( - new Flog.RayTracer.Color(0,0.5,0.5), - 0.3, - 0.0, - 0.0, - 2.0 - ) - ); - - var sphere1 = new Flog.RayTracer.Shape.Sphere( - new Flog.RayTracer.Vector(1, 0.25, 1), - 0.5, - new Flog.RayTracer.Material.Solid( - new Flog.RayTracer.Color(0.9,0.9,0.9), - 0.1, - 0.0, - 0.0, - 1.5 - ) - ); - - var plane = new Flog.RayTracer.Shape.Plane( - new Flog.RayTracer.Vector(0.1, 0.9, -0.5).normalize(), - 1.2, - new Flog.RayTracer.Material.Chessboard( - new Flog.RayTracer.Color(1,1,1), - new Flog.RayTracer.Color(0,0,0), - 0.2, - 0.0, - 1.0, - 0.7 - ) - ); - - scene.shapes.push(plane); - scene.shapes.push(sphere); - scene.shapes.push(sphere1); - - var light = new Flog.RayTracer.Light( - new Flog.RayTracer.Vector(5, 10, -1), - new Flog.RayTracer.Color(0.8, 0.8, 0.8) - ); - - var light1 = new Flog.RayTracer.Light( - new Flog.RayTracer.Vector(-3, 5, -15), - new Flog.RayTracer.Color(0.8, 0.8, 0.8), - 100 - ); - - scene.lights.push(light); - scene.lights.push(light1); - - var imageWidth = 100; // $F('imageWidth'); - var imageHeight = 100; // $F('imageHeight'); - var pixelSize = "5,5".split(','); // $F('pixelSize').split(','); - var renderDiffuse = true; // $F('renderDiffuse'); - var renderShadows = true; // $F('renderShadows'); - var renderHighlights = true; // $F('renderHighlights'); - var renderReflections = true; // $F('renderReflections'); - var rayDepth = 2;//$F('rayDepth'); - - var raytracer = new Flog.RayTracer.Engine( - { - canvasWidth: imageWidth, - canvasHeight: imageHeight, - pixelWidth: pixelSize[0], - pixelHeight: pixelSize[1], - "renderDiffuse": renderDiffuse, - "renderHighlights": renderHighlights, - "renderShadows": renderShadows, - "renderReflections": renderReflections, - "rayDepth": rayDepth - } - ); - - raytracer.renderScene(scene, null, 0); -} - -for (var i = 0; i < 6; ++i) - renderScene(); diff --git a/implementation-contributed/javascriptcore/stress/v8-regexp-strict.js b/implementation-contributed/javascriptcore/stress/v8-regexp-strict.js deleted file mode 100644 index cbb8852ae9..0000000000 --- a/implementation-contributed/javascriptcore/stress/v8-regexp-strict.js +++ /dev/null @@ -1,1615 +0,0 @@ -"use strict"; - -// Copyright 2009 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. - -// Automatically generated on 2009-01-30. - -// This benchmark is generated by loading 50 of the most popular pages -// on the web and logging all regexp operations performed. Each -// operation is given a weight that is calculated from an estimate of -// the popularity of the pages where it occurs and the number of times -// it is executed while loading each page. Finally the literal -// letters in the data are encoded using ROT13 in a way that does not -// affect how the regexps match their input. - -function runRegExpBenchmark() { - var re0 = /^ba/; - var re1 = /(((\w+):\/\/)([^\/:]*)(:(\d+))?)?([^#?]*)(\?([^#]*))?(#(.*))?/; - var re2 = /^\s*|\s*$/g; - var re3 = /\bQBZPbageby_cynprubyqre\b/; - var re4 = /,/; - var re5 = /\bQBZPbageby_cynprubyqre\b/g; - var re6 = /^[\s\xa0]+|[\s\xa0]+$/g; - var re7 = /(\d*)(\D*)/g; - var re8 = /=/; - var re9 = /(^|\s)lhv\-h(\s|$)/; - var str0 = 'Zbmvyyn/5.0 (Jvaqbjf; H; Jvaqbjf AG 5.1; ra-HF) NccyrJroXvg/528.9 (XUGZY, yvxr Trpxb) Puebzr/2.0.157.0 Fnsnev/528.9'; - var re10 = /\#/g; - var re11 = /\./g; - var re12 = /'/g; - var re13 = /\?[\w\W]*(sevraqvq|punaaryvq|tebhcvq)=([^\&\?#]*)/i; - var str1 = 'Fubpxjnir Synfu 9.0 e115'; - var re14 = /\s+/g; - var re15 = /^\s*(\S*(\s+\S+)*)\s*$/; - var re16 = /(-[a-z])/i; - function runBlock0() { - for (var i = 0; i < 6511; i++) { - re0.exec('pyvpx'); - } - for (var i = 0; i < 1844; i++) { - re1.exec('uggc://jjj.snprobbx.pbz/ybtva.cuc'); - } - for (var i = 0; i < 739; i++) { - 'QBZPbageby_cynprubyqre'.replace(re2, ''); - } - for (var i = 0; i < 598; i++) { - re1.exec('uggc://jjj.snprobbx.pbz/'); - } - for (var i = 0; i < 454; i++) { - re1.exec('uggc://jjj.snprobbx.pbz/fepu.cuc'); - } - for (var i = 0; i < 352; i++) { - /qqqq|qqq|qq|q|ZZZZ|ZZZ|ZZ|Z|llll|ll|l|uu|u|UU|U|zz|z|ff|f|gg|g|sss|ss|s|mmm|mm|m/g.exec('qqqq, ZZZ q, llll'); - } - for (var i = 0; i < 312; i++) { - re3.exec('vachggrkg QBZPbageby_cynprubyqre'); - } - for (var i = 0; i < 282; i++) { - re4.exec('/ZlFcnprUbzrcntr/Vaqrk-FvgrUbzr,10000000'); - } - for (var i = 0; i < 177; i++) { - 'vachggrkg'.replace(re5, ''); - } - for (var i = 0; i < 170; i++) { - '528.9'.replace(re6, ''); - re7.exec('528'); - } - for (var i = 0; i < 156; i++) { - re8.exec('VCPhygher=ra-HF'); - re8.exec('CersreerqPhygher=ra-HF'); - } - for (var i = 0; i < 144; i++) { - re0.exec('xrlcerff'); - } - for (var i = 0; i < 139; i++) { - '521'.replace(re6, ''); - re7.exec('521'); - re9.exec(''); - /JroXvg\/(\S+)/.exec(str0); - } - for (var i = 0; i < 137; i++) { - 'qvi .so_zrah'.replace(re10, ''); - 'qvi .so_zrah'.replace(/\[/g, ''); - 'qvi.so_zrah'.replace(re11, ''); - } - for (var i = 0; i < 117; i++) { - 'uvqqra_ryrz'.replace(re2, ''); - } - for (var i = 0; i < 95; i++) { - /(?:^|;)\s*sevraqfgre_ynat=([^;]*)/.exec('sevraqfgre_naba=nvq%3Qn6ss9p85n868ro9s059pn854735956o3%26ers%3Q%26df%3Q%26vpgl%3QHF'); - } - for (var i = 0; i < 93; i++) { - 'uggc://ubzr.zlfcnpr.pbz/vaqrk.psz'.replace(re12, ''); - re13.exec('uggc://ubzr.zlfcnpr.pbz/vaqrk.psz'); - } - for (var i = 0; i < 92; i++) { - str1.replace(/([a-zA-Z]|\s)+/, ''); - } - for (var i = 0; i < 85; i++) { - 'svefg'.replace(re14, ''); - 'svefg'.replace(re15, ''); - 'uggc://cebsvyr.zlfcnpr.pbz/vaqrk.psz'.replace(re12, ''); - 'ynfg'.replace(re14, ''); - 'ynfg'.replace(re15, ''); - re16.exec('qvfcynl'); - re13.exec('uggc://cebsvyr.zlfcnpr.pbz/vaqrk.psz'); - } - } - var re17 = /(^|[^\\])\"\\\/Qngr\((-?[0-9]+)\)\\\/\"/g; - var str2 = '{"anzr":"","ahzoreSbezng":{"PheeraplQrpvznyQvtvgf":2,"PheeraplQrpvznyFrcnengbe":".","VfErnqBayl":gehr,"PheeraplTebhcFvmrf":[3],"AhzoreTebhcFvmrf":[3],"CrepragTebhcFvmrf":[3],"PheeraplTebhcFrcnengbe":",","PheeraplFlzoby":"\xa4","AnAFlzoby":"AnA","PheeraplArtngvirCnggrea":0,"AhzoreArtngvirCnggrea":1,"CrepragCbfvgvirCnggrea":0,"CrepragArtngvirCnggrea":0,"ArtngvirVasvavglFlzoby":"-Vasvavgl","ArtngvirFvta":"-","AhzoreQrpvznyQvtvgf":2,"AhzoreQrpvznyFrcnengbe":".","AhzoreTebhcFrcnengbe":",","PheeraplCbfvgvirCnggrea":0,"CbfvgvirVasvavglFlzoby":"Vasvavgl","CbfvgvirFvta":"+","CrepragQrpvznyQvtvgf":2,"CrepragQrpvznyFrcnengbe":".","CrepragTebhcFrcnengbe":",","CrepragFlzoby":"%","CreZvyyrFlzoby":"\u2030","AngvirQvtvgf":["0","1","2","3","4","5","6","7","8","9"],"QvtvgFhofgvghgvba":1},"qngrGvzrSbezng":{"NZQrfvtangbe":"NZ","Pnyraqne":{"ZvaFhccbegrqQngrGvzr":"@-62135568000000@","ZnkFhccbegrqQngrGvzr":"@253402300799999@","NytbevguzGlcr":1,"PnyraqneGlcr":1,"Renf":[1],"GjbQvtvgLrneZnk":2029,"VfErnqBayl":gehr},"QngrFrcnengbe":"/","SvefgQnlBsJrrx":0,"PnyraqneJrrxEhyr":0,"ShyyQngrGvzrCnggrea":"qqqq, qq ZZZZ llll UU:zz:ff","YbatQngrCnggrea":"qqqq, qq ZZZZ llll","YbatGvzrCnggrea":"UU:zz:ff","ZbaguQnlCnggrea":"ZZZZ qq","CZQrfvtangbe":"CZ","ESP1123Cnggrea":"qqq, qq ZZZ llll UU\':\'zz\':\'ff \'TZG\'","FubegQngrCnggrea":"ZZ/qq/llll","FubegGvzrCnggrea":"UU:zz","FbegnoyrQngrGvzrCnggrea":"llll\'-\'ZZ\'-\'qq\'G\'UU\':\'zz\':\'ff","GvzrFrcnengbe":":","HavirefnyFbegnoyrQngrGvzrCnggrea":"llll\'-\'ZZ\'-\'qq UU\':\'zz\':\'ff\'M\'","LrneZbaguCnggrea":"llll ZZZZ","NooerivngrqQnlAnzrf":["Fha","Zba","Ghr","Jrq","Guh","Sev","Fng"],"FubegrfgQnlAnzrf":["Fh","Zb","Gh","Jr","Gu","Se","Fn"],"QnlAnzrf":["Fhaqnl","Zbaqnl","Ghrfqnl","Jrqarfqnl","Guhefqnl","Sevqnl","Fngheqnl"],"NooerivngrqZbaguAnzrf":["Wna","Sro","Zne","Nce","Znl","Wha","Why","Nht","Frc","Bpg","Abi","Qrp",""],"ZbaguAnzrf":["Wnahnel","Sroehnel","Znepu","Ncevy","Znl","Whar","Whyl","Nhthfg","Frcgrzore","Bpgbore","Abirzore","Qrprzore",""],"VfErnqBayl":gehr,"AngvirPnyraqneAnzr":"Tertbevna Pnyraqne","NooerivngrqZbaguTravgvirAnzrf":["Wna","Sro","Zne","Nce","Znl","Wha","Why","Nht","Frc","Bpg","Abi","Qrp",""],"ZbaguTravgvirAnzrf":["Wnahnel","Sroehnel","Znepu","Ncevy","Znl","Whar","Whyl","Nhthfg","Frcgrzore","Bpgbore","Abirzore","Qrprzore",""]}}'; - var str3 = '{"anzr":"ra-HF","ahzoreSbezng":{"PheeraplQrpvznyQvtvgf":2,"PheeraplQrpvznyFrcnengbe":".","VfErnqBayl":snyfr,"PheeraplTebhcFvmrf":[3],"AhzoreTebhcFvmrf":[3],"CrepragTebhcFvmrf":[3],"PheeraplTebhcFrcnengbe":",","PheeraplFlzoby":"$","AnAFlzoby":"AnA","PheeraplArtngvirCnggrea":0,"AhzoreArtngvirCnggrea":1,"CrepragCbfvgvirCnggrea":0,"CrepragArtngvirCnggrea":0,"ArtngvirVasvavglFlzoby":"-Vasvavgl","ArtngvirFvta":"-","AhzoreQrpvznyQvtvgf":2,"AhzoreQrpvznyFrcnengbe":".","AhzoreTebhcFrcnengbe":",","PheeraplCbfvgvirCnggrea":0,"CbfvgvirVasvavglFlzoby":"Vasvavgl","CbfvgvirFvta":"+","CrepragQrpvznyQvtvgf":2,"CrepragQrpvznyFrcnengbe":".","CrepragTebhcFrcnengbe":",","CrepragFlzoby":"%","CreZvyyrFlzoby":"\u2030","AngvirQvtvgf":["0","1","2","3","4","5","6","7","8","9"],"QvtvgFhofgvghgvba":1},"qngrGvzrSbezng":{"NZQrfvtangbe":"NZ","Pnyraqne":{"ZvaFhccbegrqQngrGvzr":"@-62135568000000@","ZnkFhccbegrqQngrGvzr":"@253402300799999@","NytbevguzGlcr":1,"PnyraqneGlcr":1,"Renf":[1],"GjbQvtvgLrneZnk":2029,"VfErnqBayl":snyfr},"QngrFrcnengbe":"/","SvefgQnlBsJrrx":0,"PnyraqneJrrxEhyr":0,"ShyyQngrGvzrCnggrea":"qqqq, ZZZZ qq, llll u:zz:ff gg","YbatQngrCnggrea":"qqqq, ZZZZ qq, llll","YbatGvzrCnggrea":"u:zz:ff gg","ZbaguQnlCnggrea":"ZZZZ qq","CZQrfvtangbe":"CZ","ESP1123Cnggrea":"qqq, qq ZZZ llll UU\':\'zz\':\'ff \'TZG\'","FubegQngrCnggrea":"Z/q/llll","FubegGvzrCnggrea":"u:zz gg","FbegnoyrQngrGvzrCnggrea":"llll\'-\'ZZ\'-\'qq\'G\'UU\':\'zz\':\'ff","GvzrFrcnengbe":":","HavirefnyFbegnoyrQngrGvzrCnggrea":"llll\'-\'ZZ\'-\'qq UU\':\'zz\':\'ff\'M\'","LrneZbaguCnggrea":"ZZZZ, llll","NooerivngrqQnlAnzrf":["Fha","Zba","Ghr","Jrq","Guh","Sev","Fng"],"FubegrfgQnlAnzrf":["Fh","Zb","Gh","Jr","Gu","Se","Fn"],"QnlAnzrf":["Fhaqnl","Zbaqnl","Ghrfqnl","Jrqarfqnl","Guhefqnl","Sevqnl","Fngheqnl"],"NooerivngrqZbaguAnzrf":["Wna","Sro","Zne","Nce","Znl","Wha","Why","Nht","Frc","Bpg","Abi","Qrp",""],"ZbaguAnzrf":["Wnahnel","Sroehnel","Znepu","Ncevy","Znl","Whar","Whyl","Nhthfg","Frcgrzore","Bpgbore","Abirzore","Qrprzore",""],"VfErnqBayl":snyfr,"AngvirPnyraqneAnzr":"Tertbevna Pnyraqne","NooerivngrqZbaguTravgvirAnzrf":["Wna","Sro","Zne","Nce","Znl","Wha","Why","Nht","Frc","Bpg","Abi","Qrp",""],"ZbaguTravgvirAnzrf":["Wnahnel","Sroehnel","Znepu","Ncevy","Znl","Whar","Whyl","Nhthfg","Frcgrzore","Bpgbore","Abirzore","Qrprzore",""]}}'; - var str4 = 'HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str5 = 'HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; - var re18 = /^\s+|\s+$/g; - var str6 = 'uggc://jjj.snprobbx.pbz/vaqrk.cuc'; - var re19 = /(?:^|\s+)ba(?:\s+|$)/; - var re20 = /[+, ]/; - var re21 = /ybnqrq|pbzcyrgr/; - var str7 = ';;jvaqbj.IjPurpxZbhfrCbfvgvbaNQ_VQ=shapgvba(r){vs(!r)ine r=jvaqbj.rirag;ine c=-1;vs(d1)c=d1.EbyybssCnary;ine bo=IjTrgBow("IjCnayNQ_VQ_"+c);vs(bo&&bo.fglyr.ivfvovyvgl=="ivfvoyr"){ine fns=IjFns?8:0;ine pheK=r.pyvragK+IjBOFpe("U")+fns,pheL=r.pyvragL+IjBOFpe("I")+fns;ine y=IjBOEC(NQ_VQ,bo,"Y"),g=IjBOEC(NQ_VQ,bo,"G");ine e=y+d1.Cnaryf[c].Jvqgu,o=g+d1.Cnaryf[c].Urvtug;vs((pheK<y)||(pheK>e)||(pheL<g)||(pheL>o)){vs(jvaqbj.IjBaEbyybssNQ_VQ)IjBaEbyybssNQ_VQ(c);ryfr IjPybfrNq(NQ_VQ,c,gehr,"");}ryfr erghea;}IjPnapryZbhfrYvfgrareNQ_VQ();};;jvaqbj.IjFrgEbyybssCnaryNQ_VQ=shapgvba(c){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;c=IjTc(NQ_VQ,c);vs(d1&&d1.EbyybssCnary>-1)IjPnapryZbhfrYvfgrareNQ_VQ();vs(d1)d1.EbyybssCnary=c;gel{vs(q.nqqRiragYvfgrare)q.nqqRiragYvfgrare(z,s,snyfr);ryfr vs(q.nggnpuRirag)q.nggnpuRirag("ba"+z,s);}pngpu(r){}};;jvaqbj.IjPnapryZbhfrYvfgrareNQ_VQ=shapgvba(){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;vs(d1)d1.EbyybssCnary=-1;gel{vs(q.erzbirRiragYvfgrare)q.erzbirRiragYvfgrare(z,s,snyfr);ryfr vs(q.qrgnpuRirag)q.qrgnpuRirag("ba"+z,s);}pngpu(r){}};;d1.IjTc=d2(n,c){ine nq=d1;vs(vfAnA(c)){sbe(ine v=0;v<nq.Cnaryf.yratgu;v++)vs(nq.Cnaryf[v].Anzr==c)erghea v;erghea 0;}erghea c;};;d1.IjTpy=d2(n,c,p){ine cn=d1.Cnaryf[IjTc(n,c)];vs(!cn)erghea 0;vs(vfAnA(p)){sbe(ine v=0;v<cn.Pyvpxguehf.yratgu;v++)vs(cn.Pyvpxguehf[v].Anzr==p)erghea v;erghea 0;}erghea p;};;d1.IjGenpr=d2(n,f){gel{vs(jvaqbj["Ij"+"QtQ"])jvaqbj["Ij"+"QtQ"](n,1,f);}pngpu(r){}};;d1.IjYvzvg1=d2(n,f){ine nq=d1,vh=f.fcyvg("/");sbe(ine v=0,p=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.FzV.yratgu>0)nq.FzV+="/";nq.FzV+=vh[v];nq.FtZ[nq.FtZ.yratgu]=snyfr;}}};;d1.IjYvzvg0=d2(n,f){ine nq=d1,vh=f.fcyvg("/");sbe(ine v=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.OvC.yratgu>0)nq.OvC+="/";nq.OvC+=vh[v];}}};;d1.IjRVST=d2(n,c){jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]=IjTrgBow("IjCnayNQ_VQ_"+c+"_Bow");vs(jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]==ahyy)frgGvzrbhg("IjRVST(NQ_VQ,"+c+")",d1.rvsg);};;d1.IjNavzSHC=d2(n,c){ine nq=d1;vs(c>nq.Cnaryf.yratgu)erghea;ine cna=nq.Cnaryf[c],nn=gehr,on=gehr,yn=gehr,en=gehr,cn=nq.Cnaryf[0],sf=nq.ShF,j=cn.Jvqgu,u=cn.Urvtug;vs(j=="100%"){j=sf;en=snyfr;yn=snyfr;}vs(u=="100%"){u=sf;nn=snyfr;on=snyfr;}vs(cn.YnY=="Y")yn=snyfr;vs(cn.YnY=="E")en=snyfr;vs(cn.GnY=="G")nn=snyfr;vs(cn.GnY=="O")on=snyfr;ine k=0,l=0;fjvgpu(nq.NshP%8){pnfr 0:oernx;pnfr 1:vs(nn)l=-sf;oernx;pnfr 2:k=j-sf;oernx;pnfr 3:vs(en)k=j;oernx;pnfr 4:k=j-sf;l=u-sf;oernx;pnfr 5:k=j-sf;vs(on)l=u;oernx;pnfr 6:l=u-sf;oernx;pnfr 7:vs(yn)k=-sf;l=u-sf;oernx;}vs(nq.NshP++ <nq.NshG)frgGvzrbhg(("IjNavzSHC(NQ_VQ,"+c+")"),nq.NshC);ryfr{k=-1000;l=k;}cna.YrsgBssfrg=k;cna.GbcBssfrg=l;IjNhErcb(n,c);};;d1.IjTrgErnyCbfvgvba=d2(n,b,j){erghea IjBOEC.nccyl(guvf,nethzragf);};;d1.IjPnapryGvzrbhg=d2(n,c){c=IjTc(n,c);ine cay=d1.Cnaryf[c];vs(cay&&cay.UgU!=""){pyrneGvzrbhg(cay.UgU);}};;d1.IjPnapryNyyGvzrbhgf=d2(n){vs(d1.YbpxGvzrbhgPunatrf)erghea;sbe(ine c=0;c<d1.bac;c++)IjPnapryGvzrbhg(n,c);};;d1.IjFgnegGvzrbhg=d2(n,c,bG){c=IjTc(n,c);ine cay=d1.Cnaryf[c];vs(cay&&((cay.UvqrGvzrbhgInyhr>0)||(nethzragf.yratgu==3&&bG>0))){pyrneGvzrbhg(cay.UgU);cay.UgU=frgGvzrbhg(cay.UvqrNpgvba,(nethzragf.yratgu==3?bG:cay.UvqrGvzrbhgInyhr));}};;d1.IjErfrgGvzrbhg=d2(n,c,bG){c=IjTc(n,c);IjPnapryGvzrbhg(n,c);riny("IjFgnegGvzrbhg(NQ_VQ,c"+(nethzragf.yratgu==3?",bG":"")+")");};;d1.IjErfrgNyyGvzrbhgf=d2(n){sbe(ine c=0;c<d1.bac;c++)IjErfrgGvzrbhg(n,c);};;d1.IjQrgnpure=d2(n,rig,sap){gel{vs(IjQVR5)riny("jvaqbj.qrgnpuRirag(\'ba"+rig+"\',"+sap+"NQ_VQ)");ryfr vs(!IjQVRZnp)riny("jvaqbj.erzbirRiragYvfgrare(\'"+rig+"\',"+sap+"NQ_VQ,snyfr)");}pngpu(r){}};;d1.IjPyrnaHc=d2(n){IjCvat(n,"G");ine nq=d1;sbe(ine v=0;v<nq.Cnaryf.yratgu;v++){IjUvqrCnary(n,v,gehr);}gel{IjTrgBow(nq.gya).vaareUGZY="";}pngpu(r){}vs(nq.gya!=nq.gya2)gel{IjTrgBow(nq.gya2).vaareUGZY="";}pngpu(r){}gel{d1=ahyy;}pngpu(r){}gel{IjQrgnpure(n,"haybnq","IjHayNQ_VQ");}pngpu(r){}gel{jvaqbj.IjHayNQ_VQ=ahyy;}pngpu(r){}gel{IjQrgnpure(n,"fpebyy","IjFeNQ_VQ");}pngpu(r){}gel{jvaqbj.IjFeNQ_VQ=ahyy;}pngpu(r){}gel{IjQrgnpure(n,"erfvmr","IjEmNQ_VQ");}pngpu(r){}gel{jvaqbj.IjEmNQ_VQ=ahyy;}pngpu(r){}gel{IjQrgnpure(n'; - var str8 = ';;jvaqbj.IjPurpxZbhfrCbfvgvbaNQ_VQ=shapgvba(r){vs(!r)ine r=jvaqbj.rirag;ine c=-1;vs(jvaqbj.IjNqNQ_VQ)c=jvaqbj.IjNqNQ_VQ.EbyybssCnary;ine bo=IjTrgBow("IjCnayNQ_VQ_"+c);vs(bo&&bo.fglyr.ivfvovyvgl=="ivfvoyr"){ine fns=IjFns?8:0;ine pheK=r.pyvragK+IjBOFpe("U")+fns,pheL=r.pyvragL+IjBOFpe("I")+fns;ine y=IjBOEC(NQ_VQ,bo,"Y"),g=IjBOEC(NQ_VQ,bo,"G");ine e=y+jvaqbj.IjNqNQ_VQ.Cnaryf[c].Jvqgu,o=g+jvaqbj.IjNqNQ_VQ.Cnaryf[c].Urvtug;vs((pheK<y)||(pheK>e)||(pheL<g)||(pheL>o)){vs(jvaqbj.IjBaEbyybssNQ_VQ)IjBaEbyybssNQ_VQ(c);ryfr IjPybfrNq(NQ_VQ,c,gehr,"");}ryfr erghea;}IjPnapryZbhfrYvfgrareNQ_VQ();};;jvaqbj.IjFrgEbyybssCnaryNQ_VQ=shapgvba(c){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;c=IjTc(NQ_VQ,c);vs(jvaqbj.IjNqNQ_VQ&&jvaqbj.IjNqNQ_VQ.EbyybssCnary>-1)IjPnapryZbhfrYvfgrareNQ_VQ();vs(jvaqbj.IjNqNQ_VQ)jvaqbj.IjNqNQ_VQ.EbyybssCnary=c;gel{vs(q.nqqRiragYvfgrare)q.nqqRiragYvfgrare(z,s,snyfr);ryfr vs(q.nggnpuRirag)q.nggnpuRirag("ba"+z,s);}pngpu(r){}};;jvaqbj.IjPnapryZbhfrYvfgrareNQ_VQ=shapgvba(){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;vs(jvaqbj.IjNqNQ_VQ)jvaqbj.IjNqNQ_VQ.EbyybssCnary=-1;gel{vs(q.erzbirRiragYvfgrare)q.erzbirRiragYvfgrare(z,s,snyfr);ryfr vs(q.qrgnpuRirag)q.qrgnpuRirag("ba"+z,s);}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjTc=shapgvba(n,c){ine nq=jvaqbj.IjNqNQ_VQ;vs(vfAnA(c)){sbe(ine v=0;v<nq.Cnaryf.yratgu;v++)vs(nq.Cnaryf[v].Anzr==c)erghea v;erghea 0;}erghea c;};;jvaqbj.IjNqNQ_VQ.IjTpy=shapgvba(n,c,p){ine cn=jvaqbj.IjNqNQ_VQ.Cnaryf[IjTc(n,c)];vs(!cn)erghea 0;vs(vfAnA(p)){sbe(ine v=0;v<cn.Pyvpxguehf.yratgu;v++)vs(cn.Pyvpxguehf[v].Anzr==p)erghea v;erghea 0;}erghea p;};;jvaqbj.IjNqNQ_VQ.IjGenpr=shapgvba(n,f){gel{vs(jvaqbj["Ij"+"QtQ"])jvaqbj["Ij"+"QtQ"](n,1,f);}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjYvzvg1=shapgvba(n,f){ine nq=jvaqbj.IjNqNQ_VQ,vh=f.fcyvg("/");sbe(ine v=0,p=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.FzV.yratgu>0)nq.FzV+="/";nq.FzV+=vh[v];nq.FtZ[nq.FtZ.yratgu]=snyfr;}}};;jvaqbj.IjNqNQ_VQ.IjYvzvg0=shapgvba(n,f){ine nq=jvaqbj.IjNqNQ_VQ,vh=f.fcyvg("/");sbe(ine v=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.OvC.yratgu>0)nq.OvC+="/";nq.OvC+=vh[v];}}};;jvaqbj.IjNqNQ_VQ.IjRVST=shapgvba(n,c){jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]=IjTrgBow("IjCnayNQ_VQ_"+c+"_Bow");vs(jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]==ahyy)frgGvzrbhg("IjRVST(NQ_VQ,"+c+")",jvaqbj.IjNqNQ_VQ.rvsg);};;jvaqbj.IjNqNQ_VQ.IjNavzSHC=shapgvba(n,c){ine nq=jvaqbj.IjNqNQ_VQ;vs(c>nq.Cnaryf.yratgu)erghea;ine cna=nq.Cnaryf[c],nn=gehr,on=gehr,yn=gehr,en=gehr,cn=nq.Cnaryf[0],sf=nq.ShF,j=cn.Jvqgu,u=cn.Urvtug;vs(j=="100%"){j=sf;en=snyfr;yn=snyfr;}vs(u=="100%"){u=sf;nn=snyfr;on=snyfr;}vs(cn.YnY=="Y")yn=snyfr;vs(cn.YnY=="E")en=snyfr;vs(cn.GnY=="G")nn=snyfr;vs(cn.GnY=="O")on=snyfr;ine k=0,l=0;fjvgpu(nq.NshP%8){pnfr 0:oernx;pnfr 1:vs(nn)l=-sf;oernx;pnfr 2:k=j-sf;oernx;pnfr 3:vs(en)k=j;oernx;pnfr 4:k=j-sf;l=u-sf;oernx;pnfr 5:k=j-sf;vs(on)l=u;oernx;pnfr 6:l=u-sf;oernx;pnfr 7:vs(yn)k=-sf;l=u-sf;oernx;}vs(nq.NshP++ <nq.NshG)frgGvzrbhg(("IjNavzSHC(NQ_VQ,"+c+")"),nq.NshC);ryfr{k=-1000;l=k;}cna.YrsgBssfrg=k;cna.GbcBssfrg=l;IjNhErcb(n,c);};;jvaqbj.IjNqNQ_VQ.IjTrgErnyCbfvgvba=shapgvba(n,b,j){erghea IjBOEC.nccyl(guvf,nethzragf);};;jvaqbj.IjNqNQ_VQ.IjPnapryGvzrbhg=shapgvba(n,c){c=IjTc(n,c);ine cay=jvaqbj.IjNqNQ_VQ.Cnaryf[c];vs(cay&&cay.UgU!=""){pyrneGvzrbhg(cay.UgU);}};;jvaqbj.IjNqNQ_VQ.IjPnapryNyyGvzrbhgf=shapgvba(n){vs(jvaqbj.IjNqNQ_VQ.YbpxGvzrbhgPunatrf)erghea;sbe(ine c=0;c<jvaqbj.IjNqNQ_VQ.bac;c++)IjPnapryGvzrbhg(n,c);};;jvaqbj.IjNqNQ_VQ.IjFgnegGvzrbhg=shapgvba(n,c,bG){c=IjTc(n,c);ine cay=jvaqbj.IjNqNQ_VQ.Cnaryf[c];vs(cay&&((cay.UvqrGvzrbhgInyhr>0)||(nethzragf.yratgu==3&&bG>0))){pyrneGvzrbhg(cay.UgU);cay.UgU=frgGvzrbhg(cay.UvqrNpgvba,(nethzragf.yratgu==3?bG:cay.UvqrGvzrbhgInyhr));}};;jvaqbj.IjNqNQ_VQ.IjErfrgGvzrbhg=shapgvba(n,c,bG){c=IjTc(n,c);IjPnapryGvzrbhg(n,c);riny("IjFgnegGvzrbhg(NQ_VQ,c"+(nethzragf.yratgu==3?",bG":"")+")");};;jvaqbj.IjNqNQ_VQ.IjErfrgNyyGvzrbhgf=shapgvba(n){sbe(ine c=0;c<jvaqbj.IjNqNQ_VQ.bac;c++)IjErfrgGvzrbhg(n,c);};;jvaqbj.IjNqNQ_VQ.IjQrgnpure=shapgvba(n,rig,sap){gel{vs(IjQVR5)riny("jvaqbj.qrgnpuRirag(\'ba"+rig+"\',"+sap+"NQ_VQ)");ryfr vs(!IjQVRZnp)riny("jvaqbj.erzbir'; - var str9 = ';;jvaqbj.IjPurpxZbhfrCbfvgvbaNQ_VQ=shapgvba(r){vs(!r)ine r=jvaqbj.rirag;ine c=-1;vs(jvaqbj.IjNqNQ_VQ)c=jvaqbj.IjNqNQ_VQ.EbyybssCnary;ine bo=IjTrgBow("IjCnayNQ_VQ_"+c);vs(bo&&bo.fglyr.ivfvovyvgl=="ivfvoyr"){ine fns=IjFns?8:0;ine pheK=r.pyvragK+IjBOFpe("U")+fns,pheL=r.pyvragL+IjBOFpe("I")+fns;ine y=IjBOEC(NQ_VQ,bo,"Y"),g=IjBOEC(NQ_VQ,bo,"G");ine e=y+jvaqbj.IjNqNQ_VQ.Cnaryf[c].Jvqgu,o=g+jvaqbj.IjNqNQ_VQ.Cnaryf[c].Urvtug;vs((pheK<y)||(pheK>e)||(pheL<g)||(pheL>o)){vs(jvaqbj.IjBaEbyybssNQ_VQ)IjBaEbyybssNQ_VQ(c);ryfr IjPybfrNq(NQ_VQ,c,gehr,"");}ryfr erghea;}IjPnapryZbhfrYvfgrareNQ_VQ();};;jvaqbj.IjFrgEbyybssCnaryNQ_VQ=shapgvba(c){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;c=IjTc(NQ_VQ,c);vs(jvaqbj.IjNqNQ_VQ&&jvaqbj.IjNqNQ_VQ.EbyybssCnary>-1)IjPnapryZbhfrYvfgrareNQ_VQ();vs(jvaqbj.IjNqNQ_VQ)jvaqbj.IjNqNQ_VQ.EbyybssCnary=c;gel{vs(q.nqqRiragYvfgrare)q.nqqRiragYvfgrare(z,s,snyfr);ryfr vs(q.nggnpuRirag)q.nggnpuRirag("ba"+z,s);}pngpu(r){}};;jvaqbj.IjPnapryZbhfrYvfgrareNQ_VQ=shapgvba(){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;vs(jvaqbj.IjNqNQ_VQ)jvaqbj.IjNqNQ_VQ.EbyybssCnary=-1;gel{vs(q.erzbirRiragYvfgrare)q.erzbirRiragYvfgrare(z,s,snyfr);ryfr vs(q.qrgnpuRirag)q.qrgnpuRirag("ba"+z,s);}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjTc=d2(n,c){ine nq=jvaqbj.IjNqNQ_VQ;vs(vfAnA(c)){sbe(ine v=0;v<nq.Cnaryf.yratgu;v++)vs(nq.Cnaryf[v].Anzr==c)erghea v;erghea 0;}erghea c;};;jvaqbj.IjNqNQ_VQ.IjTpy=d2(n,c,p){ine cn=jvaqbj.IjNqNQ_VQ.Cnaryf[IjTc(n,c)];vs(!cn)erghea 0;vs(vfAnA(p)){sbe(ine v=0;v<cn.Pyvpxguehf.yratgu;v++)vs(cn.Pyvpxguehf[v].Anzr==p)erghea v;erghea 0;}erghea p;};;jvaqbj.IjNqNQ_VQ.IjGenpr=d2(n,f){gel{vs(jvaqbj["Ij"+"QtQ"])jvaqbj["Ij"+"QtQ"](n,1,f);}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjYvzvg1=d2(n,f){ine nq=jvaqbj.IjNqNQ_VQ,vh=f.fcyvg("/");sbe(ine v=0,p=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.FzV.yratgu>0)nq.FzV+="/";nq.FzV+=vh[v];nq.FtZ[nq.FtZ.yratgu]=snyfr;}}};;jvaqbj.IjNqNQ_VQ.IjYvzvg0=d2(n,f){ine nq=jvaqbj.IjNqNQ_VQ,vh=f.fcyvg("/");sbe(ine v=0;v<vh.yratgu;v++){vs(vh[v].yratgu>0){vs(nq.OvC.yratgu>0)nq.OvC+="/";nq.OvC+=vh[v];}}};;jvaqbj.IjNqNQ_VQ.IjRVST=d2(n,c){jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]=IjTrgBow("IjCnayNQ_VQ_"+c+"_Bow");vs(jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]==ahyy)frgGvzrbhg("IjRVST(NQ_VQ,"+c+")",jvaqbj.IjNqNQ_VQ.rvsg);};;jvaqbj.IjNqNQ_VQ.IjNavzSHC=d2(n,c){ine nq=jvaqbj.IjNqNQ_VQ;vs(c>nq.Cnaryf.yratgu)erghea;ine cna=nq.Cnaryf[c],nn=gehr,on=gehr,yn=gehr,en=gehr,cn=nq.Cnaryf[0],sf=nq.ShF,j=cn.Jvqgu,u=cn.Urvtug;vs(j=="100%"){j=sf;en=snyfr;yn=snyfr;}vs(u=="100%"){u=sf;nn=snyfr;on=snyfr;}vs(cn.YnY=="Y")yn=snyfr;vs(cn.YnY=="E")en=snyfr;vs(cn.GnY=="G")nn=snyfr;vs(cn.GnY=="O")on=snyfr;ine k=0,l=0;fjvgpu(nq.NshP%8){pnfr 0:oernx;pnfr 1:vs(nn)l=-sf;oernx;pnfr 2:k=j-sf;oernx;pnfr 3:vs(en)k=j;oernx;pnfr 4:k=j-sf;l=u-sf;oernx;pnfr 5:k=j-sf;vs(on)l=u;oernx;pnfr 6:l=u-sf;oernx;pnfr 7:vs(yn)k=-sf;l=u-sf;oernx;}vs(nq.NshP++ <nq.NshG)frgGvzrbhg(("IjNavzSHC(NQ_VQ,"+c+")"),nq.NshC);ryfr{k=-1000;l=k;}cna.YrsgBssfrg=k;cna.GbcBssfrg=l;IjNhErcb(n,c);};;jvaqbj.IjNqNQ_VQ.IjTrgErnyCbfvgvba=d2(n,b,j){erghea IjBOEC.nccyl(guvf,nethzragf);};;jvaqbj.IjNqNQ_VQ.IjPnapryGvzrbhg=d2(n,c){c=IjTc(n,c);ine cay=jvaqbj.IjNqNQ_VQ.Cnaryf[c];vs(cay&&cay.UgU!=""){pyrneGvzrbhg(cay.UgU);}};;jvaqbj.IjNqNQ_VQ.IjPnapryNyyGvzrbhgf=d2(n){vs(jvaqbj.IjNqNQ_VQ.YbpxGvzrbhgPunatrf)erghea;sbe(ine c=0;c<jvaqbj.IjNqNQ_VQ.bac;c++)IjPnapryGvzrbhg(n,c);};;jvaqbj.IjNqNQ_VQ.IjFgnegGvzrbhg=d2(n,c,bG){c=IjTc(n,c);ine cay=jvaqbj.IjNqNQ_VQ.Cnaryf[c];vs(cay&&((cay.UvqrGvzrbhgInyhr>0)||(nethzragf.yratgu==3&&bG>0))){pyrneGvzrbhg(cay.UgU);cay.UgU=frgGvzrbhg(cay.UvqrNpgvba,(nethzragf.yratgu==3?bG:cay.UvqrGvzrbhgInyhr));}};;jvaqbj.IjNqNQ_VQ.IjErfrgGvzrbhg=d2(n,c,bG){c=IjTc(n,c);IjPnapryGvzrbhg(n,c);riny("IjFgnegGvzrbhg(NQ_VQ,c"+(nethzragf.yratgu==3?",bG":"")+")");};;jvaqbj.IjNqNQ_VQ.IjErfrgNyyGvzrbhgf=d2(n){sbe(ine c=0;c<jvaqbj.IjNqNQ_VQ.bac;c++)IjErfrgGvzrbhg(n,c);};;jvaqbj.IjNqNQ_VQ.IjQrgnpure=d2(n,rig,sap){gel{vs(IjQVR5)riny("jvaqbj.qrgnpuRirag(\'ba"+rig+"\',"+sap+"NQ_VQ)");ryfr vs(!IjQVRZnp)riny("jvaqbj.erzbirRiragYvfgrare(\'"+rig+"\',"+sap+"NQ_VQ,snyfr)");}pngpu(r){}};;jvaqbj.IjNqNQ_VQ.IjPyrna'; - function runBlock1() { - for (var i = 0; i < 81; i++) { - re8.exec('VC=74.125.75.1'); - } - for (var i = 0; i < 78; i++) { - '9.0 e115'.replace(/(\s)+e/, ''); - 'k'.replace(/./, ''); - str2.replace(re17, ''); - str3.replace(re17, ''); - re8.exec('144631658'); - re8.exec('Pbhagel=IIZ%3Q'); - re8.exec('Pbhagel=IIZ='); - re8.exec('CersreerqPhygherCraqvat='); - re8.exec(str4); - re8.exec(str5); - re8.exec('__hgzp=144631658'); - re8.exec('gvzrMbar=-8'); - re8.exec('gvzrMbar=0'); - /Fnsnev\/(\d+\.\d+)/.exec(str0); - re3.exec('vachggrkg QBZPbageby_cynprubyqre'); - re0.exec('xrlqbja'); - re0.exec('xrlhc'); - } - for (var i = 0; i < 77; i++) { - 'uggc://zrffntvat.zlfcnpr.pbz/vaqrk.psz'.replace(re12, ''); - re13.exec('uggc://zrffntvat.zlfcnpr.pbz/vaqrk.psz'); - } - for (var i = 0; i < 73; i++) { - 'FrffvbaFgbentr=%7O%22GnoThvq%22%3N%7O%22thvq%22%3N1231367125017%7Q%7Q'.replace(re18, ''); - } - for (var i = 0; i < 72; i++) { - re1.exec(str6); - } - for (var i = 0; i < 71; i++) { - re19.exec(''); - } - for (var i = 0; i < 70; i++) { - '3.5.0.0'.replace(re11, ''); - str7.replace(/d1/g, ''); - str8.replace(/NQ_VQ/g, ''); - str9.replace(/d2/g, ''); - 'NI%3Q1_CI%3Q1_PI%3Q1_EI%3Q1_HI%3Q1_HP%3Q1_IC%3Q0.0.0.0_IH%3Q0'.replace(/_/g, ''); - 'svz_zlfcnpr_ubzrcntr_abgybttrqva,svz_zlfcnpr_aba_HTP,svz_zlfcnpr_havgrq-fgngrf'.split(re20); - re21.exec('ybnqvat'); - } - for (var i = 0; i < 68; i++) { - re1.exec('#'); - /(?:ZFVR.(\d+\.\d+))|(?:(?:Sversbk|TenaCnenqvfb|Vprjrnfry).(\d+\.\d+))|(?:Bcren.(\d+\.\d+))|(?:NccyrJroXvg.(\d+(?:\.\d+)?))/.exec(str0); - /(Znp BF K)|(Jvaqbjf;)/.exec(str0); - /Trpxb\/([0-9]+)/.exec(str0); - re21.exec('ybnqrq'); - } - for (var i = 0; i < 49; i++) { - re16.exec('pbybe'); - } - for (var i = 0; i < 44; i++) { - 'uggc://sevraqf.zlfcnpr.pbz/vaqrk.psz'.replace(re12, ''); - re13.exec('uggc://sevraqf.zlfcnpr.pbz/vaqrk.psz'); - } - } - var re22 = /\bso_zrah\b/; - var re23 = /^(?:(?:[^:\/?#]+):)?(?:\/\/(?:[^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/; - var re24 = /uggcf?:\/\/([^\/]+\.)?snprobbx\.pbz\//; - var re25 = /"/g; - var re26 = /^([^?#]+)(?:\?([^#]*))?(#.*)?/; - function runBlock2() { - for (var i = 0; i < 40; i++) { - 'fryrpgrq'.replace(re14, ''); - 'fryrpgrq'.replace(re15, ''); - } - for (var i = 0; i < 39; i++) { - 'vachggrkg uvqqra_ryrz'.replace(/\buvqqra_ryrz\b/g, ''); - re3.exec('vachggrkg '); - re3.exec('vachggrkg'); - re22.exec('HVYvaxOhggba'); - re22.exec('HVYvaxOhggba_E'); - re22.exec('HVYvaxOhggba_EJ'); - re22.exec('zrah_ybtva_pbagnvare'); - /\buvqqra_ryrz\b/.exec('vachgcnffjbeq'); - } - for (var i = 0; i < 37; i++) { - re8.exec('111soqs57qo8o8480qo18sor2011r3n591q7s6s37r120904'); - re8.exec('SbeprqRkcvengvba=633669315660164980'); - re8.exec('FrffvbaQQS2=111soqs57qo8o8480qo18sor2011r3n591q7s6s37r120904'); - } - for (var i = 0; i < 35; i++) { - 'puvyq p1 svefg'.replace(re14, ''); - 'puvyq p1 svefg'.replace(re15, ''); - 'sylbhg pybfrq'.replace(re14, ''); - 'sylbhg pybfrq'.replace(re15, ''); - } - for (var i = 0; i < 34; i++) { - re19.exec('gno2'); - re19.exec('gno3'); - re8.exec('44132r503660'); - re8.exec('SbeprqRkcvengvba=633669316860113296'); - re8.exec('AFP_zp_dfctwzs-aowb_80=44132r503660'); - re8.exec('FrffvbaQQS2=s6r4579npn4rn2135s904r0s75pp1o5334p6s6pospo12696'); - re8.exec('s6r4579npn4rn2135s904r0s75pp1o5334p6s6pospo12696'); - } - for (var i = 0; i < 32; i++) { - /puebzr/i.exec(str0); - } - for (var i = 0; i < 31; i++) { - 'uggc://jjj.snprobbx.pbz/'.replace(re23, ''); - re8.exec('SbeprqRkcvengvba=633669358527244818'); - re8.exec('VC=66.249.85.130'); - re8.exec('FrffvbaQQS2=s15q53p9n372sn76npr13o271n4s3p5r29p235746p908p58'); - re8.exec('s15q53p9n372sn76npr13o271n4s3p5r29p235746p908p58'); - re24.exec('uggc://jjj.snprobbx.pbz/'); - } - for (var i = 0; i < 30; i++) { - '419'.replace(re6, ''); - /(?:^|\s+)gvzrfgnzc(?:\s+|$)/.exec('gvzrfgnzc'); - re7.exec('419'); - } - for (var i = 0; i < 29; i++) { - 'uggc://jjj.snprobbx.pbz/ybtva.cuc'.replace(re23, ''); - } - for (var i = 0; i < 28; i++) { - 'Funer guvf tnqtrg'.replace(re25, ''); - 'Funer guvf tnqtrg'.replace(re12, ''); - re26.exec('uggc://jjj.tbbtyr.pbz/vt/qverpgbel'); - } - } - var re27 = /-\D/g; - var re28 = /\bnpgvingr\b/; - var re29 = /%2R/gi; - var re30 = /%2S/gi; - var re31 = /^(mu-(PA|GJ)|wn|xb)$/; - var re32 = /\s?;\s?/; - var re33 = /%\w?$/; - var re34 = /TNQP=([^;]*)/i; - var str10 = 'FrffvbaQQS2=111soqs57qo8o8480qo18sor2011r3n591q7s6s37r120904; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669315660164980&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; - var str11 = 'FrffvbaQQS2=111soqs57qo8o8480qo18sor2011r3n591q7s6s37r120904; __hgzm=144631658.1231363570.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.3426875219718084000.1231363570.1231363570.1231363570.1; __hgzo=144631658.0.10.1231363570; __hgzp=144631658; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669315660164980&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str12 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231363514065&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231363514065&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Subzr.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1326469221.1231363557&tn_fvq=1231363557&tn_uvq=1114636509&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; - var str13 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669315660164980&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str14 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669315660164980&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; - var re35 = /[<>]/g; - var str15 = 'FrffvbaQQS2=s6r4579npn4rn2135s904r0s75pp1o5334p6s6pospo12696; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669316860113296&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_dfctwzs-aowb_80=44132r503660'; - var str16 = 'FrffvbaQQS2=s6r4579npn4rn2135s904r0s75pp1o5334p6s6pospo12696; AFP_zp_dfctwzs-aowb_80=44132r503660; __hgzm=144631658.1231363638.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.965867047679498800.1231363638.1231363638.1231363638.1; __hgzo=144631658.0.10.1231363638; __hgzp=144631658; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669316860113296&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str17 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231363621014&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231363621014&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Scebsvyr.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=348699119.1231363624&tn_fvq=1231363624&tn_uvq=895511034&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; - var str18 = 'uggc://jjj.yrobapbva.se/yv'; - var str19 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669316860113296&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str20 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669316860113296&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; - function runBlock3() { - for (var i = 0; i < 27; i++) { - 'e115'.replace(/[A-Za-z]/g, ''); - } - for (var i = 0; i < 23; i++) { - 'qvfcynl'.replace(re27, ''); - 'cbfvgvba'.replace(re27, ''); - } - for (var i = 0; i < 22; i++) { - 'unaqyr'.replace(re14, ''); - 'unaqyr'.replace(re15, ''); - 'yvar'.replace(re14, ''); - 'yvar'.replace(re15, ''); - 'cnerag puebzr6 fvatyr1 gno'.replace(re14, ''); - 'cnerag puebzr6 fvatyr1 gno'.replace(re15, ''); - 'fyvqre'.replace(re14, ''); - 'fyvqre'.replace(re15, ''); - re28.exec(''); - } - for (var i = 0; i < 21; i++) { - 'uggc://jjj.zlfcnpr.pbz/'.replace(re12, ''); - re13.exec('uggc://jjj.zlfcnpr.pbz/'); - } - for (var i = 0; i < 20; i++) { - 'cntrivrj'.replace(re29, ''); - 'cntrivrj'.replace(re30, ''); - re19.exec('ynfg'); - re19.exec('ba svefg'); - re8.exec('VC=74.125.75.3'); - } - for (var i = 0; i < 19; i++) { - re31.exec('ra'); - } - for (var i = 0; i < 18; i++) { - str10.split(re32); - str11.split(re32); - str12.replace(re33, ''); - re8.exec('144631658.0.10.1231363570'); - re8.exec('144631658.1231363570.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re8.exec('144631658.3426875219718084000.1231363570.1231363570.1231363570.1'); - re8.exec(str13); - re8.exec(str14); - re8.exec('__hgzn=144631658.3426875219718084000.1231363570.1231363570.1231363570.1'); - re8.exec('__hgzo=144631658.0.10.1231363570'); - re8.exec('__hgzm=144631658.1231363570.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re34.exec(str10); - re34.exec(str11); - } - for (var i = 0; i < 17; i++) { - str0.match(/zfvr/gi); - str0.match(/bcren/gi); - str15.split(re32); - str16.split(re32); - 'ohggba'.replace(re14, ''); - 'ohggba'.replace(re15, ''); - 'puvyq p1 svefg sylbhg pybfrq'.replace(re14, ''); - 'puvyq p1 svefg sylbhg pybfrq'.replace(re15, ''); - 'pvgvrf'.replace(re14, ''); - 'pvgvrf'.replace(re15, ''); - 'pybfrq'.replace(re14, ''); - 'pybfrq'.replace(re15, ''); - 'qry'.replace(re14, ''); - 'qry'.replace(re15, ''); - 'uqy_zba'.replace(re14, ''); - 'uqy_zba'.replace(re15, ''); - str17.replace(re33, ''); - str18.replace(/%3P/g, ''); - str18.replace(/%3R/g, ''); - str18.replace(/%3q/g, ''); - str18.replace(re35, ''); - 'yvaxyvfg16'.replace(re14, ''); - 'yvaxyvfg16'.replace(re15, ''); - 'zvahf'.replace(re14, ''); - 'zvahf'.replace(re15, ''); - 'bcra'.replace(re14, ''); - 'bcra'.replace(re15, ''); - 'cnerag puebzr5 fvatyr1 ps NU'.replace(re14, ''); - 'cnerag puebzr5 fvatyr1 ps NU'.replace(re15, ''); - 'cynlre'.replace(re14, ''); - 'cynlre'.replace(re15, ''); - 'cyhf'.replace(re14, ''); - 'cyhf'.replace(re15, ''); - 'cb_uqy'.replace(re14, ''); - 'cb_uqy'.replace(re15, ''); - 'hyJVzt'.replace(re14, ''); - 'hyJVzt'.replace(re15, ''); - re8.exec('144631658.0.10.1231363638'); - re8.exec('144631658.1231363638.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re8.exec('144631658.965867047679498800.1231363638.1231363638.1231363638.1'); - re8.exec('4413268q3660'); - re8.exec('4ss747o77904333q374or84qrr1s9r0nprp8r5q81534o94n'); - re8.exec('SbeprqRkcvengvba=633669321699093060'); - re8.exec('VC=74.125.75.20'); - re8.exec(str19); - re8.exec(str20); - re8.exec('AFP_zp_tfwsbrg-aowb_80=4413268q3660'); - re8.exec('FrffvbaQQS2=4ss747o77904333q374or84qrr1s9r0nprp8r5q81534o94n'); - re8.exec('__hgzn=144631658.965867047679498800.1231363638.1231363638.1231363638.1'); - re8.exec('__hgzo=144631658.0.10.1231363638'); - re8.exec('__hgzm=144631658.1231363638.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re34.exec(str15); - re34.exec(str16); - } - } - var re36 = /uers|fep|fryrpgrq/; - var re37 = /\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g; - var re38 = /^(\w+|\*)$/; - var str21 = 'FrffvbaQQS2=s15q53p9n372sn76npr13o271n4s3p5r29p235746p908p58; ZFPhygher=VC=66.249.85.130&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669358527244818&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; - var str22 = 'FrffvbaQQS2=s15q53p9n372sn76npr13o271n4s3p5r29p235746p908p58; __hgzm=144631658.1231367822.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.4127520630321984500.1231367822.1231367822.1231367822.1; __hgzo=144631658.0.10.1231367822; __hgzp=144631658; ZFPhygher=VC=66.249.85.130&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669358527244818&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str23 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231367803797&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231367803797&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Szrffntvat.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1192552091.1231367807&tn_fvq=1231367807&tn_uvq=1155446857&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; - var str24 = 'ZFPhygher=VC=66.249.85.130&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669358527244818&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str25 = 'ZFPhygher=VC=66.249.85.130&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669358527244818&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; - var str26 = 'hy.ynat-fryrpgbe'; - var re39 = /\\/g; - var re40 = / /g; - var re41 = /\/\xc4\/t/; - var re42 = /\/\xd6\/t/; - var re43 = /\/\xdc\/t/; - var re44 = /\/\xdf\/t/; - var re45 = /\/\xe4\/t/; - var re46 = /\/\xf6\/t/; - var re47 = /\/\xfc\/t/; - var re48 = /\W/g; - var re49 = /uers|fep|fglyr/; - function runBlock4() { - for (var i = 0; i < 16; i++) { - ''.replace(/\*/g, ''); - /\bnpgvir\b/.exec('npgvir'); - /sversbk/i.exec(str0); - re36.exec('glcr'); - /zfvr/i.exec(str0); - /bcren/i.exec(str0); - } - for (var i = 0; i < 15; i++) { - str21.split(re32); - str22.split(re32); - 'uggc://ohyyrgvaf.zlfcnpr.pbz/vaqrk.psz'.replace(re12, ''); - str23.replace(re33, ''); - 'yv'.replace(re37, ''); - 'yv'.replace(re18, ''); - re8.exec('144631658.0.10.1231367822'); - re8.exec('144631658.1231367822.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re8.exec('144631658.4127520630321984500.1231367822.1231367822.1231367822.1'); - re8.exec(str24); - re8.exec(str25); - re8.exec('__hgzn=144631658.4127520630321984500.1231367822.1231367822.1231367822.1'); - re8.exec('__hgzo=144631658.0.10.1231367822'); - re8.exec('__hgzm=144631658.1231367822.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re34.exec(str21); - re34.exec(str22); - /\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)["']?(.*?)["']?)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g.exec(str26); - re13.exec('uggc://ohyyrgvaf.zlfcnpr.pbz/vaqrk.psz'); - re38.exec('yv'); - } - for (var i = 0; i < 14; i++) { - ''.replace(re18, ''); - '9.0 e115'.replace(/(\s+e|\s+o[0-9]+)/, ''); - 'Funer guvf tnqtrg'.replace(/</g, ''); - 'Funer guvf tnqtrg'.replace(/>/g, ''); - 'Funer guvf tnqtrg'.replace(re39, ''); - 'uggc://cebsvyrrqvg.zlfcnpr.pbz/vaqrk.psz'.replace(re12, ''); - 'grnfre'.replace(re40, ''); - 'grnfre'.replace(re41, ''); - 'grnfre'.replace(re42, ''); - 'grnfre'.replace(re43, ''); - 'grnfre'.replace(re44, ''); - 'grnfre'.replace(re45, ''); - 'grnfre'.replace(re46, ''); - 'grnfre'.replace(re47, ''); - 'grnfre'.replace(re48, ''); - re16.exec('znetva-gbc'); - re16.exec('cbfvgvba'); - re19.exec('gno1'); - re9.exec('qz'); - re9.exec('qg'); - re9.exec('zbqobk'); - re9.exec('zbqobkva'); - re9.exec('zbqgvgyr'); - re13.exec('uggc://cebsvyrrqvg.zlfcnpr.pbz/vaqrk.psz'); - re26.exec('/vt/znvytnqtrg'); - re49.exec('glcr'); - } - } - var re50 = /(?:^|\s+)fryrpgrq(?:\s+|$)/; - var re51 = /\&/g; - var re52 = /\+/g; - var re53 = /\?/g; - var re54 = /\t/g; - var re55 = /(\$\{nqiHey\})|(\$nqiHey\b)/g; - var re56 = /(\$\{cngu\})|(\$cngu\b)/g; - function runBlock5() { - for (var i = 0; i < 13; i++) { - 'purpx'.replace(re14, ''); - 'purpx'.replace(re15, ''); - 'pvgl'.replace(re14, ''); - 'pvgl'.replace(re15, ''); - 'qrpe fyvqrgrkg'.replace(re14, ''); - 'qrpe fyvqrgrkg'.replace(re15, ''); - 'svefg fryrpgrq'.replace(re14, ''); - 'svefg fryrpgrq'.replace(re15, ''); - 'uqy_rag'.replace(re14, ''); - 'uqy_rag'.replace(re15, ''); - 'vape fyvqrgrkg'.replace(re14, ''); - 'vape fyvqrgrkg'.replace(re15, ''); - 'vachggrkg QBZPbageby_cynprubyqre'.replace(re5, ''); - 'cnerag puebzr6 fvatyr1 gno fryrpgrq'.replace(re14, ''); - 'cnerag puebzr6 fvatyr1 gno fryrpgrq'.replace(re15, ''); - 'cb_guz'.replace(re14, ''); - 'cb_guz'.replace(re15, ''); - 'fhozvg'.replace(re14, ''); - 'fhozvg'.replace(re15, ''); - re50.exec(''); - /NccyrJroXvg\/([^\s]*)/.exec(str0); - /XUGZY/.exec(str0); - } - for (var i = 0; i < 12; i++) { - '${cebg}://${ubfg}${cngu}/${dz}'.replace(/(\$\{cebg\})|(\$cebg\b)/g, ''); - '1'.replace(re40, ''); - '1'.replace(re10, ''); - '1'.replace(re51, ''); - '1'.replace(re52, ''); - '1'.replace(re53, ''); - '1'.replace(re39, ''); - '1'.replace(re54, ''); - '9.0 e115'.replace(/^(.*)\..*$/, ''); - '9.0 e115'.replace(/^.*e(.*)$/, ''); - '<!-- ${nqiHey} -->'.replace(re55, ''); - '<fpevcg glcr="grkg/wninfpevcg" fep="${nqiHey}"></fpevcg>'.replace(re55, ''); - str1.replace(/^.*\s+(\S+\s+\S+$)/, ''); - 'tzk%2Subzrcntr%2Sfgneg%2Sqr%2S'.replace(re30, ''); - 'tzk'.replace(re30, ''); - 'uggc://${ubfg}${cngu}/${dz}'.replace(/(\$\{ubfg\})|(\$ubfg\b)/g, ''); - 'uggc://nqpyvrag.hvzfrei.arg${cngu}/${dz}'.replace(re56, ''); - 'uggc://nqpyvrag.hvzfrei.arg/wf.at/${dz}'.replace(/(\$\{dz\})|(\$dz\b)/g, ''); - 'frpgvba'.replace(re29, ''); - 'frpgvba'.replace(re30, ''); - 'fvgr'.replace(re29, ''); - 'fvgr'.replace(re30, ''); - 'fcrpvny'.replace(re29, ''); - 'fcrpvny'.replace(re30, ''); - re36.exec('anzr'); - /e/.exec('9.0 e115'); - } - } - var re57 = /##yv4##/gi; - var re58 = /##yv16##/gi; - var re59 = /##yv19##/gi; - var str27 = '<hy pynff="nqi">##yv4##Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.##yv19##Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.##yv16##Ybgf bs fgbentr (5 TO) - zber pbby fghss ba gur jnl.##OE## ##OE## ##N##Yrnea zber##/N##</hy>'; - var str28 = '<hy pynff="nqi"><yv vq="YvOYG4" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg4.cat)">Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.##yv19##Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.##yv16##Ybgf bs fgbentr (5 TO) - zber pbby fghss ba gur jnl.##OE## ##OE## ##N##Yrnea zber##/N##</hy>'; - var str29 = '<hy pynff="nqi"><yv vq="YvOYG4" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg4.cat)">Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.##yv19##Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.<yv vq="YvOYG16" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg16.cat)">Ybgf bs fgbentr (5 TO) - zber pbby fghss ba gur jnl.##OE## ##OE## ##N##Yrnea zber##/N##</hy>'; - var str30 = '<hy pynff="nqi"><yv vq="YvOYG4" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg4.cat)">Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.<yv vq="YvOYG19" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg19.cat)">Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.<yv vq="YvOYG16" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg16.cat)">Ybgf bs fgbentr (5 TO) - zber pbby fghss ba gur jnl.##OE## ##OE## ##N##Yrnea zber##/N##</hy>'; - var str31 = '<hy pynff="nqi"><yv vq="YvOYG4" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg4.cat)">Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.<yv vq="YvOYG19" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg19.cat)">Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.<yv vq="YvOYG16" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg16.cat)">Ybgf bs fgbentr (5 TO) - zber pbby fghss ba gur jnl.<oe> <oe> ##N##Yrnea zber##/N##</hy>'; - var str32 = '<hy pynff="nqi"><yv vq="YvOYG4" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg4.cat)">Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.<yv vq="YvOYG19" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg19.cat)">Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.<yv vq="YvOYG16" fglyr="onpxtebhaq-vzntr:hey(uggc://vzt.jykef.pbz/~Yvir.FvgrPbagrag.VQ/~14.2.1230/~/~/~/oyg16.cat)">Ybgf bs fgbentr (5 TO) - zber pbby fghss ba gur jnl.<oe> <oe> <n uers="uggc://znvy.yvir.pbz/znvy/nobhg.nfck" gnetrg="_oynax">Yrnea zber##/N##</hy>'; - var str33 = 'Bar Jvaqbjf Yvir VQ trgf lbh vagb <o>Ubgznvy</o>, <o>Zrffratre</o>, <o>Kobk YVIR</o> \u2014 naq bgure cynprf lbh frr #~#argjbexybtb#~#'; - var re60 = /(?:^|\s+)bss(?:\s+|$)/; - var re61 = /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/; - var re62 = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/; - var str34 = '${1}://${2}${3}${4}${5}'; - var str35 = ' O=6gnyg0g4znrrn&o=3&f=gc; Q=_lyu=K3bQZGSxnT4lZzD3OS9GNmV3ZGLkAQxRpTyxNmRlZmRmAmNkAQLRqTImqNZjOUEgpTjQnJ5xMKtgoN--; SCF=qy'; - function runBlock6() { - for (var i = 0; i < 11; i++) { - str27.replace(/##yv0##/gi, ''); - str27.replace(re57, ''); - str28.replace(re58, ''); - str29.replace(re59, ''); - str30.replace(/##\/o##/gi, ''); - str30.replace(/##\/v##/gi, ''); - str30.replace(/##\/h##/gi, ''); - str30.replace(/##o##/gi, ''); - str30.replace(/##oe##/gi, ''); - str30.replace(/##v##/gi, ''); - str30.replace(/##h##/gi, ''); - str31.replace(/##n##/gi, ''); - str32.replace(/##\/n##/gi, ''); - str33.replace(/#~#argjbexybtb#~#/g, ''); - / Zbovyr\//.exec(str0); - /##yv1##/gi.exec(str27); - /##yv10##/gi.exec(str28); - /##yv11##/gi.exec(str28); - /##yv12##/gi.exec(str28); - /##yv13##/gi.exec(str28); - /##yv14##/gi.exec(str28); - /##yv15##/gi.exec(str28); - re58.exec(str28); - /##yv17##/gi.exec(str29); - /##yv18##/gi.exec(str29); - re59.exec(str29); - /##yv2##/gi.exec(str27); - /##yv20##/gi.exec(str30); - /##yv21##/gi.exec(str30); - /##yv22##/gi.exec(str30); - /##yv23##/gi.exec(str30); - /##yv3##/gi.exec(str27); - re57.exec(str27); - /##yv5##/gi.exec(str28); - /##yv6##/gi.exec(str28); - /##yv7##/gi.exec(str28); - /##yv8##/gi.exec(str28); - /##yv9##/gi.exec(str28); - re8.exec('473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29'); - re8.exec('SbeprqRkcvengvba=633669325184628362'); - re8.exec('FrffvbaQQS2=473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29'); - /AbxvnA[^\/]*/.exec(str0); - } - for (var i = 0; i < 10; i++) { - ' bss'.replace(/(?:^|\s+)bss(?:\s+|$)/g, ''); - str34.replace(/(\$\{0\})|(\$0\b)/g, ''); - str34.replace(/(\$\{1\})|(\$1\b)/g, ''); - str34.replace(/(\$\{pbzcyrgr\})|(\$pbzcyrgr\b)/g, ''); - str34.replace(/(\$\{sentzrag\})|(\$sentzrag\b)/g, ''); - str34.replace(/(\$\{ubfgcbeg\})|(\$ubfgcbeg\b)/g, ''); - str34.replace(re56, ''); - str34.replace(/(\$\{cebgbpby\})|(\$cebgbpby\b)/g, ''); - str34.replace(/(\$\{dhrel\})|(\$dhrel\b)/g, ''); - 'nqfvmr'.replace(re29, ''); - 'nqfvmr'.replace(re30, ''); - 'uggc://${2}${3}${4}${5}'.replace(/(\$\{2\})|(\$2\b)/g, ''); - 'uggc://wf.hv-cbegny.qr${3}${4}${5}'.replace(/(\$\{3\})|(\$3\b)/g, ''); - 'arjf'.replace(re40, ''); - 'arjf'.replace(re41, ''); - 'arjf'.replace(re42, ''); - 'arjf'.replace(re43, ''); - 'arjf'.replace(re44, ''); - 'arjf'.replace(re45, ''); - 'arjf'.replace(re46, ''); - 'arjf'.replace(re47, ''); - 'arjf'.replace(re48, ''); - / PC=i=(\d+)&oe=(.)/.exec(str35); - re60.exec(' '); - re60.exec(' bss'); - re60.exec(''); - re19.exec(' '); - re19.exec('svefg ba'); - re19.exec('ynfg vtaber'); - re19.exec('ba'); - re9.exec('scnq so '); - re9.exec('zrqvgobk'); - re9.exec('hsgy'); - re9.exec('lhv-h'); - /Fnsnev|Xbadhrebe|XUGZY/gi.exec(str0); - re61.exec('uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf'); - re62.exec('#Ybtva_rznvy'); - } - } - var re63 = /\{0\}/g; - var str36 = 'FrffvbaQQS2=4ss747o77904333q374or84qrr1s9r0nprp8r5q81534o94n; ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669321699093060&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_tfwsbrg-aowb_80=4413268q3660'; - var str37 = 'FrffvbaQQS2=4ss747o77904333q374or84qrr1s9r0nprp8r5q81534o94n; AFP_zp_tfwsbrg-aowb_80=4413268q3660; __hgzm=144631658.1231364074.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.2294274870215848400.1231364074.1231364074.1231364074.1; __hgzo=144631658.0.10.1231364074; __hgzp=144631658; ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669321699093060&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str38 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231364057761&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231364057761&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Ssevraqf.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1667363813.1231364061&tn_fvq=1231364061&tn_uvq=1917563877&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; - var str39 = 'ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669321699093060&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str40 = 'ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669321699093060&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; - function runBlock7() { - for (var i = 0; i < 9; i++) { - '0'.replace(re40, ''); - '0'.replace(re10, ''); - '0'.replace(re51, ''); - '0'.replace(re52, ''); - '0'.replace(re53, ''); - '0'.replace(re39, ''); - '0'.replace(re54, ''); - 'Lrf'.replace(re40, ''); - 'Lrf'.replace(re10, ''); - 'Lrf'.replace(re51, ''); - 'Lrf'.replace(re52, ''); - 'Lrf'.replace(re53, ''); - 'Lrf'.replace(re39, ''); - 'Lrf'.replace(re54, ''); - } - for (var i = 0; i < 8; i++) { - 'Pybfr {0}'.replace(re63, ''); - 'Bcra {0}'.replace(re63, ''); - str36.split(re32); - str37.split(re32); - 'puvyq p1 svefg gnournqref'.replace(re14, ''); - 'puvyq p1 svefg gnournqref'.replace(re15, ''); - 'uqy_fcb'.replace(re14, ''); - 'uqy_fcb'.replace(re15, ''); - 'uvag'.replace(re14, ''); - 'uvag'.replace(re15, ''); - str38.replace(re33, ''); - 'yvfg'.replace(re14, ''); - 'yvfg'.replace(re15, ''); - 'at_bhgre'.replace(re30, ''); - 'cnerag puebzr5 qbhoyr2 NU'.replace(re14, ''); - 'cnerag puebzr5 qbhoyr2 NU'.replace(re15, ''); - 'cnerag puebzr5 dhnq5 ps NU osyvax zbarl'.replace(re14, ''); - 'cnerag puebzr5 dhnq5 ps NU osyvax zbarl'.replace(re15, ''); - 'cnerag puebzr6 fvatyr1'.replace(re14, ''); - 'cnerag puebzr6 fvatyr1'.replace(re15, ''); - 'cb_qrs'.replace(re14, ''); - 'cb_qrs'.replace(re15, ''); - 'gnopbagrag'.replace(re14, ''); - 'gnopbagrag'.replace(re15, ''); - 'iv_svefg_gvzr'.replace(re30, ''); - /(^|.)(ronl|qri-ehf3.wbg)(|fgberf|zbgbef|yvirnhpgvbaf|jvxv|rkcerff|punggre).(pbz(|.nh|.pa|.ux|.zl|.ft|.oe|.zk)|pb(.hx|.xe|.am)|pn|qr|se|vg|ay|or|ng|pu|vr|va|rf|cy|cu|fr)$/i.exec('cntrf.ronl.pbz'); - re8.exec('144631658.0.10.1231364074'); - re8.exec('144631658.1231364074.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re8.exec('144631658.2294274870215848400.1231364074.1231364074.1231364074.1'); - re8.exec('4413241q3660'); - re8.exec('SbeprqRkcvengvba=633669357391353591'); - re8.exec(str39); - re8.exec(str40); - re8.exec('AFP_zp_kkk-gdzogv_80=4413241q3660'); - re8.exec('FrffvbaQQS2=p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7'); - re8.exec('__hgzn=144631658.2294274870215848400.1231364074.1231364074.1231364074.1'); - re8.exec('__hgzo=144631658.0.10.1231364074'); - re8.exec('__hgzm=144631658.1231364074.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re8.exec('p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7'); - re34.exec(str36); - re34.exec(str37); - } - } - var re64 = /\b[a-z]/g; - var re65 = /^uggc:\/\//; - var re66 = /(?:^|\s+)qvfnoyrq(?:\s+|$)/; - var str41 = 'uggc://cebsvyr.zlfcnpr.pbz/Zbqhyrf/Nccyvpngvbaf/Cntrf/Pnainf.nfck'; - function runBlock8() { - for (var i = 0; i < 7; i++) { - str1.match(/\d+/g); - 'nsgre'.replace(re64, ''); - 'orsber'.replace(re64, ''); - 'obggbz'.replace(re64, ''); - 'ohvygva_jrngure.kzy'.replace(re65, ''); - 'ohggba'.replace(re37, ''); - 'ohggba'.replace(re18, ''); - 'qngrgvzr.kzy'.replace(re65, ''); - 'uggc://eff.paa.pbz/eff/paa_gbcfgbevrf.eff'.replace(re65, ''); - 'vachg'.replace(re37, ''); - 'vachg'.replace(re18, ''); - 'vafvqr'.replace(re64, ''); - 'cbvagre'.replace(re27, ''); - 'cbfvgvba'.replace(/[A-Z]/g, ''); - 'gbc'.replace(re27, ''); - 'gbc'.replace(re64, ''); - 'hy'.replace(re37, ''); - 'hy'.replace(re18, ''); - str26.replace(re37, ''); - str26.replace(re18, ''); - 'lbhghor_vtbbtyr/i2/lbhghor.kzy'.replace(re65, ''); - 'm-vaqrk'.replace(re27, ''); - /#([\w-]+)/.exec(str26); - re16.exec('urvtug'); - re16.exec('znetvaGbc'); - re16.exec('jvqgu'); - re19.exec('gno0 svefg ba'); - re19.exec('gno0 ba'); - re19.exec('gno4 ynfg'); - re19.exec('gno4'); - re19.exec('gno5'); - re19.exec('gno6'); - re19.exec('gno7'); - re19.exec('gno8'); - /NqborNVE\/([^\s]*)/.exec(str0); - /NccyrJroXvg\/([^ ]*)/.exec(str0); - /XUGZY/gi.exec(str0); - /^(?:obql|ugzy)$/i.exec('YV'); - re38.exec('ohggba'); - re38.exec('vachg'); - re38.exec('hy'); - re38.exec(str26); - /^(\w+|\*)/.exec(str26); - /znp|jva|yvahk/i.exec('Jva32'); - /eton?\([\d\s,]+\)/.exec('fgngvp'); - } - for (var i = 0; i < 6; i++) { - ''.replace(/\r/g, ''); - '/'.replace(re40, ''); - '/'.replace(re10, ''); - '/'.replace(re51, ''); - '/'.replace(re52, ''); - '/'.replace(re53, ''); - '/'.replace(re39, ''); - '/'.replace(re54, ''); - 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/{0}?[NDO]&{1}&{2}&[NDR]'.replace(re63, ''); - str41.replace(re12, ''); - 'uggc://jjj.snprobbx.pbz/fepu.cuc'.replace(re23, ''); - 'freivpr'.replace(re40, ''); - 'freivpr'.replace(re41, ''); - 'freivpr'.replace(re42, ''); - 'freivpr'.replace(re43, ''); - 'freivpr'.replace(re44, ''); - 'freivpr'.replace(re45, ''); - 'freivpr'.replace(re46, ''); - 'freivpr'.replace(re47, ''); - 'freivpr'.replace(re48, ''); - /((ZFVR\s+([6-9]|\d\d)\.))/.exec(str0); - re66.exec(''); - re50.exec('fryrpgrq'); - re8.exec('8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn'); - re8.exec('SbeprqRkcvengvba=633669340386893867'); - re8.exec('VC=74.125.75.17'); - re8.exec('FrffvbaQQS2=8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn'); - /Xbadhrebe|Fnsnev|XUGZY/.exec(str0); - re13.exec(str41); - re49.exec('unfsbphf'); - } - } - var re67 = /zrah_byq/g; - var str42 = 'FrffvbaQQS2=473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29; ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669325184628362&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; - var str43 = 'FrffvbaQQS2=473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29; __hgzm=144631658.1231364380.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.3931862196947939300.1231364380.1231364380.1231364380.1; __hgzo=144631658.0.10.1231364380; __hgzp=144631658; ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669325184628362&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str44 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_vzntrf_wf&qg=1231364373088&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231364373088&punaary=svz_zlfcnpr_hfre-ivrj-pbzzragf%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Spbzzrag.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1158737789.1231364375&tn_fvq=1231364375&tn_uvq=415520832&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; - var str45 = 'ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669325184628362&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str46 = 'ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669325184628362&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; - var re68 = /^([#.]?)((?:[\w\u0128-\uffff*_-]|\\.)*)/; - var re69 = /\{1\}/g; - var re70 = /\s+/; - var re71 = /(\$\{4\})|(\$4\b)/g; - var re72 = /(\$\{5\})|(\$5\b)/g; - var re73 = /\{2\}/g; - var re74 = /[^+>] [^+>]/; - var re75 = /\bucpyv\s*=\s*([^;]*)/i; - var re76 = /\bucuvqr\s*=\s*([^;]*)/i; - var re77 = /\bucfie\s*=\s*([^;]*)/i; - var re78 = /\bhfucjrn\s*=\s*([^;]*)/i; - var re79 = /\bmvc\s*=\s*([^;]*)/i; - var re80 = /^((?:[\w\u0128-\uffff*_-]|\\.)+)(#)((?:[\w\u0128-\uffff*_-]|\\.)+)/; - var re81 = /^([>+~])\s*(\w*)/i; - var re82 = /^>\s*((?:[\w\u0128-\uffff*_-]|\\.)+)/; - var re83 = /^[\s[]?shapgvba/; - var re84 = /v\/g.tvs#(.*)/i; - var str47 = '#Zbq-Vasb-Vasb-WninFpevcgUvag'; - var str48 = ',n.svryqOgaPnapry'; - var str49 = 'FrffvbaQQS2=p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7; ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669357391353591&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_kkk-gdzogv_80=4413241q3660'; - var str50 = 'FrffvbaQQS2=p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7; AFP_zp_kkk-gdzogv_80=4413241q3660; AFP_zp_kkk-aowb_80=4413235p3660; __hgzm=144631658.1231367708.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.2770915348920628700.1231367708.1231367708.1231367708.1; __hgzo=144631658.0.10.1231367708; __hgzp=144631658; ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669357391353591&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str51 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231367691141&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231367691141&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Sjjj.zlfcnpr.pbz%2S&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=320757904.1231367694&tn_fvq=1231367694&tn_uvq=1758792003&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; - var str52 = 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55332979829981?[NDO]&aqu=1&g=7%2S0%2S2009%2014%3N38%3N42%203%20480&af=zfacbegny&cntrAnzr=HF%20UCZFSGJ&t=uggc%3N%2S%2Sjjj.zfa.pbz%2S&f=1024k768&p=24&x=L&oj=994&ou=634&uc=A&{2}&[NDR]'; - var str53 = 'cnerag puebzr6 fvatyr1 gno fryrpgrq ovaq qbhoyr2 ps'; - var str54 = 'ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669357391353591&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str55 = 'ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669357391353591&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; - var str56 = 'ne;ng;nh;or;oe;pn;pu;py;pa;qr;qx;rf;sv;se;to;ux;vq;vr;va;vg;wc;xe;zk;zl;ay;ab;am;cu;cy;cg;eh;fr;ft;gu;ge;gj;mn;'; - var str57 = 'ZP1=I=3&THVQ=6nnpr9q661804s33nnop45nosqp17q85; zu=ZFSG; PHYGHER=RA-HF; SyvtugTebhcVq=97; SyvtugVq=OnfrCntr; ucfie=Z:5|S:5|G:5|R:5|Q:oyh|J:S; ucpyv=J.U|Y.|F.|E.|H.Y|P.|U.; hfucjrn=jp:HFPN0746; ZHVQ=Q783SN9O14054831N4869R51P0SO8886&GHVQ=1'; - var str58 = 'ZP1=I=3&THVQ=6nnpr9q661804s33nnop45nosqp17q85; zu=ZFSG; PHYGHER=RA-HF; SyvtugTebhcVq=97; SyvtugVq=OnfrCntr; ucfie=Z:5|S:5|G:5|R:5|Q:oyh|J:S; ucpyv=J.U|Y.|F.|E.|H.Y|P.|U.; hfucjrn=jp:HFPN0746; ZHVQ=Q783SN9O14054831N4869R51P0SO8886'; - var str59 = 'ZP1=I=3&THVQ=6nnpr9q661804s33nnop45nosqp17q85; zu=ZFSG; PHYGHER=RA-HF; SyvtugTebhcVq=97; SyvtugVq=OnfrCntr; ucfie=Z:5|S:5|G:5|R:5|Q:oyh|J:S; ucpyv=J.U|Y.|F.|E.|H.Y|P.|U.; hfucjrn=jp:HFPN0746; ZHVQ=Q783SN9O14054831N4869R51P0SO8886; mvc=m:94043|yn:37.4154|yb:-122.0585|p:HF|ue:1'; - var str60 = 'ZP1=I=3&THVQ=6nnpr9q661804s33nnop45nosqp17q85; zu=ZFSG; PHYGHER=RA-HF; SyvtugTebhcVq=97; SyvtugVq=OnfrCntr; ucfie=Z:5|S:5|G:5|R:5|Q:oyh|J:S; ucpyv=J.U|Y.|F.|E.|H.Y|P.|U.; hfucjrn=jp:HFPN0746; ZHVQ=Q783SN9O14054831N4869R51P0SO8886; mvc=m:94043|yn:37.4154|yb:-122.0585|p:HF'; - var str61 = 'uggc://gx2.fgp.f-zfa.pbz/oe/uc/11/ra-hf/pff/v/g.tvs#uggc://gx2.fgo.f-zfa.pbz/v/29/4RQP4969777N048NPS4RRR3PO2S7S.wct'; - var str62 = 'uggc://gx2.fgp.f-zfa.pbz/oe/uc/11/ra-hf/pff/v/g.tvs#uggc://gx2.fgo.f-zfa.pbz/v/OQ/63NP9O94NS5OQP1249Q9S1ROP7NS3.wct'; - var str63 = 'zbmvyyn/5.0 (jvaqbjf; h; jvaqbjf ag 5.1; ra-hf) nccyrjroxvg/528.9 (xugzy, yvxr trpxb) puebzr/2.0.157.0 fnsnev/528.9'; - function runBlock9() { - for (var i = 0; i < 5; i++) { - str42.split(re32); - str43.split(re32); - 'svz_zlfcnpr_hfre-ivrj-pbzzragf,svz_zlfcnpr_havgrq-fgngrf'.split(re20); - str44.replace(re33, ''); - 'zrah_arj zrah_arj_gbttyr zrah_gbttyr'.replace(re67, ''); - 'zrah_byq zrah_byq_gbttyr zrah_gbttyr'.replace(re67, ''); - re8.exec('102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98'); - re8.exec('144631658.0.10.1231364380'); - re8.exec('144631658.1231364380.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re8.exec('144631658.3931862196947939300.1231364380.1231364380.1231364380.1'); - re8.exec('441326q33660'); - re8.exec('SbeprqRkcvengvba=633669341278771470'); - re8.exec(str45); - re8.exec(str46); - re8.exec('AFP_zp_dfctwzssrwh-aowb_80=441326q33660'); - re8.exec('FrffvbaQQS2=102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98'); - re8.exec('__hgzn=144631658.3931862196947939300.1231364380.1231364380.1231364380.1'); - re8.exec('__hgzo=144631658.0.10.1231364380'); - re8.exec('__hgzm=144631658.1231364380.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - } - for (var i = 0; i < 4; i++) { - ' yvfg1'.replace(re14, ''); - ' yvfg1'.replace(re15, ''); - ' yvfg2'.replace(re14, ''); - ' yvfg2'.replace(re15, ''); - ' frneputebhc1'.replace(re14, ''); - ' frneputebhc1'.replace(re15, ''); - str47.replace(re68, ''); - str47.replace(re18, ''); - ''.replace(/&/g, ''); - ''.replace(re35, ''); - '(..-{0})(\|(\d+)|)'.replace(re63, ''); - str48.replace(re18, ''); - '//vzt.jro.qr/vij/FC/${cngu}/${anzr}/${inyhr}?gf=${abj}'.replace(re56, ''); - '//vzt.jro.qr/vij/FC/tzk_uc/${anzr}/${inyhr}?gf=${abj}'.replace(/(\$\{anzr\})|(\$anzr\b)/g, ''); - '<fcna pynff="urnq"><o>Jvaqbjf Yvir Ubgznvy</o></fcna><fcna pynff="zft">{1}</fcna>'.replace(re69, ''); - '<fcna pynff="urnq"><o>{0}</o></fcna><fcna pynff="zft">{1}</fcna>'.replace(re63, ''); - '<fcna pynff="fvtahc"><n uers=uggc://jjj.ubgznvy.pbz><o>{1}</o></n></fcna>'.replace(re69, ''); - '<fcna pynff="fvtahc"><n uers={0}><o>{1}</o></n></fcna>'.replace(re63, ''); - 'Vzntrf'.replace(re15, ''); - 'ZFA'.replace(re15, ''); - 'Zncf'.replace(re15, ''); - 'Zbq-Vasb-Vasb-WninFpevcgUvag'.replace(re39, ''); - 'Arjf'.replace(re15, ''); - str49.split(re32); - str50.split(re32); - 'Ivqrb'.replace(re15, ''); - 'Jro'.replace(re15, ''); - 'n'.replace(re39, ''); - 'nwnkFgneg'.split(re70); - 'nwnkFgbc'.split(re70); - 'ovaq'.replace(re14, ''); - 'ovaq'.replace(re15, ''); - 'oevatf lbh zber. Zber fcnpr (5TO), zber frphevgl, fgvyy serr.'.replace(re63, ''); - 'puvyq p1 svefg qrpx'.replace(re14, ''); - 'puvyq p1 svefg qrpx'.replace(re15, ''); - 'puvyq p1 svefg qbhoyr2'.replace(re14, ''); - 'puvyq p1 svefg qbhoyr2'.replace(re15, ''); - 'puvyq p2 ynfg'.replace(re14, ''); - 'puvyq p2 ynfg'.replace(re15, ''); - 'puvyq p2'.replace(re14, ''); - 'puvyq p2'.replace(re15, ''); - 'puvyq p3'.replace(re14, ''); - 'puvyq p3'.replace(re15, ''); - 'puvyq p4 ynfg'.replace(re14, ''); - 'puvyq p4 ynfg'.replace(re15, ''); - 'pbclevtug'.replace(re14, ''); - 'pbclevtug'.replace(re15, ''); - 'qZFAZR_1'.replace(re14, ''); - 'qZFAZR_1'.replace(re15, ''); - 'qbhoyr2 ps'.replace(re14, ''); - 'qbhoyr2 ps'.replace(re15, ''); - 'qbhoyr2'.replace(re14, ''); - 'qbhoyr2'.replace(re15, ''); - 'uqy_arj'.replace(re14, ''); - 'uqy_arj'.replace(re15, ''); - 'uc_fubccvatobk'.replace(re30, ''); - 'ugzy%2Rvq'.replace(re29, ''); - 'ugzy%2Rvq'.replace(re30, ''); - str51.replace(re33, ''); - 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/cebgbglcr.wf${4}${5}'.replace(re71, ''); - 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/cebgbglcr.wf${5}'.replace(re72, ''); - str52.replace(re73, ''); - 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55332979829981?[NDO]&{1}&{2}&[NDR]'.replace(re69, ''); - 'vztZFSG'.replace(re14, ''); - 'vztZFSG'.replace(re15, ''); - 'zfasbbg1 ps'.replace(re14, ''); - 'zfasbbg1 ps'.replace(re15, ''); - str53.replace(re14, ''); - str53.replace(re15, ''); - 'cnerag puebzr6 fvatyr1 gno fryrpgrq ovaq'.replace(re14, ''); - 'cnerag puebzr6 fvatyr1 gno fryrpgrq ovaq'.replace(re15, ''); - 'cevznel'.replace(re14, ''); - 'cevznel'.replace(re15, ''); - 'erpgnatyr'.replace(re30, ''); - 'frpbaqnel'.replace(re14, ''); - 'frpbaqnel'.replace(re15, ''); - 'haybnq'.split(re70); - '{0}{1}1'.replace(re63, ''); - '|{1}1'.replace(re69, ''); - /(..-HF)(\|(\d+)|)/i.exec('xb-xe,ra-va,gu-gu'); - re4.exec('/ZlFcnprNccf/NccPnainf,45000012'); - re8.exec('144631658.0.10.1231367708'); - re8.exec('144631658.1231367708.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re8.exec('144631658.2770915348920628700.1231367708.1231367708.1231367708.1'); - re8.exec('4413235p3660'); - re8.exec('441327q73660'); - re8.exec('9995p6rp12rrnr893334ro7nq70o7p64p69rqn844prs1473'); - re8.exec('SbeprqRkcvengvba=633669350559478880'); - re8.exec(str54); - re8.exec(str55); - re8.exec('AFP_zp_dfctwzs-aowb_80=441327q73660'); - re8.exec('AFP_zp_kkk-aowb_80=4413235p3660'); - re8.exec('FrffvbaQQS2=9995p6rp12rrnr893334ro7nq70o7p64p69rqn844prs1473'); - re8.exec('__hgzn=144631658.2770915348920628700.1231367708.1231367708.1231367708.1'); - re8.exec('__hgzo=144631658.0.10.1231367708'); - re8.exec('__hgzm=144631658.1231367708.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re34.exec(str49); - re34.exec(str50); - /ZFVR\s+5[.]01/.exec(str0); - /HF(?=;)/i.exec(str56); - re74.exec(str47); - re28.exec('svefg npgvir svefgNpgvir'); - re28.exec('ynfg'); - /\bp:(..)/i.exec('m:94043|yn:37.4154|yb:-122.0585|p:HF'); - re75.exec(str57); - re75.exec(str58); - re76.exec(str57); - re76.exec(str58); - re77.exec(str57); - re77.exec(str58); - /\bhfucce\s*=\s*([^;]*)/i.exec(str59); - re78.exec(str57); - re78.exec(str58); - /\bjci\s*=\s*([^;]*)/i.exec(str59); - re79.exec(str58); - re79.exec(str60); - re79.exec(str59); - /\|p:([a-z]{2})/i.exec('m:94043|yn:37.4154|yb:-122.0585|p:HF|ue:1'); - re80.exec(str47); - re61.exec('cebgbglcr.wf'); - re68.exec(str47); - re81.exec(str47); - re82.exec(str47); - /^Fubpxjnir Synfu (\d)/.exec(str1); - /^Fubpxjnir Synfu (\d+)/.exec(str1); - re83.exec('[bowrpg tybony]'); - re62.exec(str47); - re84.exec(str61); - re84.exec(str62); - /jroxvg/.exec(str63); - } - } - var re85 = /eaq_zbqobkva/; - var str64 = '1231365729213'; - var str65 = '74.125.75.3-1057165600.29978900'; - var str66 = '74.125.75.3-1057165600.29978900.1231365730214'; - var str67 = 'Frnepu%20Zvpebfbsg.pbz'; - var str68 = 'FrffvbaQQS2=8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn; ZFPhygher=VC=74.125.75.17&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669340386893867&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; - var str69 = 'FrffvbaQQS2=8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn; __hgzm=144631658.1231365779.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.1877536177953918500.1231365779.1231365779.1231365779.1; __hgzo=144631658.0.10.1231365779; __hgzp=144631658; ZFPhygher=VC=74.125.75.17&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669340386893867&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str70 = 'I=3%26THVQ=757q3ss871q44o7o805n8113n5p72q52'; - var str71 = 'I=3&THVQ=757q3ss871q44o7o805n8113n5p72q52'; - var str72 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231365765292&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231365765292&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Sohyyrgvaf.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1579793869.1231365768&tn_fvq=1231365768&tn_uvq=2056210897&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; - var str73 = 'frnepu.zvpebfbsg.pbz'; - var str74 = 'frnepu.zvpebfbsg.pbz/'; - var str75 = 'ZFPhygher=VC=74.125.75.17&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669340386893867&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str76 = 'ZFPhygher=VC=74.125.75.17&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669340386893867&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; - function runBlock10() { - for (var i = 0; i < 3; i++) { - '%3Szxg=ra-HF'.replace(re39, ''); - '-8'.replace(re40, ''); - '-8'.replace(re10, ''); - '-8'.replace(re51, ''); - '-8'.replace(re52, ''); - '-8'.replace(re53, ''); - '-8'.replace(re39, ''); - '-8'.replace(re54, ''); - '1.5'.replace(re40, ''); - '1.5'.replace(re10, ''); - '1.5'.replace(re51, ''); - '1.5'.replace(re52, ''); - '1.5'.replace(re53, ''); - '1.5'.replace(re39, ''); - '1.5'.replace(re54, ''); - '1024k768'.replace(re40, ''); - '1024k768'.replace(re10, ''); - '1024k768'.replace(re51, ''); - '1024k768'.replace(re52, ''); - '1024k768'.replace(re53, ''); - '1024k768'.replace(re39, ''); - '1024k768'.replace(re54, ''); - str64.replace(re40, ''); - str64.replace(re10, ''); - str64.replace(re51, ''); - str64.replace(re52, ''); - str64.replace(re53, ''); - str64.replace(re39, ''); - str64.replace(re54, ''); - '14'.replace(re40, ''); - '14'.replace(re10, ''); - '14'.replace(re51, ''); - '14'.replace(re52, ''); - '14'.replace(re53, ''); - '14'.replace(re39, ''); - '14'.replace(re54, ''); - '24'.replace(re40, ''); - '24'.replace(re10, ''); - '24'.replace(re51, ''); - '24'.replace(re52, ''); - '24'.replace(re53, ''); - '24'.replace(re39, ''); - '24'.replace(re54, ''); - str65.replace(re40, ''); - str65.replace(re10, ''); - str65.replace(re51, ''); - str65.replace(re52, ''); - str65.replace(re53, ''); - str65.replace(re39, ''); - str65.replace(re54, ''); - str66.replace(re40, ''); - str66.replace(re10, ''); - str66.replace(re51, ''); - str66.replace(re52, ''); - str66.replace(re53, ''); - str66.replace(re39, ''); - str66.replace(re54, ''); - '9.0'.replace(re40, ''); - '9.0'.replace(re10, ''); - '9.0'.replace(re51, ''); - '9.0'.replace(re52, ''); - '9.0'.replace(re53, ''); - '9.0'.replace(re39, ''); - '9.0'.replace(re54, ''); - '994k634'.replace(re40, ''); - '994k634'.replace(re10, ''); - '994k634'.replace(re51, ''); - '994k634'.replace(re52, ''); - '994k634'.replace(re53, ''); - '994k634'.replace(re39, ''); - '994k634'.replace(re54, ''); - '?zxg=ra-HF'.replace(re40, ''); - '?zxg=ra-HF'.replace(re10, ''); - '?zxg=ra-HF'.replace(re51, ''); - '?zxg=ra-HF'.replace(re52, ''); - '?zxg=ra-HF'.replace(re53, ''); - '?zxg=ra-HF'.replace(re54, ''); - 'PAA.pbz'.replace(re25, ''); - 'PAA.pbz'.replace(re12, ''); - 'PAA.pbz'.replace(re39, ''); - 'Qngr & Gvzr'.replace(re25, ''); - 'Qngr & Gvzr'.replace(re12, ''); - 'Qngr & Gvzr'.replace(re39, ''); - 'Frnepu Zvpebfbsg.pbz'.replace(re40, ''); - 'Frnepu Zvpebfbsg.pbz'.replace(re54, ''); - str67.replace(re10, ''); - str67.replace(re51, ''); - str67.replace(re52, ''); - str67.replace(re53, ''); - str67.replace(re39, ''); - str68.split(re32); - str69.split(re32); - str70.replace(re52, ''); - str70.replace(re53, ''); - str70.replace(re39, ''); - str71.replace(re40, ''); - str71.replace(re10, ''); - str71.replace(re51, ''); - str71.replace(re54, ''); - 'Jrngure'.replace(re25, ''); - 'Jrngure'.replace(re12, ''); - 'Jrngure'.replace(re39, ''); - 'LbhGhor'.replace(re25, ''); - 'LbhGhor'.replace(re12, ''); - 'LbhGhor'.replace(re39, ''); - str72.replace(re33, ''); - 'erzbgr_vsenzr_1'.replace(/^erzbgr_vsenzr_/, ''); - str73.replace(re40, ''); - str73.replace(re10, ''); - str73.replace(re51, ''); - str73.replace(re52, ''); - str73.replace(re53, ''); - str73.replace(re39, ''); - str73.replace(re54, ''); - str74.replace(re40, ''); - str74.replace(re10, ''); - str74.replace(re51, ''); - str74.replace(re52, ''); - str74.replace(re53, ''); - str74.replace(re39, ''); - str74.replace(re54, ''); - 'lhv-h'.replace(/\-/g, ''); - re9.exec('p'); - re9.exec('qz p'); - re9.exec('zbqynory'); - re9.exec('lhv-h svefg'); - re8.exec('144631658.0.10.1231365779'); - re8.exec('144631658.1231365779.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re8.exec('144631658.1877536177953918500.1231365779.1231365779.1231365779.1'); - re8.exec(str75); - re8.exec(str76); - re8.exec('__hgzn=144631658.1877536177953918500.1231365779.1231365779.1231365779.1'); - re8.exec('__hgzo=144631658.0.10.1231365779'); - re8.exec('__hgzm=144631658.1231365779.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re34.exec(str68); - re34.exec(str69); - /^$/.exec(''); - re31.exec('qr'); - /^znk\d+$/.exec(''); - /^zva\d+$/.exec(''); - /^erfgber$/.exec(''); - re85.exec('zbqobkva zbqobk_abcnqqvat '); - re85.exec('zbqgvgyr'); - re85.exec('eaq_zbqobkva '); - re85.exec('eaq_zbqgvgyr '); - /frpgvba\d+_pbagragf/.exec('obggbz_ani'); - } - } - var re86 = /;\s*/; - var re87 = /(\$\{inyhr\})|(\$inyhr\b)/g; - var re88 = /(\$\{abj\})|(\$abj\b)/g; - var re89 = /\s+$/; - var re90 = /^\s+/; - var re91 = /(\\\"|\x00-|\x1f|\x7f-|\x9f|\u00ad|\u0600-|\u0604|\u070f|\u17b4|\u17b5|\u200c-|\u200f|\u2028-|\u202f|\u2060-|\u206f|\ufeff|\ufff0-|\uffff)/g; - var re92 = /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/; - var re93 = /^([:.#]*)((?:[\w\u0128-\uffff*_-]|\\.)+)/; - var re94 = /^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/; - var str77 = '#fubhgobk .pybfr'; - var str78 = 'FrffvbaQQS2=102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669341278771470&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_dfctwzssrwh-aowb_80=441326q33660'; - var str79 = 'FrffvbaQQS2=102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98; AFP_zp_dfctwzssrwh-aowb_80=441326q33660; __hgzm=144631658.1231365869.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.1670816052019209000.1231365869.1231365869.1231365869.1; __hgzo=144631658.0.10.1231365869; __hgzp=144631658; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669341278771470&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str80 = 'FrffvbaQQS2=9995p6rp12rrnr893334ro7nq70o7p64p69rqn844prs1473; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669350559478880&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_dfctwzs-aowb_80=441327q73660'; - var str81 = 'FrffvbaQQS2=9995p6rp12rrnr893334ro7nq70o7p64p69rqn844prs1473; AFP_zp_dfctwzs-aowb_80=441327q73660; __hgzm=144631658.1231367054.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.1796080716621419500.1231367054.1231367054.1231367054.1; __hgzo=144631658.0.10.1231367054; __hgzp=144631658; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669350559478880&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str82 = '[glcr=fhozvg]'; - var str83 = 'n.svryqOga,n.svryqOgaPnapry'; - var str84 = 'n.svryqOgaPnapry'; - var str85 = 'oyvpxchaxg'; - var str86 = 'qvi.bow-nppbeqvba qg'; - var str87 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_nccf_wf&qg=1231367052227&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231367052227&punaary=svz_zlfcnpr_nccf-pnainf%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Scebsvyr.zlfcnpr.pbz%2SZbqhyrf%2SNccyvpngvbaf%2SCntrf%2SPnainf.nfck&nq_glcr=grkg&rvq=6083027&rn=0&sez=1&tn_ivq=716357910.1231367056&tn_fvq=1231367056&tn_uvq=1387206491&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; - var str88 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231365851658&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231365851658&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Scebsvyrrqvg.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1979828129.1231365855&tn_fvq=1231365855&tn_uvq=2085229649&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; - var str89 = 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55023338617756?[NDO]&aqu=1&g=7%2S0%2S2009%2014%3N12%3N47%203%20480&af=zfacbegny&cntrAnzr=HF%20UCZFSGJ&t=uggc%3N%2S%2Sjjj.zfa.pbz%2S&f=0k0&p=43835816&x=A&oj=994&ou=634&uc=A&{2}&[NDR]'; - var str90 = 'zrgn[anzr=nwnkHey]'; - var str91 = 'anpuevpugra'; - var str92 = 'b oS={\'oT\':1.1};x $8n(B){z(B!=o9)};x $S(B){O(!$8n(B))z A;O(B.4L)z\'T\';b S=7t B;O(S==\'2P\'&&B.p4){23(B.7f){12 1:z\'T\';12 3:z/\S/.2g(B.8M)?\'ox\':\'oh\'}}O(S==\'2P\'||S==\'x\'){23(B.nE){12 2V:z\'1O\';12 7I:z\'5a\';12 18:z\'4B\'}O(7t B.I==\'4F\'){O(B.3u)z\'pG\';O(B.8e)z\'1p\'}}z S};x $2p(){b 4E={};Z(b v=0;v<1p.I;v++){Z(b X 1o 1p[v]){b nc=1p[v][X];b 6E=4E[X];O(6E&&$S(nc)==\'2P\'&&$S(6E)==\'2P\')4E[X]=$2p(6E,nc);17 4E[X]=nc}}z 4E};b $E=7p.E=x(){b 1d=1p;O(!1d[1])1d=[p,1d[0]];Z(b X 1o 1d[1])1d[0][X]=1d[1][X];z 1d[0]};b $4D=7p.pJ=x(){Z(b v=0,y=1p.I;v<y;v++){1p[v].E=x(1J){Z(b 1I 1o 1J){O(!p.1Y[1I])p.1Y[1I]=1J[1I];O(!p[1I])p[1I]=$4D.6C(1I)}}}};$4D.6C=x(1I){z x(L){z p.1Y[1I].3H(L,2V.1Y.nV.1F(1p,1))}};$4D(7F,2V,6J,nb);b 3l=x(B){B=B||{};B.E=$E;z B};b pK=Y 3l(H);b pZ=Y 3l(C);C.6f=C.35(\'6f\')[0];x $2O(B){z!!(B||B===0)};x $5S(B,n8){z $8n(B)?B:n8};x $7K(3c,1m){z 1q.na(1q.7K()*(1m-3c+1)+3c)};x $3N(){z Y 97().os()};x $4M(1U){pv(1U);pa(1U);z 1S};H.43=!!(C.5Z);O(H.nB)H.31=H[H.7q?\'py\':\'nL\']=1r;17 O(C.9N&&!C.om&&!oy.oZ)H.pF=H.4Z=H[H.43?\'pt\':\'65\']=1r;17 O(C.po!=1S)H.7J=1r;O(7t 5B==\'o9\'){b 5B=x(){};O(H.4Z)C.nd("pW");5B.1Y=(H.4Z)?H["[[oN.1Y]]"]:{}}5B.1Y.4L=1r;O(H.nL)5s{C.oX("pp",A,1r)}4K(r){};b 18=x(1X){b 63=x(){z(1p[0]!==1S&&p.1w&&$S(p.1w)==\'x\')?p.1w.3H(p,1p):p};$E(63,p);63.1Y=1X;63.nE=18;z 63};18.1z=x(){};18.1Y={E:x(1X){b 7x=Y p(1S);Z(b X 1o 1X){b nC=7x[X];7x[X]=18.nY(nC,1X[X])}z Y 18(7x)},3d:x(){Z(b v=0,y=1p.I;v<y;v++)$E(p.1Y,1p[v])}};18.nY=x(2b,2n){O(2b&&2b!=2n){b S=$S(2n);O(S!=$S(2b))z 2n;23(S){12\'x\':b 7R=x(){p.1e=1p.8e.1e;z 2n.3H(p,1p)};7R.1e=2b;z 7R;12\'2P\':z $2p(2b,2n)}}z 2n};b 8o=Y 18({oQ:x(J){p.4w=p.4w||[];p.4w.1x(J);z p},7g:x(){O(p.4w&&p.4w.I)p.4w.9J().2x(10,p)},oP:x(){p.4w=[]}});b 2d=Y 18({1V:x(S,J){O(J!=18.1z){p.$19=p.$19||{};p.$19[S]=p.$19[S]||[];p.$19[S].5j(J)}z p},1v:x(S,1d,2x){O(p.$19&&p.$19[S]){p.$19[S].1b(x(J){J.3n({\'L\':p,\'2x\':2x,\'1p\':1d})()},p)}z p},3M:x(S,J){O(p.$19&&p.$19[S])p.$19[S].2U(J);z p}});b 4v=Y 18({2H:x(){p.P=$2p.3H(1S,[p.P].E(1p));O(!p.1V)z p;Z(b 3O 1o p.P){O($S(p.P[3O]==\'x\')&&3O.2g(/^5P[N-M]/))p.1V(3O,p.P[3O])}z p}});2V.E({7y:x(J,L){Z(b v=0,w=p.I;v<w;v++)J.1F(L,p[v],v,p)},3s:x(J,L){b 54=[];Z(b v=0,w=p.I;v<w;v++){O(J.1F(L,p[v],v,p))54.1x(p[v])}z 54},2X:x(J,L){b 54=[];Z(b v=0,w=p.I;v<w;v++)54[v]=J.1F(L,p[v],v,p);z 54},4i:x(J,L){Z(b v=0,w=p.I;v<w;v++){O(!J.1F(L,p[v],v,p))z A}z 1r},ob:x(J,L){Z(b v=0,w=p.I;v<w;v++){O(J.1F(L,p[v],v,p))z 1r}z A},3F:x(3u,15){b 3A=p.I;Z(b v=(15<0)?1q.1m(0,3A+15):15||0;v<3A;v++){O(p[v]===3u)z v}z-1},8z:x(1u,I){1u=1u||0;O(1u<0)1u=p.I+1u;I=I||(p.I-1u);b 89=[];Z(b v=0;v<I;v++)89[v]=p[1u++];z 89},2U:x(3u){b v=0;b 3A=p.I;6L(v<3A){O(p[v]===3u){p.6l(v,1);3A--}17{v++}}z p},1y:x(3u,15){z p.3F(3u,15)!=-1},oz:x(1C){b B={},I=1q.3c(p.I,1C.I);Z(b v=0;v<I;v++)B[1C[v]]=p[v];z B},E:x(1O){Z(b v=0,w=1O.I;v<w;v++)p.1x(1O[v]);z p},2p:x(1O){Z(b v=0,y=1O.I;v<y;v++)p.5j(1O[v]);z p},5j:x(3u){O(!p.1y(3u))p.1x(3u);z p},oc:x(){z p[$7K(0,p.I-1)]||A},7L:x(){z p[p.I-1]||A}});2V.1Y.1b=2V.1Y.7y;2V.1Y.2g=2V.1Y.1y;x $N(1O){z 2V.8z(1O)};x $1b(3J,J,L){O(3J&&7t 3J.I==\'4F\'&&$S(3J)!=\'2P\')2V.7y(3J,J,L);17 Z(b 1j 1o 3J)J.1F(L||3J,3J[1j],1j)};6J.E({2g:x(6b,2F){z(($S(6b)==\'2R\')?Y 7I(6b,2F):6b).2g(p)},3p:x(){z 5K(p,10)},o4:x(){z 69(p)},7A:x(){z p.3y(/-\D/t,x(2G){z 2G.7G(1).nW()})},9b:x(){z p.3y(/\w[N-M]/t,x(2G){z(2G.7G(0)+\'-\'+2G.7G(1).5O())})},8V:x(){z p.3y(/\b[n-m]/t,x(2G){z 2G.nW()})},5L:x(){z p.3y(/^\s+|\s+$/t,\'\')},7j:x(){z p.3y(/\s{2,}/t,\' \').5L()},5V:x(1O){b 1i=p.2G(/\d{1,3}/t);z(1i)?1i.5V(1O):A},5U:x(1O){b 3P=p.2G(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);z(3P)?3P.nV(1).5U(1O):A},1y:x(2R,f){z(f)?(f+p+f).3F(f+2R+f)>-1:p.3F(2R)>-1},nX:x(){z p.3y(/([.*+?^${}()|[\]\/\\])/t,\'\\$1\')}});2V.E({5V:x(1O){O(p.I<3)z A;O(p.I==4&&p[3]==0&&!1O)z\'p5\';b 3P=[];Z(b v=0;v<3;v++){b 52=(p[v]-0).4h(16);3P.1x((52.I==1)?\'0\'+52:52)}z 1O?3P:\'#\'+3P.2u(\'\')},5U:x(1O){O(p.I!=3)z A;b 1i=[];Z(b v=0;v<3;v++){1i.1x(5K((p[v].I==1)?p[v]+p[v]:p[v],16))}z 1O?1i:\'1i(\'+1i.2u(\',\')+\')\'}});7F.E({3n:x(P){b J=p;P=$2p({\'L\':J,\'V\':A,\'1p\':1S,\'2x\':A,\'4s\':A,\'6W\':A},P);O($2O(P.1p)&&$S(P.1p)!=\'1O\')P.1p=[P.1p];z x(V){b 1d;O(P.V){V=V||H.V;1d=[(P.V===1r)?V:Y P.V(V)];O(P.1p)1d.E(P.1p)}17 1d=P.1p||1p;b 3C=x(){z J.3H($5S(P'; - var str93 = 'hagreunyghat'; - var str94 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669341278771470&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str95 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669350559478880&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; - var str96 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669341278771470&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; - var str97 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669350559478880&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; - var str98 = 'shapgvba (){Cuk.Nccyvpngvba.Frghc.Pber();Cuk.Nccyvpngvba.Frghc.Nwnk();Cuk.Nccyvpngvba.Frghc.Synfu();Cuk.Nccyvpngvba.Frghc.Zbqhyrf()}'; - function runBlock11() { - for (var i = 0; i < 2; i++) { - ' .pybfr'.replace(re18, ''); - ' n.svryqOgaPnapry'.replace(re18, ''); - ' qg'.replace(re18, ''); - str77.replace(re68, ''); - str77.replace(re18, ''); - ''.replace(re39, ''); - ''.replace(/^/, ''); - ''.split(re86); - '*'.replace(re39, ''); - '*'.replace(re68, ''); - '*'.replace(re18, ''); - '.pybfr'.replace(re68, ''); - '.pybfr'.replace(re18, ''); - '//vzt.jro.qr/vij/FC/tzk_uc/fperra/${inyhr}?gf=${abj}'.replace(re87, ''); - '//vzt.jro.qr/vij/FC/tzk_uc/fperra/1024?gf=${abj}'.replace(re88, ''); - '//vzt.jro.qr/vij/FC/tzk_uc/jvafvmr/${inyhr}?gf=${abj}'.replace(re87, ''); - '//vzt.jro.qr/vij/FC/tzk_uc/jvafvmr/992/608?gf=${abj}'.replace(re88, ''); - '300k120'.replace(re30, ''); - '300k250'.replace(re30, ''); - '310k120'.replace(re30, ''); - '310k170'.replace(re30, ''); - '310k250'.replace(re30, ''); - '9.0 e115'.replace(/^.*\.(.*)\s.*$/, ''); - 'Nppbeqvba'.replace(re2, ''); - 'Nxghryy\x0a'.replace(re89, ''); - 'Nxghryy\x0a'.replace(re90, ''); - 'Nccyvpngvba'.replace(re2, ''); - 'Oyvpxchaxg\x0a'.replace(re89, ''); - 'Oyvpxchaxg\x0a'.replace(re90, ''); - 'Svanamra\x0a'.replace(re89, ''); - 'Svanamra\x0a'.replace(re90, ''); - 'Tnzrf\x0a'.replace(re89, ''); - 'Tnzrf\x0a'.replace(re90, ''); - 'Ubebfxbc\x0a'.replace(re89, ''); - 'Ubebfxbc\x0a'.replace(re90, ''); - 'Xvab\x0a'.replace(re89, ''); - 'Xvab\x0a'.replace(re90, ''); - 'Zbqhyrf'.replace(re2, ''); - 'Zhfvx\x0a'.replace(re89, ''); - 'Zhfvx\x0a'.replace(re90, ''); - 'Anpuevpugra\x0a'.replace(re89, ''); - 'Anpuevpugra\x0a'.replace(re90, ''); - 'Cuk'.replace(re2, ''); - 'ErdhrfgSvavfu'.split(re70); - 'ErdhrfgSvavfu.NWNK.Cuk'.split(re70); - 'Ebhgr\x0a'.replace(re89, ''); - 'Ebhgr\x0a'.replace(re90, ''); - str78.split(re32); - str79.split(re32); - str80.split(re32); - str81.split(re32); - 'Fcbeg\x0a'.replace(re89, ''); - 'Fcbeg\x0a'.replace(re90, ''); - 'GI-Fcbg\x0a'.replace(re89, ''); - 'GI-Fcbg\x0a'.replace(re90, ''); - 'Gbhe\x0a'.replace(re89, ''); - 'Gbhe\x0a'.replace(re90, ''); - 'Hagreunyghat\x0a'.replace(re89, ''); - 'Hagreunyghat\x0a'.replace(re90, ''); - 'Ivqrb\x0a'.replace(re89, ''); - 'Ivqrb\x0a'.replace(re90, ''); - 'Jrggre\x0a'.replace(re89, ''); - 'Jrggre\x0a'.replace(re90, ''); - str82.replace(re68, ''); - str82.replace(re18, ''); - str83.replace(re68, ''); - str83.replace(re18, ''); - str84.replace(re68, ''); - str84.replace(re18, ''); - 'nqiFreivprObk'.replace(re30, ''); - 'nqiFubccvatObk'.replace(re30, ''); - 'nwnk'.replace(re39, ''); - 'nxghryy'.replace(re40, ''); - 'nxghryy'.replace(re41, ''); - 'nxghryy'.replace(re42, ''); - 'nxghryy'.replace(re43, ''); - 'nxghryy'.replace(re44, ''); - 'nxghryy'.replace(re45, ''); - 'nxghryy'.replace(re46, ''); - 'nxghryy'.replace(re47, ''); - 'nxghryy'.replace(re48, ''); - str85.replace(re40, ''); - str85.replace(re41, ''); - str85.replace(re42, ''); - str85.replace(re43, ''); - str85.replace(re44, ''); - str85.replace(re45, ''); - str85.replace(re46, ''); - str85.replace(re47, ''); - str85.replace(re48, ''); - 'pngrtbel'.replace(re29, ''); - 'pngrtbel'.replace(re30, ''); - 'pybfr'.replace(re39, ''); - 'qvi'.replace(re39, ''); - str86.replace(re68, ''); - str86.replace(re18, ''); - 'qg'.replace(re39, ''); - 'qg'.replace(re68, ''); - 'qg'.replace(re18, ''); - 'rzorq'.replace(re39, ''); - 'rzorq'.replace(re68, ''); - 'rzorq'.replace(re18, ''); - 'svryqOga'.replace(re39, ''); - 'svryqOgaPnapry'.replace(re39, ''); - 'svz_zlfcnpr_nccf-pnainf,svz_zlfcnpr_havgrq-fgngrf'.split(re20); - 'svanamra'.replace(re40, ''); - 'svanamra'.replace(re41, ''); - 'svanamra'.replace(re42, ''); - 'svanamra'.replace(re43, ''); - 'svanamra'.replace(re44, ''); - 'svanamra'.replace(re45, ''); - 'svanamra'.replace(re46, ''); - 'svanamra'.replace(re47, ''); - 'svanamra'.replace(re48, ''); - 'sbphf'.split(re70); - 'sbphf.gno sbphfva.gno'.split(re70); - 'sbphfva'.split(re70); - 'sbez'.replace(re39, ''); - 'sbez.nwnk'.replace(re68, ''); - 'sbez.nwnk'.replace(re18, ''); - 'tnzrf'.replace(re40, ''); - 'tnzrf'.replace(re41, ''); - 'tnzrf'.replace(re42, ''); - 'tnzrf'.replace(re43, ''); - 'tnzrf'.replace(re44, ''); - 'tnzrf'.replace(re45, ''); - 'tnzrf'.replace(re46, ''); - 'tnzrf'.replace(re47, ''); - 'tnzrf'.replace(re48, ''); - 'ubzrcntr'.replace(re30, ''); - 'ubebfxbc'.replace(re40, ''); - 'ubebfxbc'.replace(re41, ''); - 'ubebfxbc'.replace(re42, ''); - 'ubebfxbc'.replace(re43, ''); - 'ubebfxbc'.replace(re44, ''); - 'ubebfxbc'.replace(re45, ''); - 'ubebfxbc'.replace(re46, ''); - 'ubebfxbc'.replace(re47, ''); - 'ubebfxbc'.replace(re48, ''); - 'uc_cebzbobk_ugzy%2Puc_cebzbobk_vzt'.replace(re30, ''); - 'uc_erpgnatyr'.replace(re30, ''); - str87.replace(re33, ''); - str88.replace(re33, ''); - 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf${4}${5}'.replace(re71, ''); - 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf${5}'.replace(re72, ''); - 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/qlaYvo.wf${4}${5}'.replace(re71, ''); - 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/qlaYvo.wf${5}'.replace(re72, ''); - 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/rssrpgYvo.wf${4}${5}'.replace(re71, ''); - 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/rssrpgYvo.wf${5}'.replace(re72, ''); - str89.replace(re73, ''); - 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55023338617756?[NDO]&{1}&{2}&[NDR]'.replace(re69, ''); - str6.replace(re23, ''); - 'xvab'.replace(re40, ''); - 'xvab'.replace(re41, ''); - 'xvab'.replace(re42, ''); - 'xvab'.replace(re43, ''); - 'xvab'.replace(re44, ''); - 'xvab'.replace(re45, ''); - 'xvab'.replace(re46, ''); - 'xvab'.replace(re47, ''); - 'xvab'.replace(re48, ''); - 'ybnq'.split(re70); - 'zrqvnzbqgno lhv-anifrg lhv-anifrg-gbc'.replace(re18, ''); - 'zrgn'.replace(re39, ''); - str90.replace(re68, ''); - str90.replace(re18, ''); - 'zbhfrzbir'.split(re70); - 'zbhfrzbir.gno'.split(re70); - str63.replace(/^.*jroxvg\/(\d+(\.\d+)?).*$/, ''); - 'zhfvx'.replace(re40, ''); - 'zhfvx'.replace(re41, ''); - 'zhfvx'.replace(re42, ''); - 'zhfvx'.replace(re43, ''); - 'zhfvx'.replace(re44, ''); - 'zhfvx'.replace(re45, ''); - 'zhfvx'.replace(re46, ''); - 'zhfvx'.replace(re47, ''); - 'zhfvx'.replace(re48, ''); - 'zlfcnpr_nccf_pnainf'.replace(re52, ''); - str91.replace(re40, ''); - str91.replace(re41, ''); - str91.replace(re42, ''); - str91.replace(re43, ''); - str91.replace(re44, ''); - str91.replace(re45, ''); - str91.replace(re46, ''); - str91.replace(re47, ''); - str91.replace(re48, ''); - 'anzr'.replace(re39, ''); - str92.replace(/\b\w+\b/g, ''); - 'bow-nppbeqvba'.replace(re39, ''); - 'bowrpg'.replace(re39, ''); - 'bowrpg'.replace(re68, ''); - 'bowrpg'.replace(re18, ''); - 'cnenzf%2Rfglyrf'.replace(re29, ''); - 'cnenzf%2Rfglyrf'.replace(re30, ''); - 'cbchc'.replace(re30, ''); - 'ebhgr'.replace(re40, ''); - 'ebhgr'.replace(re41, ''); - 'ebhgr'.replace(re42, ''); - 'ebhgr'.replace(re43, ''); - 'ebhgr'.replace(re44, ''); - 'ebhgr'.replace(re45, ''); - 'ebhgr'.replace(re46, ''); - 'ebhgr'.replace(re47, ''); - 'ebhgr'.replace(re48, ''); - 'freivprobk_uc'.replace(re30, ''); - 'fubccvatobk_uc'.replace(re30, ''); - 'fubhgobk'.replace(re39, ''); - 'fcbeg'.replace(re40, ''); - 'fcbeg'.replace(re41, ''); - 'fcbeg'.replace(re42, ''); - 'fcbeg'.replace(re43, ''); - 'fcbeg'.replace(re44, ''); - 'fcbeg'.replace(re45, ''); - 'fcbeg'.replace(re46, ''); - 'fcbeg'.replace(re47, ''); - 'fcbeg'.replace(re48, ''); - 'gbhe'.replace(re40, ''); - 'gbhe'.replace(re41, ''); - 'gbhe'.replace(re42, ''); - 'gbhe'.replace(re43, ''); - 'gbhe'.replace(re44, ''); - 'gbhe'.replace(re45, ''); - 'gbhe'.replace(re46, ''); - 'gbhe'.replace(re47, ''); - 'gbhe'.replace(re48, ''); - 'gi-fcbg'.replace(re40, ''); - 'gi-fcbg'.replace(re41, ''); - 'gi-fcbg'.replace(re42, ''); - 'gi-fcbg'.replace(re43, ''); - 'gi-fcbg'.replace(re44, ''); - 'gi-fcbg'.replace(re45, ''); - 'gi-fcbg'.replace(re46, ''); - 'gi-fcbg'.replace(re47, ''); - 'gi-fcbg'.replace(re48, ''); - 'glcr'.replace(re39, ''); - 'haqrsvarq'.replace(/\//g, ''); - str93.replace(re40, ''); - str93.replace(re41, ''); - str93.replace(re42, ''); - str93.replace(re43, ''); - str93.replace(re44, ''); - str93.replace(re45, ''); - str93.replace(re46, ''); - str93.replace(re47, ''); - str93.replace(re48, ''); - 'ivqrb'.replace(re40, ''); - 'ivqrb'.replace(re41, ''); - 'ivqrb'.replace(re42, ''); - 'ivqrb'.replace(re43, ''); - 'ivqrb'.replace(re44, ''); - 'ivqrb'.replace(re45, ''); - 'ivqrb'.replace(re46, ''); - 'ivqrb'.replace(re47, ''); - 'ivqrb'.replace(re48, ''); - 'ivfvgf=1'.split(re86); - 'jrggre'.replace(re40, ''); - 'jrggre'.replace(re41, ''); - 'jrggre'.replace(re42, ''); - 'jrggre'.replace(re43, ''); - 'jrggre'.replace(re44, ''); - 'jrggre'.replace(re45, ''); - 'jrggre'.replace(re46, ''); - 'jrggre'.replace(re47, ''); - 'jrggre'.replace(re48, ''); - /#[a-z0-9]+$/i.exec('uggc://jjj.fpuhryreim.arg/Qrsnhyg'); - re66.exec('fryrpgrq'); - /(?:^|\s+)lhv-ani(?:\s+|$)/.exec('sff lhv-ani'); - /(?:^|\s+)lhv-anifrg(?:\s+|$)/.exec('zrqvnzbqgno lhv-anifrg'); - /(?:^|\s+)lhv-anifrg-gbc(?:\s+|$)/.exec('zrqvnzbqgno lhv-anifrg'); - re91.exec('GnoThvq'); - re91.exec('thvq'); - /(pbzcngvoyr|jroxvg)/.exec(str63); - /.+(?:ei|vg|en|vr)[\/: ]([\d.]+)/.exec(str63); - re8.exec('144631658.0.10.1231365869'); - re8.exec('144631658.0.10.1231367054'); - re8.exec('144631658.1231365869.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re8.exec('144631658.1231367054.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re8.exec('144631658.1670816052019209000.1231365869.1231365869.1231365869.1'); - re8.exec('144631658.1796080716621419500.1231367054.1231367054.1231367054.1'); - re8.exec(str94); - re8.exec(str95); - re8.exec(str96); - re8.exec(str97); - re8.exec('__hgzn=144631658.1670816052019209000.1231365869.1231365869.1231365869.1'); - re8.exec('__hgzn=144631658.1796080716621419500.1231367054.1231367054.1231367054.1'); - re8.exec('__hgzo=144631658.0.10.1231365869'); - re8.exec('__hgzo=144631658.0.10.1231367054'); - re8.exec('__hgzm=144631658.1231365869.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re8.exec('__hgzm=144631658.1231367054.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); - re34.exec(str78); - re34.exec(str79); - re34.exec(str81); - re74.exec(str77); - re74.exec('*'); - re74.exec(str82); - re74.exec(str83); - re74.exec(str86); - re74.exec('rzorq'); - re74.exec('sbez.nwnk'); - re74.exec(str90); - re74.exec('bowrpg'); - /\/onfr.wf(\?.+)?$/.exec('/uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf'); - re28.exec('uvag ynfgUvag ynfg'); - re75.exec(''); - re76.exec(''); - re77.exec(''); - re78.exec(''); - re80.exec(str77); - re80.exec('*'); - re80.exec('.pybfr'); - re80.exec(str82); - re80.exec(str83); - re80.exec(str84); - re80.exec(str86); - re80.exec('qg'); - re80.exec('rzorq'); - re80.exec('sbez.nwnk'); - re80.exec(str90); - re80.exec('bowrpg'); - re61.exec('qlaYvo.wf'); - re61.exec('rssrpgYvo.wf'); - re61.exec('uggc://jjj.tzk.arg/qr/?fgnghf=uvajrvf'); - re92.exec(' .pybfr'); - re92.exec(' n.svryqOgaPnapry'); - re92.exec(' qg'); - re92.exec(str48); - re92.exec('.nwnk'); - re92.exec('.svryqOga,n.svryqOgaPnapry'); - re92.exec('.svryqOgaPnapry'); - re92.exec('.bow-nppbeqvba qg'); - re68.exec(str77); - re68.exec('*'); - re68.exec('.pybfr'); - re68.exec(str82); - re68.exec(str83); - re68.exec(str84); - re68.exec(str86); - re68.exec('qg'); - re68.exec('rzorq'); - re68.exec('sbez.nwnk'); - re68.exec(str90); - re68.exec('bowrpg'); - re93.exec(' .pybfr'); - re93.exec(' n.svryqOgaPnapry'); - re93.exec(' qg'); - re93.exec(str48); - re93.exec('.nwnk'); - re93.exec('.svryqOga,n.svryqOgaPnapry'); - re93.exec('.svryqOgaPnapry'); - re93.exec('.bow-nppbeqvba qg'); - re81.exec(str77); - re81.exec('*'); - re81.exec(str48); - re81.exec('.pybfr'); - re81.exec(str82); - re81.exec(str83); - re81.exec(str84); - re81.exec(str86); - re81.exec('qg'); - re81.exec('rzorq'); - re81.exec('sbez.nwnk'); - re81.exec(str90); - re81.exec('bowrpg'); - re94.exec(' .pybfr'); - re94.exec(' n.svryqOgaPnapry'); - re94.exec(' qg'); - re94.exec(str48); - re94.exec('.nwnk'); - re94.exec('.svryqOga,n.svryqOgaPnapry'); - re94.exec('.svryqOgaPnapry'); - re94.exec('.bow-nppbeqvba qg'); - re94.exec('[anzr=nwnkHey]'); - re94.exec(str82); - re31.exec('rf'); - re31.exec('wn'); - re82.exec(str77); - re82.exec('*'); - re82.exec(str48); - re82.exec('.pybfr'); - re82.exec(str82); - re82.exec(str83); - re82.exec(str84); - re82.exec(str86); - re82.exec('qg'); - re82.exec('rzorq'); - re82.exec('sbez.nwnk'); - re82.exec(str90); - re82.exec('bowrpg'); - re83.exec(str98); - re83.exec('shapgvba sbphf() { [angvir pbqr] }'); - re62.exec('#Ybtva'); - re62.exec('#Ybtva_cnffjbeq'); - re62.exec(str77); - re62.exec('#fubhgobkWf'); - re62.exec('#fubhgobkWfReebe'); - re62.exec('#fubhgobkWfFhpprff'); - re62.exec('*'); - re62.exec(str82); - re62.exec(str83); - re62.exec(str86); - re62.exec('rzorq'); - re62.exec('sbez.nwnk'); - re62.exec(str90); - re62.exec('bowrpg'); - re49.exec('pbagrag'); - re24.exec(str6); - /xbadhrebe/.exec(str63); - /znp/.exec('jva32'); - /zbmvyyn/.exec(str63); - /zfvr/.exec(str63); - /ag\s5\.1/.exec(str63); - /bcren/.exec(str63); - /fnsnev/.exec(str63); - /jva/.exec('jva32'); - /jvaqbjf/.exec(str63); - } - } - for (var i = 0; i < 5; i++) { - runBlock0(); - runBlock1(); - runBlock2(); - runBlock3(); - runBlock4(); - runBlock5(); - runBlock6(); - runBlock7(); - runBlock8(); - runBlock9(); - runBlock10(); - runBlock11(); - } -} - -for (var i = 0; i < 3; ++i) - runRegExpBenchmark(); diff --git a/implementation-contributed/javascriptcore/stress/v8-richards-strict.js b/implementation-contributed/javascriptcore/stress/v8-richards-strict.js deleted file mode 100644 index 11fdc5bf28..0000000000 --- a/implementation-contributed/javascriptcore/stress/v8-richards-strict.js +++ /dev/null @@ -1,539 +0,0 @@ -"use strict"; - -// Copyright 2006-2008 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. - - -// This is a JavaScript implementation of the Richards -// benchmark from: -// -// http://www.cl.cam.ac.uk/~mr10/Bench.html -// -// The benchmark was originally implemented in BCPL by -// Martin Richards. - - -/** - * The Richards benchmark simulates the task dispatcher of an - * operating system. - **/ -function runRichards() { - var scheduler = new Scheduler(); - scheduler.addIdleTask(ID_IDLE, 0, null, COUNT); - - var queue = new Packet(null, ID_WORKER, KIND_WORK); - queue = new Packet(queue, ID_WORKER, KIND_WORK); - scheduler.addWorkerTask(ID_WORKER, 1000, queue); - - queue = new Packet(null, ID_DEVICE_A, KIND_DEVICE); - queue = new Packet(queue, ID_DEVICE_A, KIND_DEVICE); - queue = new Packet(queue, ID_DEVICE_A, KIND_DEVICE); - scheduler.addHandlerTask(ID_HANDLER_A, 2000, queue); - - queue = new Packet(null, ID_DEVICE_B, KIND_DEVICE); - queue = new Packet(queue, ID_DEVICE_B, KIND_DEVICE); - queue = new Packet(queue, ID_DEVICE_B, KIND_DEVICE); - scheduler.addHandlerTask(ID_HANDLER_B, 3000, queue); - - scheduler.addDeviceTask(ID_DEVICE_A, 4000, null); - - scheduler.addDeviceTask(ID_DEVICE_B, 5000, null); - - scheduler.schedule(); - - if (scheduler.queueCount != EXPECTED_QUEUE_COUNT || - scheduler.holdCount != EXPECTED_HOLD_COUNT) { - var msg = - "Error during execution: queueCount = " + scheduler.queueCount + - ", holdCount = " + scheduler.holdCount + "."; - throw new Error(msg); - } -} - -var COUNT = 1000; - -/** - * These two constants specify how many times a packet is queued and - * how many times a task is put on hold in a correct run of richards. - * They don't have any meaning a such but are characteristic of a - * correct run so if the actual queue or hold count is different from - * the expected there must be a bug in the implementation. - **/ -var EXPECTED_QUEUE_COUNT = 2322; -var EXPECTED_HOLD_COUNT = 928; - - -/** - * A scheduler can be used to schedule a set of tasks based on their relative - * priorities. Scheduling is done by maintaining a list of task control blocks - * which holds tasks and the data queue they are processing. - * @constructor - */ -function Scheduler() { - this.queueCount = 0; - this.holdCount = 0; - this.blocks = new Array(NUMBER_OF_IDS); - this.list = null; - this.currentTcb = null; - this.currentId = null; -} - -var ID_IDLE = 0; -var ID_WORKER = 1; -var ID_HANDLER_A = 2; -var ID_HANDLER_B = 3; -var ID_DEVICE_A = 4; -var ID_DEVICE_B = 5; -var NUMBER_OF_IDS = 6; - -var KIND_DEVICE = 0; -var KIND_WORK = 1; - -/** - * Add an idle task to this scheduler. - * @param {int} id the identity of the task - * @param {int} priority the task's priority - * @param {Packet} queue the queue of work to be processed by the task - * @param {int} count the number of times to schedule the task - */ -Scheduler.prototype.addIdleTask = function (id, priority, queue, count) { - this.addRunningTask(id, priority, queue, new IdleTask(this, 1, count)); -}; - -/** - * Add a work task to this scheduler. - * @param {int} id the identity of the task - * @param {int} priority the task's priority - * @param {Packet} queue the queue of work to be processed by the task - */ -Scheduler.prototype.addWorkerTask = function (id, priority, queue) { - this.addTask(id, priority, queue, new WorkerTask(this, ID_HANDLER_A, 0)); -}; - -/** - * Add a handler task to this scheduler. - * @param {int} id the identity of the task - * @param {int} priority the task's priority - * @param {Packet} queue the queue of work to be processed by the task - */ -Scheduler.prototype.addHandlerTask = function (id, priority, queue) { - this.addTask(id, priority, queue, new HandlerTask(this)); -}; - -/** - * Add a handler task to this scheduler. - * @param {int} id the identity of the task - * @param {int} priority the task's priority - * @param {Packet} queue the queue of work to be processed by the task - */ -Scheduler.prototype.addDeviceTask = function (id, priority, queue) { - this.addTask(id, priority, queue, new DeviceTask(this)) -}; - -/** - * Add the specified task and mark it as running. - * @param {int} id the identity of the task - * @param {int} priority the task's priority - * @param {Packet} queue the queue of work to be processed by the task - * @param {Task} task the task to add - */ -Scheduler.prototype.addRunningTask = function (id, priority, queue, task) { - this.addTask(id, priority, queue, task); - this.currentTcb.setRunning(); -}; - -/** - * Add the specified task to this scheduler. - * @param {int} id the identity of the task - * @param {int} priority the task's priority - * @param {Packet} queue the queue of work to be processed by the task - * @param {Task} task the task to add - */ -Scheduler.prototype.addTask = function (id, priority, queue, task) { - this.currentTcb = new TaskControlBlock(this.list, id, priority, queue, task); - this.list = this.currentTcb; - this.blocks[id] = this.currentTcb; -}; - -/** - * Execute the tasks managed by this scheduler. - */ -Scheduler.prototype.schedule = function () { - this.currentTcb = this.list; - while (this.currentTcb != null) { - if (this.currentTcb.isHeldOrSuspended()) { - this.currentTcb = this.currentTcb.link; - } else { - this.currentId = this.currentTcb.id; - this.currentTcb = this.currentTcb.run(); - } - } -}; - -/** - * Release a task that is currently blocked and return the next block to run. - * @param {int} id the id of the task to suspend - */ -Scheduler.prototype.release = function (id) { - var tcb = this.blocks[id]; - if (tcb == null) return tcb; - tcb.markAsNotHeld(); - if (tcb.priority > this.currentTcb.priority) { - return tcb; - } else { - return this.currentTcb; - } -}; - -/** - * Block the currently executing task and return the next task control block - * to run. The blocked task will not be made runnable until it is explicitly - * released, even if new work is added to it. - */ -Scheduler.prototype.holdCurrent = function () { - this.holdCount++; - this.currentTcb.markAsHeld(); - return this.currentTcb.link; -}; - -/** - * Suspend the currently executing task and return the next task control block - * to run. If new work is added to the suspended task it will be made runnable. - */ -Scheduler.prototype.suspendCurrent = function () { - this.currentTcb.markAsSuspended(); - return this.currentTcb; -}; - -/** - * Add the specified packet to the end of the worklist used by the task - * associated with the packet and make the task runnable if it is currently - * suspended. - * @param {Packet} packet the packet to add - */ -Scheduler.prototype.queue = function (packet) { - var t = this.blocks[packet.id]; - if (t == null) return t; - this.queueCount++; - packet.link = null; - packet.id = this.currentId; - return t.checkPriorityAdd(this.currentTcb, packet); -}; - -/** - * A task control block manages a task and the queue of work packages associated - * with it. - * @param {TaskControlBlock} link the preceding block in the linked block list - * @param {int} id the id of this block - * @param {int} priority the priority of this block - * @param {Packet} queue the queue of packages to be processed by the task - * @param {Task} task the task - * @constructor - */ -function TaskControlBlock(link, id, priority, queue, task) { - this.link = link; - this.id = id; - this.priority = priority; - this.queue = queue; - this.task = task; - if (queue == null) { - this.state = STATE_SUSPENDED; - } else { - this.state = STATE_SUSPENDED_RUNNABLE; - } -} - -/** - * The task is running and is currently scheduled. - */ -var STATE_RUNNING = 0; - -/** - * The task has packets left to process. - */ -var STATE_RUNNABLE = 1; - -/** - * The task is not currently running. The task is not blocked as such and may -* be started by the scheduler. - */ -var STATE_SUSPENDED = 2; - -/** - * The task is blocked and cannot be run until it is explicitly released. - */ -var STATE_HELD = 4; - -var STATE_SUSPENDED_RUNNABLE = STATE_SUSPENDED | STATE_RUNNABLE; -var STATE_NOT_HELD = ~STATE_HELD; - -TaskControlBlock.prototype.setRunning = function () { - this.state = STATE_RUNNING; -}; - -TaskControlBlock.prototype.markAsNotHeld = function () { - this.state = this.state & STATE_NOT_HELD; -}; - -TaskControlBlock.prototype.markAsHeld = function () { - this.state = this.state | STATE_HELD; -}; - -TaskControlBlock.prototype.isHeldOrSuspended = function () { - return (this.state & STATE_HELD) != 0 || (this.state == STATE_SUSPENDED); -}; - -TaskControlBlock.prototype.markAsSuspended = function () { - this.state = this.state | STATE_SUSPENDED; -}; - -TaskControlBlock.prototype.markAsRunnable = function () { - this.state = this.state | STATE_RUNNABLE; -}; - -/** - * Runs this task, if it is ready to be run, and returns the next task to run. - */ -TaskControlBlock.prototype.run = function () { - var packet; - if (this.state == STATE_SUSPENDED_RUNNABLE) { - packet = this.queue; - this.queue = packet.link; - if (this.queue == null) { - this.state = STATE_RUNNING; - } else { - this.state = STATE_RUNNABLE; - } - } else { - packet = null; - } - return this.task.run(packet); -}; - -/** - * Adds a packet to the worklist of this block's task, marks this as runnable if - * necessary, and returns the next runnable object to run (the one - * with the highest priority). - */ -TaskControlBlock.prototype.checkPriorityAdd = function (task, packet) { - if (this.queue == null) { - this.queue = packet; - this.markAsRunnable(); - if (this.priority > task.priority) return this; - } else { - this.queue = packet.addTo(this.queue); - } - return task; -}; - -TaskControlBlock.prototype.toString = function () { - return "tcb { " + this.task + "@" + this.state + " }"; -}; - -/** - * An idle task doesn't do any work itself but cycles control between the two - * device tasks. - * @param {Scheduler} scheduler the scheduler that manages this task - * @param {int} v1 a seed value that controls how the device tasks are scheduled - * @param {int} count the number of times this task should be scheduled - * @constructor - */ -function IdleTask(scheduler, v1, count) { - this.scheduler = scheduler; - this.v1 = v1; - this.count = count; -} - -IdleTask.prototype.run = function (packet) { - this.count--; - if (this.count == 0) return this.scheduler.holdCurrent(); - if ((this.v1 & 1) == 0) { - this.v1 = this.v1 >> 1; - return this.scheduler.release(ID_DEVICE_A); - } else { - this.v1 = (this.v1 >> 1) ^ 0xD008; - return this.scheduler.release(ID_DEVICE_B); - } -}; - -IdleTask.prototype.toString = function () { - return "IdleTask" -}; - -/** - * A task that suspends itself after each time it has been run to simulate - * waiting for data from an external device. - * @param {Scheduler} scheduler the scheduler that manages this task - * @constructor - */ -function DeviceTask(scheduler) { - this.scheduler = scheduler; - this.v1 = null; -} - -DeviceTask.prototype.run = function (packet) { - if (packet == null) { - if (this.v1 == null) return this.scheduler.suspendCurrent(); - var v = this.v1; - this.v1 = null; - return this.scheduler.queue(v); - } else { - this.v1 = packet; - return this.scheduler.holdCurrent(); - } -}; - -DeviceTask.prototype.toString = function () { - return "DeviceTask"; -}; - -/** - * A task that manipulates work packets. - * @param {Scheduler} scheduler the scheduler that manages this task - * @param {int} v1 a seed used to specify how work packets are manipulated - * @param {int} v2 another seed used to specify how work packets are manipulated - * @constructor - */ -function WorkerTask(scheduler, v1, v2) { - this.scheduler = scheduler; - this.v1 = v1; - this.v2 = v2; -} - -WorkerTask.prototype.run = function (packet) { - if (packet == null) { - return this.scheduler.suspendCurrent(); - } else { - if (this.v1 == ID_HANDLER_A) { - this.v1 = ID_HANDLER_B; - } else { - this.v1 = ID_HANDLER_A; - } - packet.id = this.v1; - packet.a1 = 0; - for (var i = 0; i < DATA_SIZE; i++) { - this.v2++; - if (this.v2 > 26) this.v2 = 1; - packet.a2[i] = this.v2; - } - return this.scheduler.queue(packet); - } -}; - -WorkerTask.prototype.toString = function () { - return "WorkerTask"; -}; - -/** - * A task that manipulates work packets and then suspends itself. - * @param {Scheduler} scheduler the scheduler that manages this task - * @constructor - */ -function HandlerTask(scheduler) { - this.scheduler = scheduler; - this.v1 = null; - this.v2 = null; -} - -HandlerTask.prototype.run = function (packet) { - if (packet != null) { - if (packet.kind == KIND_WORK) { - this.v1 = packet.addTo(this.v1); - } else { - this.v2 = packet.addTo(this.v2); - } - } - if (this.v1 != null) { - var count = this.v1.a1; - var v; - if (count < DATA_SIZE) { - if (this.v2 != null) { - v = this.v2; - this.v2 = this.v2.link; - v.a1 = this.v1.a2[count]; - this.v1.a1 = count + 1; - return this.scheduler.queue(v); - } - } else { - v = this.v1; - this.v1 = this.v1.link; - return this.scheduler.queue(v); - } - } - return this.scheduler.suspendCurrent(); -}; - -HandlerTask.prototype.toString = function () { - return "HandlerTask"; -}; - -/* --- * - * P a c k e t - * --- */ - -var DATA_SIZE = 4; - -/** - * A simple package of data that is manipulated by the tasks. The exact layout - * of the payload data carried by a packet is not importaint, and neither is the - * nature of the work performed on packets by the tasks. - * - * Besides carrying data, packets form linked lists and are hence used both as - * data and worklists. - * @param {Packet} link the tail of the linked list of packets - * @param {int} id an ID for this packet - * @param {int} kind the type of this packet - * @constructor - */ -function Packet(link, id, kind) { - this.link = link; - this.id = id; - this.kind = kind; - this.a1 = 0; - this.a2 = new Array(DATA_SIZE); -} - -/** - * Add this packet to the end of a worklist, and return the worklist. - * @param {Packet} queue the worklist to add this packet to - */ -Packet.prototype.addTo = function (queue) { - this.link = null; - if (queue == null) return this; - var peek, next = queue; - while ((peek = next.link) != null) - next = peek; - next.link = this; - return queue; -}; - -Packet.prototype.toString = function () { - return "Packet"; -}; - -for (var i = 0; i < 350; ++i) - runRichards(); diff --git a/implementation-contributed/javascriptcore/stress/v8-splay-strict.js b/implementation-contributed/javascriptcore/stress/v8-splay-strict.js deleted file mode 100644 index f3b377d0d7..0000000000 --- a/implementation-contributed/javascriptcore/stress/v8-splay-strict.js +++ /dev/null @@ -1,395 +0,0 @@ -"use strict"; - -// Copyright 2009 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. - -// This benchmark is based on a JavaScript log processing module used -// by the V8 profiler to generate execution time profiles for runs of -// JavaScript applications, and it effectively measures how fast the -// JavaScript engine is at allocating nodes and reclaiming the memory -// used for old nodes. Because of the way splay trees work, the engine -// also has to deal with a lot of changes to the large tree object -// graph. - -// Configuration. -var kSplayTreeSize = 8000; -var kSplayTreeModifications = 80; -var kSplayTreePayloadDepth = 5; - -var splayTree = null; - - -function GeneratePayloadTree(depth, tag) { - if (depth == 0) { - return { - array : [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], - string : 'String for key ' + tag + ' in leaf node' - }; - } else { - return { - left: GeneratePayloadTree(depth - 1, tag), - right: GeneratePayloadTree(depth - 1, tag) - }; - } -} - - -function GenerateKey() { - // The benchmark framework guarantees that Math.random is - // deterministic; see base.js. - return Math.random(); -} - - -function InsertNewNode() { - // Insert new node with a unique key. - var key; - do { - key = GenerateKey(); - } while (splayTree.find(key) != null); - var payload = GeneratePayloadTree(kSplayTreePayloadDepth, String(key)); - splayTree.insert(key, payload); - return key; -} - - - -function SplaySetup() { - splayTree = new SplayTree(); - for (var i = 0; i < kSplayTreeSize; i++) InsertNewNode(); -} - - -function SplayTearDown() { - // Allow the garbage collector to reclaim the memory - // used by the splay tree no matter how we exit the - // tear down function. - var keys = splayTree.exportKeys(); - splayTree = null; - - // Verify that the splay tree has the right size. - var length = keys.length; - if (length != kSplayTreeSize) { - throw new Error("Splay tree has wrong size"); - } - - // Verify that the splay tree has sorted, unique keys. - for (var i = 0; i < length - 1; i++) { - if (keys[i] >= keys[i + 1]) { - throw new Error("Splay tree not sorted"); - } - } -} - - -function SplayRun() { - // Replace a few nodes in the splay tree. - for (var i = 0; i < kSplayTreeModifications; i++) { - var key = InsertNewNode(); - var greatest = splayTree.findGreatestLessThan(key); - if (greatest == null) splayTree.remove(key); - else splayTree.remove(greatest.key); - } -} - - -/** - * Constructs a Splay tree. A splay tree is a self-balancing binary - * search tree with the additional property that recently accessed - * elements are quick to access again. It performs basic operations - * such as insertion, look-up and removal in O(log(n)) amortized time. - * - * @constructor - */ -function SplayTree() { -}; - - -/** - * Pointer to the root node of the tree. - * - * @type {SplayTree.Node} - * @private - */ -SplayTree.prototype.root_ = null; - - -/** - * @return {boolean} Whether the tree is empty. - */ -SplayTree.prototype.isEmpty = function() { - return !this.root_; -}; - - -/** - * Inserts a node into the tree with the specified key and value if - * the tree does not already contain a node with the specified key. If - * the value is inserted, it becomes the root of the tree. - * - * @param {number} key Key to insert into the tree. - * @param {*} value Value to insert into the tree. - */ -SplayTree.prototype.insert = function(key, value) { - if (this.isEmpty()) { - this.root_ = new SplayTree.Node(key, value); - return; - } - // Splay on the key to move the last node on the search path for - // the key to the root of the tree. - this.splay_(key); - if (this.root_.key == key) { - return; - } - var node = new SplayTree.Node(key, value); - if (key > this.root_.key) { - node.left = this.root_; - node.right = this.root_.right; - this.root_.right = null; - } else { - node.right = this.root_; - node.left = this.root_.left; - this.root_.left = null; - } - this.root_ = node; -}; - - -/** - * Removes a node with the specified key from the tree if the tree - * contains a node with this key. The removed node is returned. If the - * key is not found, an exception is thrown. - * - * @param {number} key Key to find and remove from the tree. - * @return {SplayTree.Node} The removed node. - */ -SplayTree.prototype.remove = function(key) { - if (this.isEmpty()) { - throw Error('Key not found: ' + key); - } - this.splay_(key); - if (this.root_.key != key) { - throw Error('Key not found: ' + key); - } - var removed = this.root_; - if (!this.root_.left) { - this.root_ = this.root_.right; - } else { - var right = this.root_.right; - this.root_ = this.root_.left; - // Splay to make sure that the new root has an empty right child. - this.splay_(key); - // Insert the original right child as the right child of the new - // root. - this.root_.right = right; - } - return removed; -}; - - -/** - * Returns the node having the specified key or null if the tree doesn't contain - * a node with the specified key. - * - * @param {number} key Key to find in the tree. - * @return {SplayTree.Node} Node having the specified key. - */ -SplayTree.prototype.find = function(key) { - if (this.isEmpty()) { - return null; - } - this.splay_(key); - return this.root_.key == key ? this.root_ : null; -}; - - -/** - * @return {SplayTree.Node} Node having the maximum key value. - */ -SplayTree.prototype.findMax = function(opt_startNode) { - if (this.isEmpty()) { - return null; - } - var current = opt_startNode || this.root_; - while (current.right) { - current = current.right; - } - return current; -}; - - -/** - * @return {SplayTree.Node} Node having the maximum key value that - * is less than the specified key value. - */ -SplayTree.prototype.findGreatestLessThan = function(key) { - if (this.isEmpty()) { - return null; - } - // Splay on the key to move the node with the given key or the last - // node on the search path to the top of the tree. - this.splay_(key); - // Now the result is either the root node or the greatest node in - // the left subtree. - if (this.root_.key < key) { - return this.root_; - } else if (this.root_.left) { - return this.findMax(this.root_.left); - } else { - return null; - } -}; - - -/** - * @return {Array<*>} An array containing all the keys of tree's nodes. - */ -SplayTree.prototype.exportKeys = function() { - var result = []; - if (!this.isEmpty()) { - this.root_.traverse_(function(node) { result.push(node.key); }); - } - return result; -}; - - -/** - * Perform the splay operation for the given key. Moves the node with - * the given key to the top of the tree. If no node has the given - * key, the last node on the search path is moved to the top of the - * tree. This is the simplified top-down splaying algorithm from: - * "Self-adjusting Binary Search Trees" by Sleator and Tarjan - * - * @param {number} key Key to splay the tree on. - * @private - */ -SplayTree.prototype.splay_ = function(key) { - if (this.isEmpty()) { - return; - } - // Create a dummy node. The use of the dummy node is a bit - // counter-intuitive: The right child of the dummy node will hold - // the L tree of the algorithm. The left child of the dummy node - // will hold the R tree of the algorithm. Using a dummy node, left - // and right will always be nodes and we avoid special cases. - var dummy, left, right; - dummy = left = right = new SplayTree.Node(null, null); - var current = this.root_; - while (true) { - if (key < current.key) { - if (!current.left) { - break; - } - if (key < current.left.key) { - // Rotate right. - var tmp = current.left; - current.left = tmp.right; - tmp.right = current; - current = tmp; - if (!current.left) { - break; - } - } - // Link right. - right.left = current; - right = current; - current = current.left; - } else if (key > current.key) { - if (!current.right) { - break; - } - if (key > current.right.key) { - // Rotate left. - var tmp = current.right; - current.right = tmp.left; - tmp.left = current; - current = tmp; - if (!current.right) { - break; - } - } - // Link left. - left.right = current; - left = current; - current = current.right; - } else { - break; - } - } - // Assemble. - left.right = current.left; - right.left = current.right; - current.left = dummy.right; - current.right = dummy.left; - this.root_ = current; -}; - - -/** - * Constructs a Splay tree node. - * - * @param {number} key Key. - * @param {*} value Value. - */ -SplayTree.Node = function(key, value) { - this.key = key; - this.value = value; -}; - - -/** - * @type {SplayTree.Node} - */ -SplayTree.Node.prototype.left = null; - - -/** - * @type {SplayTree.Node} - */ -SplayTree.Node.prototype.right = null; - - -/** - * Performs an ordered traversal of the subtree starting at - * this SplayTree.Node. - * - * @param {function(SplayTree.Node)} f Visitor function. - * @private - */ -SplayTree.Node.prototype.traverse_ = function(f) { - var current = this; - while (current) { - var left = current.left; - if (left) left.traverse_(f); - f(current); - current = current.right; - } -}; - -SplaySetup(); -SplayRun(); -SplayTearDown(); diff --git a/implementation-contributed/javascriptcore/stress/value-add-on-double-array-with-holes.js b/implementation-contributed/javascriptcore/stress/value-add-on-double-array-with-holes.js deleted file mode 100644 index 367e8f7496..0000000000 --- a/implementation-contributed/javascriptcore/stress/value-add-on-double-array-with-holes.js +++ /dev/null @@ -1,100 +0,0 @@ -let testCases = [ - // Numbers - ['1', NaN, NaN, 2, 2], - ['1.5', NaN, NaN, 1 + 1.5, 1 + 1.5], - [NaN, NaN, NaN, NaN, NaN], - - // Strings. - ['""', '"undefined"', '"undefined"', '"1"', '"1"'], - ['new String()', '"undefined"', '"undefined"', '"1"', '"1"'], - ['"WebKit!"', '"undefinedWebKit!"', '"WebKit!undefined"', '"1WebKit!"', '"WebKit!1"'], - - // Objects. - ['{ }', '"undefined[object Object]"', '"[object Object]undefined"', '"1[object Object]"', '"[object Object]1"'], - ['{ foo: 1 }', '"undefined[object Object]"', '"[object Object]undefined"', '"1[object Object]"', '"[object Object]1"'], - ['{ toString: function() { return ""; } }', '"undefined"', '"undefined"', '"1"', '"1"'], - ['{ toString: function() { return "WebKit"; } }', '"undefinedWebKit"', '"WebKitundefined"', '"1WebKit"', '"WebKit1"'], - - // Others. - ['null', NaN, NaN, 1, 1], - ['undefined', NaN, NaN, NaN, NaN] -]; - -for (let testCase of testCases) { - let otherOperand = testCase[0]; - let expectedLeftValueWithHole = testCase[1]; - let expectedRightValueWithHole = testCase[2]; - let expectedLeftValue = testCase[3]; - let expectedRightValue = testCase[4]; - eval( - `// Those holes are not observable by arithmetic operation. - // The return value is always going to be NaN. - function nonObservableHoleOnLhs(array, otherValue) { - return array[0] + otherValue; - } - noInline(nonObservableHoleOnLhs); - - function observableHoleOnLhs(array, otherValue) { - let value = array[0]; - return [value + otherValue, value]; - } - noInline(observableHoleOnLhs); - - function nonObservableHoleOnRhs(array, otherValue) { - return otherValue + array[0]; - } - noInline(nonObservableHoleOnRhs); - - function observableHoleOnRhs(array, otherValue) { - let value = array[0]; - return [otherValue + value, value]; - } - noInline(observableHoleOnRhs); - - let testArray = new Array; - for (let i = 1; i < 3; ++i) { - testArray[i] = i + 0.5 - } - - let isEqual = function(a, b) { - if (a === a) { - return a === b; - } - return b !== b; - } - - for (let i = 0; i < 1e4; ++i) { - let lhsResult1 = nonObservableHoleOnLhs(testArray, ${otherOperand}); - if (!isEqual(lhsResult1, ${expectedLeftValueWithHole})) - throw "Error on nonObservableHoleOnLhs at i = " + i + " with operand " + ${otherOperand} + " expected " + ${expectedLeftValueWithHole} + " got " + lhsResult1; - let lhsResult2 = observableHoleOnLhs(testArray, ${otherOperand}); - if (!isEqual(lhsResult2[0], ${expectedLeftValueWithHole}) || lhsResult2[1] !== undefined) - throw "Error on observableHoleOnLhs at i = " + i; - - let rhsResult1 = nonObservableHoleOnRhs(testArray, ${otherOperand}); - if (!isEqual(rhsResult1, ${expectedRightValueWithHole})) - throw "Error on nonObservableHoleOnRhs at i = " + i + " with operand " + ${otherOperand} + " expected " + ${expectedRightValueWithHole} + " got " + rhsResult1; - let rhsResult2 = observableHoleOnRhs(testArray, ${otherOperand}); - if (!isEqual(rhsResult2[0], ${expectedRightValueWithHole}) || rhsResult2[1] !== undefined) - throw "Error on observableHoleOnRhs at i = " + i; - } - - // Fill the hole, make sure everything still work correctly. - testArray[0] = 1.; - for (let i = 0; i < 1e4; ++i) { - let lhsResult1 = nonObservableHoleOnLhs(testArray, ${otherOperand}); - if (!isEqual(lhsResult1, ${expectedLeftValue})) - throw "Error on non hole nonObservableHoleOnLhs at i = " + i + " expected " + ${expectedLeftValue} + " got " + lhsResult1; - let lhsResult2 = observableHoleOnLhs(testArray, ${otherOperand}); - if (!isEqual(lhsResult2[0], ${expectedLeftValue}) || lhsResult2[1] !== 1) - throw "Error on non hole observableHoleOnLhs at i = " + i + " expected " + ${expectedLeftValue} + " got " + lhsResult2[0]; - - let rhsResult1 = nonObservableHoleOnRhs(testArray, ${otherOperand}); - if (!isEqual(rhsResult1, ${expectedRightValue})) - throw "Error on non hole nonObservableHoleOnRhs at i = " + i + " with operand " + ${otherOperand} + " expected " + ${expectedRightValue} + " got " + rhsResult1; - let rhsResult2 = observableHoleOnRhs(testArray, ${otherOperand}); - if (!isEqual(rhsResult2[0], ${expectedRightValue}) || rhsResult2[1] !== 1) - throw "Error on non hole observableHoleOnRhs at i = " + i; - }` - ); -} \ No newline at end of file diff --git a/implementation-contributed/javascriptcore/stress/value-to-boolean.js b/implementation-contributed/javascriptcore/stress/value-to-boolean.js deleted file mode 100644 index 9b39a84840..0000000000 --- a/implementation-contributed/javascriptcore/stress/value-to-boolean.js +++ /dev/null @@ -1,67 +0,0 @@ -//@ if $buildType == "release" then runDefault else skip end - -function assert(b) { - if (!b) - throw new Error("Bad assertion") -} -noInline(assert); - -let tests = [ - [true, true], - [false, false], - ["", false], - ["" + "" + "", false], - ["foo", true], - ["foo" + "bar", true], - [{}, true], - [Symbol(), true], - [undefined, false], - [null, false], - [0, false], - [-0, false], - [+0, false], - [NaN, false], - [10, true], - [10.2012, true], - [function() { }, true], - [new String("foo"), true], - [new String(""), true], - [new String, true] -]; - -function test1(c) { - return !!c; -} -noInline(test1); - -function test2(c) { - if (c) - return true; - return false; -} -noInline(test2); - -function test3(c) { - if (!c) - return false; - return true; -} -noInline(test3); - -let testFunctions = [test1, test2, test3]; - -for (let testFunction of testFunctions) { - for (let i = 0; i < 10000; i++) { - let item = tests[i % tests.length]; - assert(testFunction(item[0]) === item[1]); - } -} - -let masquerader = makeMasquerader(); -for (let testFunction of testFunctions) { - for (let i = 0; i < 10000; i++) { - for (let i = 0; i < 10000; i++) { - assert(testFunction(masquerader) === false); - } - } -} diff --git a/implementation-contributed/javascriptcore/stress/value-to-int32-undefined-constant.js b/implementation-contributed/javascriptcore/stress/value-to-int32-undefined-constant.js deleted file mode 100644 index 38b914019b..0000000000 --- a/implementation-contributed/javascriptcore/stress/value-to-int32-undefined-constant.js +++ /dev/null @@ -1,12 +0,0 @@ -function foo() { - return (void 0) | 0; -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) { - var result = foo(); - if (result != 0) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/value-to-int32-undefined.js b/implementation-contributed/javascriptcore/stress/value-to-int32-undefined.js deleted file mode 100644 index 7e35169e26..0000000000 --- a/implementation-contributed/javascriptcore/stress/value-to-int32-undefined.js +++ /dev/null @@ -1,12 +0,0 @@ -function foo(a) { - return a | 0; -} - -noInline(foo()); - -for (var i = 0; i < 10000; ++i) { - var result = foo(void 0); - if (result != 0) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/values-unscopables.js b/implementation-contributed/javascriptcore/stress/values-unscopables.js deleted file mode 100644 index 3deb96cfab..0000000000 --- a/implementation-contributed/javascriptcore/stress/values-unscopables.js +++ /dev/null @@ -1,53 +0,0 @@ -function test(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -(function () { - var array = []; - var values = 42; - - with (array) { - test(values, 42); - } - - array[Symbol.unscopables].values = false; - - with (array) { - test(values, Array.prototype.values); - } -}()); - -(function () { - var map = new Map(); - var values = 42; - - with (map) { - test(values, Map.prototype.values); - } - - map[Symbol.unscopables] = { - values: true - }; - - with (map) { - test(values, 42); - } -}()); - -(function () { - var set = new Set(); - var values = 42; - - with (set) { - test(values, Set.prototype.values); - } - - set[Symbol.unscopables] = { - values: true - }; - - with (set) { - test(values, 42); - } -}()); diff --git a/implementation-contributed/javascriptcore/stress/var-injection-cache-invalidation.js b/implementation-contributed/javascriptcore/stress/var-injection-cache-invalidation.js deleted file mode 100644 index 6d65bcbc39..0000000000 --- a/implementation-contributed/javascriptcore/stress/var-injection-cache-invalidation.js +++ /dev/null @@ -1,21 +0,0 @@ -//@ skip if $memoryLimited - -a = 0; - -function allocateLotsOfThings(array) { - for (let i = 0; i < 1e4; i++) - array[i] = { next: array[Math.floor(i / 2)] }; -} - -function test() { - a = 5; - for (var i = 0; i < 1e3; i++) { - allocateLotsOfThings([]); - edenGC(); - eval("var a = new Int32Array(100);"); - } -} -noInline(test); -noDFG(test); - -test(); diff --git a/implementation-contributed/javascriptcore/stress/varargs-closure-inlined-exit-strict-mode.js b/implementation-contributed/javascriptcore/stress/varargs-closure-inlined-exit-strict-mode.js deleted file mode 100644 index 12759c0bac..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-closure-inlined-exit-strict-mode.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; - -function foo(a, b) { - return a + b; -} - -function baz(a, b) { - function bar() { - var a = arguments; - var tmp = arguments[0] + 1; - return tmp + foo.apply(null, a); - } - return bar(a, b); -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - var result = baz(1, 2); - if (result != 1 + 1 + 3) - throw "Error: bad result: " + result; -} - -var result = baz(1.5, 2); -if (result != 1.5 + 1 + 3.5) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/varargs-closure-inlined-exit.js b/implementation-contributed/javascriptcore/stress/varargs-closure-inlined-exit.js deleted file mode 100644 index 2acb4d4d65..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-closure-inlined-exit.js +++ /dev/null @@ -1,24 +0,0 @@ -function foo(a, b) { - return a + b; -} - -function baz(a, b) { - function bar() { - var a = arguments; - var tmp = arguments[0] + 1; - return tmp + foo.apply(null, a); - } - return bar(a, b); -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - var result = baz(1, 2); - if (result != 1 + 1 + 3) - throw "Error: bad result: " + result; -} - -var result = baz(1.5, 2); -if (result != 1.5 + 1 + 3.5) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/varargs-exit.js b/implementation-contributed/javascriptcore/stress/varargs-exit.js deleted file mode 100644 index 9c9cd0995e..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-exit.js +++ /dev/null @@ -1,21 +0,0 @@ -function foo(a, b) { - return a + b; -} - -function bar() { - var a = arguments; - var tmp = arguments[0] + 1; - return tmp + foo.apply(null, a); -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var result = bar(1, 2); - if (result != 1 + 1 + 3) - throw "Error: bad result: " + result; -} - -var result = bar(1.5, 2); -if (result != 1.5 + 1 + 3.5) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/varargs-inlined-exit.js b/implementation-contributed/javascriptcore/stress/varargs-inlined-exit.js deleted file mode 100644 index de951e1b0d..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-inlined-exit.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(a, b) { - return a + b; -} - -function bar() { - var a = arguments; - var tmp = arguments[0] + 1; - return tmp + foo.apply(null, a); -} - -function baz(a, b) { - return bar(a, b); -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - var result = baz(1, 2); - if (result != 1 + 1 + 3) - throw "Error: bad result: " + result; -} - -var result = baz(1.5, 2); -if (result != 1.5 + 1 + 3.5) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/varargs-inlined-simple-exit-aliasing-weird-reversed-args.js b/implementation-contributed/javascriptcore/stress/varargs-inlined-simple-exit-aliasing-weird-reversed-args.js deleted file mode 100644 index f1fbee1e3f..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-inlined-simple-exit-aliasing-weird-reversed-args.js +++ /dev/null @@ -1,42 +0,0 @@ -function foo(a, b) { - return a + b; -} - -function verify(a, b) { - if (a !== b) - throw "Error: the two arguments objects aren't identical."; -} - -noInline(verify); - -function bar() { - var a = arguments; - this.verify(arguments, a); - return foo.apply(null, a); -} - -function baz(a, b) { - return this.bar(a + 1, b + 1); -} - -noInline(baz); - -for (var i = 0; i < 20000; ++i) { - var o = { - baz: baz, - bar: bar, - verify: function() { } - }; - var result = o.baz(1, 2); - if (result != 1 + 1 + 2 + 1) - throw "Error: bad result: " + result; -} - -var o = { - baz: baz, - bar: bar, - verify: verify -}; -var result = o.baz(1, 2); -if (result != 1 + 1 + 2 + 1) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/varargs-inlined-simple-exit-aliasing-weird.js b/implementation-contributed/javascriptcore/stress/varargs-inlined-simple-exit-aliasing-weird.js deleted file mode 100644 index 04a6d4b988..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-inlined-simple-exit-aliasing-weird.js +++ /dev/null @@ -1,42 +0,0 @@ -function foo(a, b) { - return a + b; -} - -function verify(a, b) { - if (a !== b) - throw "Error: the two arguments objects aren't identical."; -} - -noInline(verify); - -function bar() { - var a = arguments; - this.verify(arguments, a); - return foo.apply(null, a); -} - -function baz(a, b) { - return this.bar(a, b); -} - -noInline(baz); - -for (var i = 0; i < 20000; ++i) { - var o = { - baz: baz, - bar: bar, - verify: function() { } - }; - var result = o.baz(1, 2); - if (result != 1 + 2) - throw "Error: bad result: " + result; -} - -var o = { - baz: baz, - bar: bar, - verify: verify -}; -var result = o.baz(1, 2); -if (result != 1 + 2) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/varargs-inlined-simple-exit-aliasing.js b/implementation-contributed/javascriptcore/stress/varargs-inlined-simple-exit-aliasing.js deleted file mode 100644 index 23890d14e7..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-inlined-simple-exit-aliasing.js +++ /dev/null @@ -1,41 +0,0 @@ -function foo(a, b) { - return a + b; -} - -function verify(a, b) { - if (a !== b) - throw "Error: the two arguments objects aren't identical."; - if (a[0] !== 42) - throw "Error: the first argument isn't 42 (a)."; - if (b[0] !== 42) - throw "Error: the first argument isn't 42 (b)."; -} - -noInline(verify); - -var global = false; -function bar(x) { - var a = arguments; - if (global) { - x = 42; - verify(arguments, a); - } - return foo.apply(null, a); -} - -function baz(a, b) { - return bar(a, b); -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - var result = baz(1, 2); - if (result != 1 + 2) - throw "Error: bad result: " + result; -} - -global = true; -var result = baz(1, 2); -if (result != 42 + 2) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/varargs-inlined-simple-exit.js b/implementation-contributed/javascriptcore/stress/varargs-inlined-simple-exit.js deleted file mode 100644 index c841e9c2d2..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-inlined-simple-exit.js +++ /dev/null @@ -1,28 +0,0 @@ -function foo(a, b) { - return a + b; -} - -var global; -function bar() { - var a = arguments; - var tmp = global + 1; - return tmp + foo.apply(null, a); -} - -function baz(a, b) { - return bar(a, b); -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - global = i; - var result = baz(1, 2); - if (result != i + 1 + 1 + 2) - throw "Error: bad result: " + result; -} - -global = 1.5; -var result = baz(1, 2); -if (result != 1.5 + 1 + 1 + 2) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/varargs-inlining-underflow.js b/implementation-contributed/javascriptcore/stress/varargs-inlining-underflow.js deleted file mode 100644 index 02a94f841a..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-inlining-underflow.js +++ /dev/null @@ -1,18 +0,0 @@ -function baz() { -} - -function bar() { - baz.apply(this, arguments); -} - -for (var i = 0; i < 1000; ++i) - bar(1, 2, 3, 4, 5, 6, 7); - -function foo() { - bar(); -} - -noInline(foo); - -for (var i = 0; i < 10000; ++i) - foo(); diff --git a/implementation-contributed/javascriptcore/stress/varargs-no-forward.js b/implementation-contributed/javascriptcore/stress/varargs-no-forward.js deleted file mode 100644 index 87de84b514..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-no-forward.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo(a, b, c) { - return a + b * 2 + c * 3; -} - -noInline(foo); - -function baz(args) { - return foo.apply(this, args); -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - var result = baz([5, 6, 7]); - if (result != 5 + 6 * 2 + 7 * 3) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/varargs-simple.js b/implementation-contributed/javascriptcore/stress/varargs-simple.js deleted file mode 100644 index f604a74ed7..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-simple.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo(a, b, c) { - return a + b * 2 + c * 3; -} - -noInline(foo); - -function baz() { - return foo.apply(this, arguments); -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - var result = baz(5, 6, 7); - if (result != 5 + 6 * 2 + 7 * 3) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/varargs-then-slow-call.js b/implementation-contributed/javascriptcore/stress/varargs-then-slow-call.js deleted file mode 100644 index a766ae7069..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-then-slow-call.js +++ /dev/null @@ -1,40 +0,0 @@ -function foo(a, b) { - return a + b; -} -noInline(foo); - -function bar() { - return foo.apply(this, arguments); -} - -function fuzz(a, b, c, d, e, f) { - return a + b + c + d + e + f; -} -noInline(fuzz); - -function baz(array) { - var a = array[0]; - var b = array[1]; - var c = array[2]; - var d = array[3]; - var e = array[4]; - var f = array[5]; - var g = array[6]; - var h = array[7]; - var i = array[8]; - var j = array[9]; - - var x = bar(a, b); - var y = fuzz(a, b, c, d, e, f); - - return a + b + c + d + e + f + g + h + i + j + x + y; -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - var result = baz([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); - if (result != 61) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/varargs-too-few-arguments.js b/implementation-contributed/javascriptcore/stress/varargs-too-few-arguments.js deleted file mode 100644 index 36c062a668..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-too-few-arguments.js +++ /dev/null @@ -1,16 +0,0 @@ -function foo(a, b) { - return [a, b]; -} - -function bar() { - return foo.apply(null, arguments); -} - -noInline(bar); - -for (var i = 0; i < 10000; ++i) { - var result = bar(1); - if ("" + result != "1,") - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/varargs-two-level.js b/implementation-contributed/javascriptcore/stress/varargs-two-level.js deleted file mode 100644 index 52288edff4..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-two-level.js +++ /dev/null @@ -1,22 +0,0 @@ -function foo(a, b, c) { - return a + b * 2 + c * 3; -} - -noInline(foo); - -function bar() { - return foo.apply(this, arguments); -} - -function baz() { - return bar.apply(this, arguments); -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - var result = baz(5, 6, 7); - if (result != 5 + 6 * 2 + 7 * 3) - throw "Error: bad result: " + result; -} - diff --git a/implementation-contributed/javascriptcore/stress/varargs-varargs-closure-inlined-exit.js b/implementation-contributed/javascriptcore/stress/varargs-varargs-closure-inlined-exit.js deleted file mode 100644 index b7b2d4c359..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-varargs-closure-inlined-exit.js +++ /dev/null @@ -1,24 +0,0 @@ -function foo(a, b) { - return a + b; -} - -function baz() { - function bar() { - var a = arguments; - var tmp = arguments[0] + 1; - return tmp + foo.apply(null, a); - } - return bar.apply(null, arguments); -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - var result = baz(1, 2); - if (result != 1 + 1 + 3) - throw "Error: bad result: " + result; -} - -var result = baz(1.5, 2); -if (result != 1.5 + 1 + 3.5) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/varargs-varargs-inlined-exit-strict-mode.js b/implementation-contributed/javascriptcore/stress/varargs-varargs-inlined-exit-strict-mode.js deleted file mode 100644 index 139d75d996..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-varargs-inlined-exit-strict-mode.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; - -function foo(a, b) { - return a + b; -} - -function bar() { - var a = arguments; - var tmp = arguments[0] + 1; - return tmp + foo.apply(null, a); -} - -function baz() { - return bar.apply(this, arguments); -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - var result = baz(1, 2); - if (result != 1 + 1 + 3) - throw "Error: bad result: " + result; -} - -var result = baz(1.5, 2); -if (result != 1.5 + 1 + 3.5) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/varargs-varargs-inlined-exit.js b/implementation-contributed/javascriptcore/stress/varargs-varargs-inlined-exit.js deleted file mode 100644 index 7a243cb63c..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-varargs-inlined-exit.js +++ /dev/null @@ -1,25 +0,0 @@ -function foo(a, b) { - return a + b; -} - -function bar() { - var a = arguments; - var tmp = arguments[0] + 1; - return tmp + foo.apply(null, a); -} - -function baz() { - return bar.apply(this, arguments); -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) { - var result = baz(1, 2); - if (result != 1 + 1 + 3) - throw "Error: bad result: " + result; -} - -var result = baz(1.5, 2); -if (result != 1.5 + 1 + 3.5) - throw "Error: bad result at end: " + result; diff --git a/implementation-contributed/javascriptcore/stress/varargs-with-unused-count.js b/implementation-contributed/javascriptcore/stress/varargs-with-unused-count.js deleted file mode 100644 index 48ab08b9a3..0000000000 --- a/implementation-contributed/javascriptcore/stress/varargs-with-unused-count.js +++ /dev/null @@ -1,23 +0,0 @@ -function foo(p, q, r) { - while (r) { - if (p) - return 1; - else if (p) - return 2; - else - throw "error"; - } -} - -function bar() { - foo.apply(this, arguments); -} - -function baz(a, b, c, d) { - bar(a, b, c, d); -} - -noInline(baz); - -for (var i = 0; i < 10000; ++i) - baz(1, 2, 3, 4); diff --git a/implementation-contributed/javascriptcore/stress/variable-named-eval-under-tdz.js b/implementation-contributed/javascriptcore/stress/variable-named-eval-under-tdz.js deleted file mode 100644 index 324fa770a9..0000000000 --- a/implementation-contributed/javascriptcore/stress/variable-named-eval-under-tdz.js +++ /dev/null @@ -1,87 +0,0 @@ -function shouldThrowTDZ(func) { - var hasThrown = false; - try { - func(); - } catch(e) { - hasThrown = e instanceof ReferenceError; - } - if (!hasThrown) - throw new Error("Did not throw TDZ error"); -} - -function test(f, n = 1000) { - for (let i = 0; i < n; i++) - f(); -} - -test(function() { - function foo() { - eval("20"); - let eval; - } - shouldThrowTDZ(foo); -}); - -test(function() { - function foo() { - eval("20"); - let {eval} = {eval:450}; - } - shouldThrowTDZ(foo); -}); - -test(function() { - function foo() { - eval("20"); - const eval = 45; - } - shouldThrowTDZ(foo); -}); - -test(function() { - function foo() { - eval("20"); - } - shouldThrowTDZ(foo); - let eval; -}); - -test(function() { - function foo() { - eval("20"); - } - shouldThrowTDZ(foo); - let {eval} = {eval:450}; -}); - -test(function() { - function foo() { - eval("20"); - } - shouldThrowTDZ(foo); - const eval = 45; -}); - -{ - let threw = false; - try { - eval(20); - let eval; - } catch(e) { - threw = e instanceof ReferenceError; - } - if (!threw) - throw new Error("Bad") -} - -{ - let threw = false; - try { - eval(20); - const eval = 25; - } catch(e) { - threw = e instanceof ReferenceError; - } - if (!threw) - throw new Error("Bad") -} diff --git a/implementation-contributed/javascriptcore/stress/variable-under-tdz-eval-tricky.js b/implementation-contributed/javascriptcore/stress/variable-under-tdz-eval-tricky.js deleted file mode 100644 index 23b94c35ab..0000000000 --- a/implementation-contributed/javascriptcore/stress/variable-under-tdz-eval-tricky.js +++ /dev/null @@ -1,60 +0,0 @@ -function assert(b) { - if (!b) - throw new Error("Bad!") -} - - -{ - let threw = false; - try { - let underTDZ = { - prop: eval("function pleaseTDZMe(){ return underTDZ; }; pleaseTDZMe();") - }; - } catch(e) { - threw = e instanceof ReferenceError; - } - assert(threw); -} - -{ - let threw = false; - try { - const underTDZ = { - prop: eval("function pleaseTDZMe(){ return underTDZ; }; pleaseTDZMe();") - }; - } catch(e) { - threw = e instanceof ReferenceError; - } - assert(threw); -} - -{ - let threw = false; - try { - class underTDZ extends eval("function pleaseTDZMe() { return underTDZ; }; pleaseTDZMe()") { }; - } catch(e) { - threw = e instanceof ReferenceError; - } - assert(threw); -} - -{ - let threw = false; - try { - let b = {a: eval("function b(){ return b; }"), b: (1, eval)("(b())")}; - } catch(e) { - threw = e instanceof SyntaxError; - } - assert(threw); -} - -{ - let threw = false; - try { - let {b} = {a: eval("function b(){ return b; }"), b: (1, eval)("print(b())")}; - } catch(e) { - threw = e instanceof SyntaxError; - } - assert(threw); -} - diff --git a/implementation-contributed/javascriptcore/stress/vector-length-hint-array-constructor.js b/implementation-contributed/javascriptcore/stress/vector-length-hint-array-constructor.js deleted file mode 100644 index 8e8f52cf45..0000000000 --- a/implementation-contributed/javascriptcore/stress/vector-length-hint-array-constructor.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + String(actual) + ' ' + String(expected)); -} - -function test(constructor) -{ - var array = new constructor(1, 2); - for (var i = 0; i < 20; ++i) - array.push(i); - return array; -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - var result = test(Array); - shouldBe(JSON.stringify(result), `[1,2,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]`); -} diff --git a/implementation-contributed/javascriptcore/stress/vector-length-hint-new-array.js b/implementation-contributed/javascriptcore/stress/vector-length-hint-new-array.js deleted file mode 100644 index d8cb6c9905..0000000000 --- a/implementation-contributed/javascriptcore/stress/vector-length-hint-new-array.js +++ /dev/null @@ -1,18 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + String(actual) + ' ' + String(expected)); -} - -function test(v0, v1) -{ - var array = [v0, v1]; - for (var i = 0; i < 20; ++i) - array.push(i); - return array; -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - var result = test(1, 2); - shouldBe(JSON.stringify(result), `[1,2,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]`); -} diff --git a/implementation-contributed/javascriptcore/stress/watchdog-dont-malloc-when-in-c-code.js b/implementation-contributed/javascriptcore/stress/watchdog-dont-malloc-when-in-c-code.js deleted file mode 100644 index a004b553e7..0000000000 --- a/implementation-contributed/javascriptcore/stress/watchdog-dont-malloc-when-in-c-code.js +++ /dev/null @@ -1,5 +0,0 @@ -//@ runFTLEagerWatchdog - -for (let i = 0; i < 7000; ++i) { - mallocInALoop(); -} diff --git a/implementation-contributed/javascriptcore/stress/weak-map-constructor-adder.js b/implementation-contributed/javascriptcore/stress/weak-map-constructor-adder.js deleted file mode 100644 index 67034bc7a6..0000000000 --- a/implementation-contributed/javascriptcore/stress/weak-map-constructor-adder.js +++ /dev/null @@ -1,51 +0,0 @@ -// WeakMap constructor with adder change. - -var originalAdder = WeakMap.prototype.set; -var counter = 0; - -WeakMap.prototype.set = function (key, value) { - counter++; - return originalAdder.call(this, key, value); -}; - -var obj0 = {}; -var obj1 = {}; -var obj2 = []; -var obj3 = new Date(); -var obj4 = new Error(); -var obj5 = JSON; - -var values = [ - [ obj0, 0 ], - [ obj1, 1 ], - [ obj2, 2 ], - [ obj3, 3 ], - [ obj4, 4 ], - [ obj5, 5 ], - [ obj4, 4 ], - [ obj3, 3 ], - [ obj2, 2 ], - [ obj1, 1 ], - [ obj0, 0 ], -]; -var map = new WeakMap(values); -if (counter !== values.length) - throw "Error: bad counter " + counter; - -WeakMap.prototype.set = function () { - throw new Error("adder called"); -}; - -var map = new WeakMap(); -var map = new WeakMap([]); -var error = null; -try { - var map = new WeakMap([ [0, 0] ]); -} catch (e) { - error = e; -} -if (!error) - throw "Error: error not thrown"; -if (String(error) !== "Error: adder called") - throw "Error: bad error " + String(error); - diff --git a/implementation-contributed/javascriptcore/stress/weak-map-constructor.js b/implementation-contributed/javascriptcore/stress/weak-map-constructor.js deleted file mode 100644 index 353a313f3f..0000000000 --- a/implementation-contributed/javascriptcore/stress/weak-map-constructor.js +++ /dev/null @@ -1,144 +0,0 @@ -// WeakMap constructor behaviors. - -if (typeof WeakMap !== 'function') - throw "Error: bad value" + typeof WeakMap; - -function testCallTypeError(item) { - var error = null; - try { - var map = WeakMap(item); - } catch (e) { - error = e; - } - if (!error) - throw "Error: error not thrown"; - if (String(error) !== "TypeError: calling WeakMap constructor without new is invalid") - throw "Error: bad error " + String(error); -} -var obj1 = {}; -var obj2 = []; -var obj3 = new Date(); -var obj4 = new Error(); - -var pass = [ - null, - undefined, - [], - new Set(), - new Map(), - "", - - [ - [obj1, 1], - [obj2, 2], - [obj3, 3], - ], - - [ - [obj1, 1], - [obj1, 2], - [obj1, 3], - ], - - [ - { 0: obj2, 1: 'O' }, - { 0: obj3, 1: 'K' }, - { 0: obj4, 1: 'K' }, - ], - - new Map([ - [obj1, 1], - [obj2, 2], - [obj3, 3], - ]), - - new Map([ - [obj1, 1], - [obj1, 2], - [obj1, 3], - ]), - - new Map([ - { 0: obj2, 1: 'O' }, - { 0: obj3, 1: 'K' }, - { 0: obj4, 1: 'K' }, - ]), -]; - -for (var value of pass) { - var map = new WeakMap(value); - testCallTypeError(value); -} - -function testTypeError(item, message) { - var error = null; - try { - var map = new WeakMap(item); - } catch (e) { - error = e; - } - if (!error) - throw "Error: error not thrown"; - if (!message) - message = "TypeError: Type error"; - if (String(error) !== message) - throw "Error: bad error " + String(error); -} - -var nonIterable = [ - 42, - Symbol("Cappuccino"), - true, - false, - {}, - new Date(), - new Error(), - Object(Symbol("Matcha")), - (function () { }), -]; - -for (var item of nonIterable) { - testTypeError(item); - testCallTypeError(item); -} - -var notContainNextItem = [ - "Cocoa", - [0, 1, 2, 3, 4], - [0, 0, 0, 1, 0], - ["A", "B", "A"], - new String("cocoa"), - new String("Cocoa"), - new Set([0,1,2,3,4]), - new Set([1,1,1,1]), -]; - -for (var item of notContainNextItem) { - testTypeError(item); - testCallTypeError(item); -} - -var nonObjectKeys = [ - [ - [0, 1], - [1, 2], - [1, 3], - ], - - [ - [1, 1], - [1, 2], - [1, 3], - ], - - [ - { 0: 'C', 1: 'O' }, - { 0: 'C', 1: 'K' }, - { 0: 'V', 1: 'K' }, - ], -]; - -for (var item of nonObjectKeys) { - testTypeError(item, 'TypeError: Attempted to set a non-object key in a WeakMap'); - testCallTypeError(item); -} diff --git a/implementation-contributed/javascriptcore/stress/weak-set-constructor-adder.js b/implementation-contributed/javascriptcore/stress/weak-set-constructor-adder.js deleted file mode 100644 index 3c600c1b4a..0000000000 --- a/implementation-contributed/javascriptcore/stress/weak-set-constructor-adder.js +++ /dev/null @@ -1,51 +0,0 @@ -// WeakSet constructor with adder change. - -var originalAdder = WeakSet.prototype.add; -var counter = 0; - -WeakSet.prototype.add = function (key) { - counter++; - return originalAdder.call(this, key); -}; - -var obj0 = {}; -var obj1 = {}; -var obj2 = []; -var obj3 = new Date(); -var obj4 = new Error(); -var obj5 = JSON; - -var values = [ - obj0, - obj1, - obj2, - obj3, - obj4, - obj5, - obj4, - obj3, - obj2, - obj1, - obj0, -]; -var set = new WeakSet(values); -if (counter !== values.length) - throw new Error("bad counter " + counter); - -WeakSet.prototype.add = function () { - throw new Error("adder called"); -}; - -var set = new WeakSet(); -var set = new WeakSet([]); -var error = null; -try { - var set = new WeakSet([ 0 ]); -} catch (e) { - error = e; -} -if (!error) - throw new Error("error not thrown"); -if (String(error) !== "Error: adder called") - throw new Error("bad error " + String(error)); - diff --git a/implementation-contributed/javascriptcore/stress/weak-set-constructor.js b/implementation-contributed/javascriptcore/stress/weak-set-constructor.js deleted file mode 100644 index 1b5057200d..0000000000 --- a/implementation-contributed/javascriptcore/stress/weak-set-constructor.js +++ /dev/null @@ -1,146 +0,0 @@ -// WeakSet constructor behaviors. - -if (typeof WeakSet !== 'function') - throw new Error("bad value" + typeof WeakSet); - -function testCallTypeError(item) { - var error = null; - try { - var set = WeakSet(item); - } catch (e) { - error = e; - } - if (!error) - throw new Error("error not thrown"); - if (String(error) !== "TypeError: calling WeakSet constructor without new is invalid") - throw new Error("bad error " + String(error)); -} -var obj1 = {}; -var obj2 = []; -var obj3 = new Date(); -var obj4 = new Error(); - -var pass = [ - null, - undefined, - [], - new Set(), - new Map(), - "", - - [ - obj1, - obj2, - obj3, - ], - - [ - obj1, - obj1, - obj1, - ], - - [ - obj2, - obj3, - obj4, - ], - - new Map([ - [obj1, 1], - [obj2, 2], - [obj3, 3], - ]), - - new Map([ - [obj1, 1], - [obj1, 2], - [obj1, 3], - ]), - - new Set([ - obj1, - obj2, - obj3, - ]), - - new Set([ - obj1, - obj1, - obj1, - ]), - - new Map([ - { 0: obj2, 1: 'O' }, - { 0: obj3, 1: 'K' }, - { 0: obj4, 1: 'K' }, - ]), - - new Set([ - obj2, - obj3, - obj4, - ]) -]; - -for (var value of pass) { - var set = new WeakSet(value); - testCallTypeError(value); -} - -function testTypeError(item, message) { - var error = null; - try { - var set = new WeakSet(item); - } catch (e) { - error = e; - } - if (!error) - throw new Error("error not thrown"); - if (!message) - message = "TypeError: Type error"; - if (String(error) !== message) - throw new Error("bad error " + String(error)); -} - -var nonIterable = [ - 42, - Symbol("Cappuccino"), - true, - false, - {}, - new Date(), - new Error(), - Object(Symbol("Matcha")), - (function () { }), -]; - -for (var item of nonIterable) { - testTypeError(item); - testCallTypeError(item); -} - -var nonObjectKeys = [ - [ - 0, - 1, - 1, - ], - - [ - 1, - 1, - 1, - ], - - [ - 'C', - 'C', - 'V', - ], -]; - -for (var item of nonObjectKeys) { - testTypeError(item, 'TypeError: Attempted to add a non-object key to a WeakSet'); - testCallTypeError(item); -} diff --git a/implementation-contributed/javascriptcore/stress/weakmap-cse-set-break.js b/implementation-contributed/javascriptcore/stress/weakmap-cse-set-break.js deleted file mode 100644 index 5dc6535b68..0000000000 --- a/implementation-contributed/javascriptcore/stress/weakmap-cse-set-break.js +++ /dev/null @@ -1,24 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var map = new WeakMap(); - var key = {}; - var key2 = {}; - - map.set(key, 42); - var res1 = map.get(key); - map.set(key2, 2017); - var res2 = map.get(key); - return [res1, res2]; -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) { - var [res1, res2] = test(); - shouldBe(res1, 42); - shouldBe(res2, 42); -} diff --git a/implementation-contributed/javascriptcore/stress/weakmap-cse.js b/implementation-contributed/javascriptcore/stress/weakmap-cse.js deleted file mode 100644 index 14ebc8ad40..0000000000 --- a/implementation-contributed/javascriptcore/stress/weakmap-cse.js +++ /dev/null @@ -1,21 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var map = new WeakMap(); - var key = {}; - var key2 = {}; - - map.set(key, 42); - map.set(key2, 2017); - if (map.has(key)) - return map.get(key); - return 0; -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) - shouldBe(test(), 42); diff --git a/implementation-contributed/javascriptcore/stress/weakmap-gc.js b/implementation-contributed/javascriptcore/stress/weakmap-gc.js deleted file mode 100644 index f63f4752ce..0000000000 --- a/implementation-contributed/javascriptcore/stress/weakmap-gc.js +++ /dev/null @@ -1,11 +0,0 @@ -function test() -{ - var map = new WeakMap(); - for (var i = 0; i < 1e6; ++i) { - map.set({}, i); - } - return map; -} -noInline(test); -var map = test(); -fullGC(); diff --git a/implementation-contributed/javascriptcore/stress/weakmap-set-cse.js b/implementation-contributed/javascriptcore/stress/weakmap-set-cse.js deleted file mode 100644 index f5f04936ad..0000000000 --- a/implementation-contributed/javascriptcore/stress/weakmap-set-cse.js +++ /dev/null @@ -1,22 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var key1 = {}; - var map = new WeakMap(); - var r1 = map.get(key1); - map.set(key1, 42); - var r2 = map.get(key1); - return [r1, r2]; -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - let [r1, r2] = test(); - shouldBe(r1, undefined); - shouldBe(r2, 42); -} diff --git a/implementation-contributed/javascriptcore/stress/weakset-add-cse.js b/implementation-contributed/javascriptcore/stress/weakset-add-cse.js deleted file mode 100644 index d0c4cea668..0000000000 --- a/implementation-contributed/javascriptcore/stress/weakset-add-cse.js +++ /dev/null @@ -1,22 +0,0 @@ -function shouldBe(actual, expected) -{ - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var key1 = {}; - var set = new WeakSet(); - var r1 = set.has(key1); - set.add(key1); - var r2 = set.has(key1); - return [r1, r2]; -} -noInline(test); - -for (var i = 0; i < 1e5; ++i) { - let [r1, r2] = test(); - shouldBe(r1, false); - shouldBe(r2, true); -} diff --git a/implementation-contributed/javascriptcore/stress/weakset-cse-add-break.js b/implementation-contributed/javascriptcore/stress/weakset-cse-add-break.js deleted file mode 100644 index 8774d69e91..0000000000 --- a/implementation-contributed/javascriptcore/stress/weakset-cse-add-break.js +++ /dev/null @@ -1,24 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var set = new WeakSet(); - var key = {}; - var key2 = {}; - - set.add(key); - var res1 = set.has(key); - set.add(key2); - var res2 = set.has(key); - return [res1, res2]; -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) { - var [res1, res2] = test(); - shouldBe(res1, true); - shouldBe(res2, true); -} diff --git a/implementation-contributed/javascriptcore/stress/weakset-cse.js b/implementation-contributed/javascriptcore/stress/weakset-cse.js deleted file mode 100644 index 2ba008bb49..0000000000 --- a/implementation-contributed/javascriptcore/stress/weakset-cse.js +++ /dev/null @@ -1,21 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error('bad value: ' + actual); -} - -function test() -{ - var set = new WeakSet(); - var key = {}; - var key2 = {}; - - set.add(key); - set.add(key2); - if (set.has(key)) - return set.has(key); - return 0; -} -noInline(test); - -for (var i = 0; i < 1e6; ++i) - shouldBe(test(), true); diff --git a/implementation-contributed/javascriptcore/stress/weakset-gc.js b/implementation-contributed/javascriptcore/stress/weakset-gc.js deleted file mode 100644 index d8432fe42b..0000000000 --- a/implementation-contributed/javascriptcore/stress/weakset-gc.js +++ /dev/null @@ -1,11 +0,0 @@ -function test() -{ - var set = new WeakSet(); - for (var i = 0; i < 1e6; ++i) { - set.add({}); - } - return set; -} -noInline(test); -var set = test(); -fullGC(); diff --git a/implementation-contributed/javascriptcore/stress/weird-equality-folding-cases.js b/implementation-contributed/javascriptcore/stress/weird-equality-folding-cases.js deleted file mode 100644 index d2c618ee9d..0000000000 --- a/implementation-contributed/javascriptcore/stress/weird-equality-folding-cases.js +++ /dev/null @@ -1,13 +0,0 @@ -function test(actualFunction, expected) { - var actual = actualFunction(); - if (actual != expected) - throw new Error("bad in " + actualFunction + " result: " + actual); -} - -noInline(test); - -for (var i = 0; i < 10000; ++i) { - test(function() { return "5" == 5; }, true); - test(function() { return ({valueOf:function(){return 42;}}) == 42; }, true); - test(function() { return ({valueOf:function(){return 42;}}) == ({valueOf:function(){return 42;}}) }, false); -} diff --git a/implementation-contributed/javascriptcore/stress/weird-getter-counter.js b/implementation-contributed/javascriptcore/stress/weird-getter-counter.js deleted file mode 100644 index ff9433447b..0000000000 --- a/implementation-contributed/javascriptcore/stress/weird-getter-counter.js +++ /dev/null @@ -1,24 +0,0 @@ -function foo(o) { - return o.f; -} - -noInline(foo); - -var counter = 0; - -function test(o, expected, expectedCount) { - var result = foo(o); - if (result != expected) - throw new Error("Bad result: " + result); - if (counter != expectedCount) - throw new Error("Bad counter value: " + counter); -} - -for (var i = 0; i < 100000; ++i) { - var o = {}; - o.__defineGetter__("f", function() { - counter++; - return 84; - }); - test(o, 84, counter + 1); -} diff --git a/implementation-contributed/javascriptcore/stress/weird-put-stack-varargs.js b/implementation-contributed/javascriptcore/stress/weird-put-stack-varargs.js deleted file mode 100644 index ffa9ab19f7..0000000000 --- a/implementation-contributed/javascriptcore/stress/weird-put-stack-varargs.js +++ /dev/null @@ -1,26 +0,0 @@ -function baz() { - if (!foo.arguments[1]) - throw "Error: foo.arguments[1] should be truthy but is falsy: " + foo.arguments[1]; -} - -noInline(baz); - -function foo(a, b) { - if (a) - b = 42; - baz(); -} - -function fuzz(a, b) { - return a + b; -} - -function bar(array1, array2) { - fuzz.apply(this, array1); - foo.apply(this, array2); -} - -noInline(bar); - -for (var i = 0; i < 100000; ++i) - bar([false, false], [false, true]); diff --git a/implementation-contributed/javascriptcore/stress/weird-setter-counter-syntactic.js b/implementation-contributed/javascriptcore/stress/weird-setter-counter-syntactic.js deleted file mode 100644 index b3843e895e..0000000000 --- a/implementation-contributed/javascriptcore/stress/weird-setter-counter-syntactic.js +++ /dev/null @@ -1,29 +0,0 @@ -function foo(o, value) { - o.f = value; - return o.f; -} - -noInline(foo); - -var counter = 0; - -function test(o, value, expectedCount) { - var result = foo(o, value); - if (result != value) - throw new Error("Bad result: " + result); - if (counter != expectedCount) - throw new Error("Bad counter value: " + counter); -} - -for (var i = 0; i < 100000; ++i) { - var o = { - get f() { - return this._f; - }, - set f(value) { - counter++; - this._f = value; - } - }; - test(o, i, counter + 1); -} diff --git a/implementation-contributed/javascriptcore/stress/weird-setter-counter.js b/implementation-contributed/javascriptcore/stress/weird-setter-counter.js deleted file mode 100644 index d76bceeb7d..0000000000 --- a/implementation-contributed/javascriptcore/stress/weird-setter-counter.js +++ /dev/null @@ -1,26 +0,0 @@ -function foo(o, value) { - o.f = value; - return o.f; -} - -noInline(foo); - -var counter = 0; - -function test(o, value, expectedCount) { - var result = foo(o, value); - if (result != value) - throw new Error("Bad result: " + result); - if (counter != expectedCount) - throw new Error("Bad counter value: " + counter); -} - -for (var i = 0; i < 100000; ++i) { - var o = {}; - o.__defineSetter__("f", function(value) { - counter++; - this._f = value; - }); - o.__defineGetter__("f", function() { return this._f; }); - test(o, i, counter + 1); -} diff --git a/implementation-contributed/javascriptcore/stress/with.js b/implementation-contributed/javascriptcore/stress/with.js deleted file mode 100644 index b9ad0c28f5..0000000000 --- a/implementation-contributed/javascriptcore/stress/with.js +++ /dev/null @@ -1,24 +0,0 @@ -function foo (x, y, z, newX, checkZ, errorMessage) { - with(z) { - x = y; - } - if (x !== newX || !checkZ(z)) { - throw errorMessage; - } -} - -for (var i = 0; i < 10000; ++i) { - foo(1, 2, {a:42}, 2, z => z.a === 42, "Error: bad result for non-overlapping case, i = " + i); - foo(1, 2, {x:42}, 1, z => z.x === 2, "Error: bad result for setter case, i = " + i); - foo(1, 2, {y:42}, 42, z => z.y === 42, "Error: bad result for getter case, i = " + i); - foo(1, 2, {x:42, y:13}, 1, z => z.x === 13 && z.y === 13, "Error: bad result for setter/getter case, i = " + i); - foo(1, 2, "toto", 2, z => z === "toto", "Error: bad result for string case, i = " + i); - try { - foo(1, 2, null, 2, z => - {throw "Error: missing type error, i = " + i}, "Unreachable"); - } catch (e) { - if (!(e instanceof TypeError)) { - throw e; - } - } -} diff --git a/implementation-contributed/javascriptcore/stress/with_and_arith.js b/implementation-contributed/javascriptcore/stress/with_and_arith.js deleted file mode 100644 index 85cbf93f29..0000000000 --- a/implementation-contributed/javascriptcore/stress/with_and_arith.js +++ /dev/null @@ -1,6 +0,0 @@ -for (var i = 0; i < 10000;) { - var x = 1; - with({}) { - i += x; - } -} diff --git a/implementation-contributed/javascriptcore/stress/yield-and-line-terminator.js b/implementation-contributed/javascriptcore/stress/yield-and-line-terminator.js deleted file mode 100644 index 139332b47d..0000000000 --- a/implementation-contributed/javascriptcore/stress/yield-and-line-terminator.js +++ /dev/null @@ -1,36 +0,0 @@ -function testSyntax(script) { - try { - eval(script); - } catch (error) { - if (error instanceof SyntaxError) - throw new Error("Bad error: " + String(error)); - } -} - -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -testSyntax(` -function * gen() { - yield - 20; -} -`); - -testSyntaxError(` -function * gen() { - yield - *20; -} -`, "SyntaxError: Unexpected token '*'"); diff --git a/implementation-contributed/javascriptcore/stress/yield-label-generator.js b/implementation-contributed/javascriptcore/stress/yield-label-generator.js deleted file mode 100644 index 99a99baa2f..0000000000 --- a/implementation-contributed/javascriptcore/stress/yield-label-generator.js +++ /dev/null @@ -1,58 +0,0 @@ -function testSyntax(script) { - try { - eval(script); - } catch (error) { - if (error instanceof SyntaxError) - throw new Error("Bad error: " + String(error)); - } -} - -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -testSyntaxError(` -function *test() { - { - yield: for (var i = 0; i < 1000; ++i) { - break yield; - } - } -} -`, `SyntaxError: Cannot use 'yield' as a label in a generator function.`); - -testSyntaxError(` -function *test() { - { - label: for (var i = 0; i < 1000; ++i) { - break yield; - } - } -} -`, `SyntaxError: Unexpected keyword 'yield'. Expected an identifier as the target for a break statement.`); - -testSyntaxError(` -function *test() { - { - label: for (var i = 0; i < 1000; ++i) { - continue yield; - } - } -} -`, `SyntaxError: Unexpected keyword 'yield'. Expected an identifier as the target for a continue statement.`) - -testSyntax(` -function *test() { - "OK" ? yield : "NG"; // This is not a label. -} -`); diff --git a/implementation-contributed/javascriptcore/stress/yield-label.js b/implementation-contributed/javascriptcore/stress/yield-label.js deleted file mode 100644 index 009a3a6e29..0000000000 --- a/implementation-contributed/javascriptcore/stress/yield-label.js +++ /dev/null @@ -1,64 +0,0 @@ -// http://ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors -// If the "yield" label is used under the sloppy mode and the context is not -// a generator context, we can use "yield" as a label. - -(function () { - { - yield: for (var i = 0; i < 1000; ++i) { - break yield; - } - } - { - yield: for (var i = 0; i < 1000; ++i) { - continue yield; - } - } -}()); - - -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -testSyntaxError(` -function test() { - "use strict"; - { - yield: for (var i = 0; i < 1000; ++i) { - break yield; - } - } -} -`, `SyntaxError: Cannot use 'yield' as a label in strict mode.`); - -testSyntaxError(` -function test() { - "use strict"; - { - label: for (var i = 0; i < 1000; ++i) { - break yield; - } - } -} -`, `SyntaxError: Unexpected keyword 'yield'. Expected an identifier as the target for a break statement.`); - -testSyntaxError(` -function test() { - "use strict"; - { - label: for (var i = 0; i < 1000; ++i) { - continue yield; - } - } -} -`, `SyntaxError: Unexpected keyword 'yield'. Expected an identifier as the target for a continue statement.`) diff --git a/implementation-contributed/javascriptcore/stress/yield-named-accessors-generator.js b/implementation-contributed/javascriptcore/stress/yield-named-accessors-generator.js deleted file mode 100644 index a137a3eed2..0000000000 --- a/implementation-contributed/javascriptcore/stress/yield-named-accessors-generator.js +++ /dev/null @@ -1,17 +0,0 @@ -function *t1() { - let object = { - get yield() { - }, - set yield(value) { - } - } -} -function *t2() { - "use strict"; - let object = { - get yield() { - }, - set yield(value) { - } - } -} diff --git a/implementation-contributed/javascriptcore/stress/yield-named-accessors.js b/implementation-contributed/javascriptcore/stress/yield-named-accessors.js deleted file mode 100644 index e2924223e2..0000000000 --- a/implementation-contributed/javascriptcore/stress/yield-named-accessors.js +++ /dev/null @@ -1,17 +0,0 @@ -function t1() { - let object = { - get yield() { - }, - set yield(value) { - } - } -} -function t2() { - "use strict"; - let object = { - get yield() { - }, - set yield(value) { - } - } -} diff --git a/implementation-contributed/javascriptcore/stress/yield-named-variable-generator.js b/implementation-contributed/javascriptcore/stress/yield-named-variable-generator.js deleted file mode 100644 index 3fe8046d1a..0000000000 --- a/implementation-contributed/javascriptcore/stress/yield-named-variable-generator.js +++ /dev/null @@ -1,112 +0,0 @@ -function testSyntax(script) { - try { - eval(script); - } catch (error) { - if (error instanceof SyntaxError) - throw new Error("Bad error: " + String(error)); - } -} - -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -testSyntaxError(` -function *t1() { - var yield = 20; -} -`, `SyntaxError: Cannot use 'yield' as a variable name in a generator function.`); -testSyntaxError(` -function *t1() { - let yield = 20; -} -`, `SyntaxError: Cannot use 'yield' as a lexical variable name in a generator function.`); -testSyntaxError(` -function *t1() { - const yield = 20; -} -`, `SyntaxError: Cannot use 'yield' as a lexical variable name in a generator function.`); - -testSyntaxError(` -function *t1() { - var { yield } = 20; -} -`, `SyntaxError: Cannot use abbreviated destructuring syntax for keyword 'yield'.`); -testSyntaxError(` -function *t1() { - let { yield } = 20; -} -`, `SyntaxError: Cannot use abbreviated destructuring syntax for keyword 'yield'.`); -testSyntaxError(` -function *t1() { - const { yield } = 20; -} -`, `SyntaxError: Cannot use abbreviated destructuring syntax for keyword 'yield'.`); - -testSyntaxError(` -function *t1() { - var { i: yield } = 20; -} -`, `SyntaxError: Cannot use 'yield' as a variable name in a generator function.`); -testSyntaxError(` -function *t1() { - let { i: yield } = 20; -} -`, `SyntaxError: Cannot use 'yield' as a lexical variable name in a generator function.`); -testSyntaxError(` -function *t1() { - const { i: yield } = 20; -} -`, `SyntaxError: Cannot use 'yield' as a lexical variable name in a generator function.`); - -testSyntaxError(` -function *t1() { - var [ yield ] = 20; -} -`, `SyntaxError: Cannot use 'yield' as a variable name in a generator function.`); -testSyntaxError(` -function *t1() { - let [ yield ] = 20; -} -`, `SyntaxError: Cannot use 'yield' as a lexical variable name in a generator function.`); -testSyntaxError(` -function *t1() { - const [ yield ] = 20; -} -`, `SyntaxError: Cannot use 'yield' as a lexical variable name in a generator function.`); - -testSyntaxError(` -function *t1() { - function yield() { } -} -`, `SyntaxError: Unexpected keyword 'yield'`); -testSyntax(` -function t1() { - function *yield() { - } -} -`); - -testSyntaxError(` -function *t1() { - try { - } catch (yield) { - } -} -`, `SyntaxError: Cannot use 'yield' as a catch parameter name in a generator function.`); - -testSyntax(` -function *t1() { - (function yield() {}) -} -`); diff --git a/implementation-contributed/javascriptcore/stress/yield-named-variable.js b/implementation-contributed/javascriptcore/stress/yield-named-variable.js deleted file mode 100644 index 3809b32289..0000000000 --- a/implementation-contributed/javascriptcore/stress/yield-named-variable.js +++ /dev/null @@ -1,198 +0,0 @@ -function testSyntax(script) { - try { - eval(script); - } catch (error) { - if (error instanceof SyntaxError) - throw new Error("Bad error: " + String(error)); - } -} - -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -testSyntax(` -function t1() { - var yield = 20; -} -`); -testSyntax(` -function t1() { - let yield = 20; -} -`); -testSyntax(` -function t1() { - const yield = 20; -} -`); - -testSyntaxError(` -function t1() { - "use strict"; - var yield = 20; -} -`, `SyntaxError: Cannot use 'yield' as a variable name in strict mode.`); -testSyntaxError(` -function t1() { - "use strict"; - let yield = 20; -} -`, `SyntaxError: Cannot use 'yield' as a lexical variable name in strict mode.`); -testSyntaxError(` -function t1() { - "use strict"; - const yield = 20; -} -`, `SyntaxError: Cannot use 'yield' as a lexical variable name in strict mode.`); - -testSyntax(` -function t1() { - var { yield } = 20; -} -`); -testSyntax(` -function t1() { - let { yield } = 20; -} -`); -testSyntax(` -function t1() { - const { yield } = 20; -} -`); - -testSyntaxError(` -function t1() { - "use strict"; - var { yield } = 20; -} -`, `SyntaxError: Cannot use abbreviated destructuring syntax for keyword 'yield'.`); -testSyntaxError(` -function t1() { - "use strict"; - let { yield } = 20; -} -`, `SyntaxError: Cannot use abbreviated destructuring syntax for keyword 'yield'.`); -testSyntaxError(` -function t1() { - "use strict"; - const { yield } = 20; -} -`, `SyntaxError: Cannot use abbreviated destructuring syntax for keyword 'yield'.`); - -testSyntax(` -function t1() { - var { i: yield } = 20; -} -`); -testSyntax(` -function t1() { - let { i: yield } = 20; -} -`); -testSyntax(` -function t1() { - const { i: yield } = 20; -} -`); - -testSyntaxError(` -function t1() { - "use strict"; - var { i: yield } = 20; -} -`, `SyntaxError: Cannot use 'yield' as a variable name in strict mode.`); -testSyntaxError(` -function t1() { - "use strict"; - let { i: yield } = 20; -} -`, `SyntaxError: Cannot use 'yield' as a lexical variable name in strict mode.`); -testSyntaxError(` -function t1() { - "use strict"; - const { i: yield } = 20; -} -`, `SyntaxError: Cannot use 'yield' as a lexical variable name in strict mode.`); - -testSyntax(` -function t1() { - var [ yield ] = 20; -} -`); -testSyntax(` -function t1() { - let [ yield ] = 20; -} -`); -testSyntax(` -function t1() { - const [ yield ] = 20; -} -`); - -testSyntaxError(` -function t1() { - "use strict"; - var [ yield ] = 20; -} -`, `SyntaxError: Cannot use 'yield' as a variable name in strict mode.`); -testSyntaxError(` -function t1() { - "use strict"; - let [ yield ] = 20; -} -`, `SyntaxError: Cannot use 'yield' as a lexical variable name in strict mode.`); -testSyntaxError(` -function t1() { - "use strict"; - const [ yield ] = 20; -} -`, `SyntaxError: Cannot use 'yield' as a lexical variable name in strict mode.`); - -testSyntax(` -function t1() { - function yield() { } -} -`); -testSyntaxError(` -function t1() { - "use strict"; - function yield() { } -} -`, `SyntaxError: Cannot use 'yield' as a function name in strict mode.`); - -testSyntax(` -function t1() { - try { - } catch (yield) { - } -} -`); -testSyntaxError(` -function t1() { - "use strict"; - try { - } catch (yield) { - } -} -`, `SyntaxError: Cannot use 'yield' as a catch parameter name in strict mode.`); - -testSyntax(` -function t1() { - function yield() { - "use strict"; - } -} -`); diff --git a/implementation-contributed/javascriptcore/stress/yield-out-of-generator.js b/implementation-contributed/javascriptcore/stress/yield-out-of-generator.js deleted file mode 100644 index 64200c7473..0000000000 --- a/implementation-contributed/javascriptcore/stress/yield-out-of-generator.js +++ /dev/null @@ -1,166 +0,0 @@ -function testSyntax(script) { - try { - eval(script); - } catch (error) { - if (error instanceof SyntaxError) - throw new Error("Bad error: " + String(error)); - } -} - -function testSyntaxError(script, message) { - var error = null; - try { - eval(script); - } catch (e) { - error = e; - } - if (!error) - throw new Error("Expected syntax error not thrown"); - - if (String(error) !== message) - throw new Error("Bad error: " + String(error)); -} - -testSyntax(` -yield; -`); - -testSyntaxError(` -yield*; -`, "SyntaxError: Unexpected token ';'"); - -testSyntaxError(` -yield 0; -`, "SyntaxError: Unexpected number '0'"); - -testSyntax(` -yield* 0; -`); - -testSyntax(` -function hello() { - yield; -} -`); - -testSyntaxError(` -function hello() { - yield*; -} -`, "SyntaxError: Unexpected token ';'"); - -testSyntaxError(` -function hello() { - yield 0; -} -`, "SyntaxError: Unexpected number '0'"); - -testSyntax(` -function hello() { - yield* 0; -} -`); - -testSyntax(` -function *gen() { - function hello() { - yield; - } -} -`); - -testSyntaxError(` -function *gen() { - function hello() { - yield*; - } -} -`, "SyntaxError: Unexpected token ';'"); - -testSyntaxError(` -function *gen() { - function hello() { - yield 0; - } -} -`, "SyntaxError: Unexpected number '0'"); - -testSyntax(` -function *gen() { - function hello() { - yield* 0; - } -} -`); - -testSyntax(` -function *gen() { - yield; -} -`); - -testSyntaxError(` -function *gen() { - yield*; -} -`, "SyntaxError: Unexpected token '*'"); - -testSyntax(` -function *gen() { - yield 0; -} -`); - -testSyntax(` -function *gen() { - yield* 0; -} -`); - -testSyntax(` -function *gen() { - { - let i = 30; - function ok() { - return i; - } - yield; - } -} -`); - -testSyntaxError(` -function *gen() { - { - let i = 30; - function ok() { - return i; - } - yield*; - } -} -`, "SyntaxError: Unexpected token '*'"); - -testSyntax(` -function *gen() { - { - let i = 30; - function ok() { - return i; - } - yield 0; - } -} -`); - -testSyntax(` -function *gen() { - { - let i = 30; - function ok() { - return i; - } - yield* 0; - } -} -`); diff --git a/implementation-contributed/javascriptcore/stress/yield-reserved-word.js b/implementation-contributed/javascriptcore/stress/yield-reserved-word.js deleted file mode 100644 index e6c5ef2d91..0000000000 --- a/implementation-contributed/javascriptcore/stress/yield-reserved-word.js +++ /dev/null @@ -1,196 +0,0 @@ -function shouldNotThrow(func) { - let error; - try { - func(); - } catch (e) { - error = e; - } - if (error) - throw new Error(`bad error: ${String(error)}`); -} - -function shouldThrow(func, errorMessage) { - let errorThrown = false; - let error; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error('not thrown'); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -function checkClassicNoSyntaxError(source) { - shouldNotThrow(() => eval(source)); -} - -function checkClassicSyntaxError(source, errorMessage) { - shouldThrow(() => eval(source), errorMessage); -} - -function checkStrictSyntaxError(source, errorMessage) { - shouldThrow(() => checkModuleSyntax(source), errorMessage); -} - - -function checkNoSyntaxErrorCases(source) { - checkClassicNoSyntaxError(source); - - // A nested function within a generator is allowed to use the "yield" name again - // within its body because they have FunctionBody[~Yield]. Same with method bodies. - checkClassicNoSyntaxError(`function *gen() { function f() { ${source} } }`); - checkClassicNoSyntaxError(`function *gen() { async function f() { ${source} } }`); - checkClassicNoSyntaxError(`function *gen() { let f = () => { ${source} } }`); - checkClassicNoSyntaxError(`function *gen() { let f = async () => { ${source} } }`); - checkClassicNoSyntaxError(`function *gen() { var o = { f() { ${source} } } }`); - checkClassicNoSyntaxError(`function *gen() { var o = { async f() { ${source} } } }`); - checkClassicNoSyntaxError(`function *gen() { var o = { get f() { ${source} } } }`); - checkClassicNoSyntaxError(`function *gen() { var o = { set f(x) { ${source} } } }`); -} - - -checkNoSyntaxErrorCases(`var yield`); -checkNoSyntaxErrorCases(`let yield`); -checkNoSyntaxErrorCases(`const yield = 1`); -checkNoSyntaxErrorCases(`var {yield} = {}`); -checkNoSyntaxErrorCases(`yield: 1`); -checkNoSyntaxErrorCases(`function yield(){}`); -checkNoSyntaxErrorCases(`function foo(yield){}`); - -checkNoSyntaxErrorCases(`(class { *yield(){} })`); // GeneratorMethod allows "yield" due to PropertyName[?Yield]. -checkNoSyntaxErrorCases(`function *yield(){}`); // GeneratorDeclaration allows "yield" name due to BindingIdentifier[?Yield]. - -checkNoSyntaxErrorCases(`var o = { yield(yield){ var yield } }`); // PropertyName[?Yield] ( UniqueFormalParameters[~Yield] ) { FunctionBody[~Yield] } -checkNoSyntaxErrorCases(`var o = { *yield(){} }`); // GeneratorMethod[?Yield] -checkNoSyntaxErrorCases(`var o = { async yield(){} }`); // AsyncMethod[?Yield] -checkNoSyntaxErrorCases(`var o = { get x(){ var yield } }`); // get PropertyName[?Yield] () { FunctionBody[~Yield] } -checkNoSyntaxErrorCases(`var o = { set x(yield){} }`); // set PropertyName[?Yield] ( PropertySetParameterList) { FunctionBody[~Yield] } -checkNoSyntaxErrorCases(`var o = { set x(yield){} }`); // PropertySetParameterList : FormalParameter[~Yield] - - -// Disallowed inside a generator. - -checkClassicSyntaxError(` -function* foo() { yield: 1; } -`, `SyntaxError: Cannot use 'yield' as a label in a generator function.`); - -checkClassicSyntaxError(` -function* foo() { var yield; } -`, `SyntaxError: Cannot use 'yield' as a variable name in a generator function.`); - -checkClassicSyntaxError(` -function* foo() { let yield; } -`, `SyntaxError: Cannot use 'yield' as a lexical variable name in a generator function.`); - -checkClassicSyntaxError(` -function* foo() { var {yield} = {}; } -`, `SyntaxError: Cannot use abbreviated destructuring syntax for keyword 'yield'.`); - -checkClassicSyntaxError(` -function* foo(yield){} -`, `SyntaxError: Cannot use 'yield' as a parameter name in a generator function.`); - -// GeneratorExpression BindingIdentifier[+Yield] on the name. -checkClassicSyntaxError(` -(function* yield() { }) -`, `SyntaxError: Cannot declare generator function named 'yield'.`); - -// GeneratorDeclaration BindingIdentifier[?Yield] on the name. -checkClassicSyntaxError(` -function* foo() { function* yield(){} } -`, `SyntaxError: Cannot use 'yield' as a generator function name in a generator function.`); - -// class BindingIdentifier[?Yield] on the name. -checkClassicSyntaxError(` -function* gen() { (class yield {}) } -`, `SyntaxError: Unexpected keyword 'yield'. Expected opening '{' at the start of a class body.`); - - -// Disallowed in strict code. - -checkStrictSyntaxError(` -function* foo() { yield: 1; } -`, `SyntaxError: Cannot use 'yield' as a label in strict mode.:2`); - -checkStrictSyntaxError(` -var yield; -`, `SyntaxError: Cannot use 'yield' as a variable name in strict mode.:2`); - -checkStrictSyntaxError(` -let yield; -`, `SyntaxError: Cannot use 'yield' as a lexical variable name in strict mode.:2`); - -checkStrictSyntaxError(` -var {yield} = {}; -`, `SyntaxError: Cannot use abbreviated destructuring syntax for keyword 'yield'.:2`); - -checkStrictSyntaxError(` -yield: 1 -`, `SyntaxError: Cannot use 'yield' as a label in strict mode.:2`); - -checkStrictSyntaxError(` -import {yield} from 'foo' -`, `SyntaxError: Cannot use keyword as imported binding name.:2`); - -checkStrictSyntaxError(` -function* foo(yield){} -`, `SyntaxError: Cannot use 'yield' as a parameter name in strict mode.:2`); - -checkStrictSyntaxError(` -function* yield(){} -`, `SyntaxError: Cannot use 'yield' as a generator function name in strict mode.:2`); - -checkStrictSyntaxError(` -(function* yield(){}) -`, `SyntaxError: Cannot use 'yield' as a generator function name in strict mode.:2`); - -checkStrictSyntaxError(` -function* gen() { (class yield {}) } -`, `SyntaxError: Unexpected keyword 'yield'. Expected opening '{' at the start of a class body.:2`); - -checkClassicSyntaxError(` -function *get() { var o = { yield }; } -`, `SyntaxError: Cannot use 'yield' as a shorthand property name in a generator function.`); - - -// Edge cases where ~Yield re-enables use of yield in non-strict code. - -// FunctionDeclaration[Yield]: -// function BindingIdentifier[?Yield] ( FormalParameters[~Yield] ) { FunctionBody[~Yield] } -checkClassicSyntaxError(`function *gen() { function yield() {} }`, `SyntaxError: Unexpected keyword 'yield'`); -checkClassicNoSyntaxError(`function *gen() { function f(yield) {} }`); - -// FunctionExpression: -// function BindingIdentifier[~Yield]opt ( FormalParameters[~Yield] ) { FunctionBody[~Yield] } -checkClassicNoSyntaxError(`function *gen() { (function yield() {}) }`); -checkClassicNoSyntaxError(`function *gen() { (function f(yield) {}) }`) -checkClassicNoSyntaxError(`function *gen() { (function yield(yield) {}) }`) -checkClassicNoSyntaxError(`function *gen() { (function(yield) {}) }`); - -// AsyncFunctionDeclaration[Yield]: -// async function BindingIdentifier[?Yield] ( FormalParameters[~Yield]) { AsyncFunctionBody } -checkClassicSyntaxError(`function *gen() { async function yield() {} }`, `SyntaxError: Unexpected keyword 'yield'`); -checkClassicNoSyntaxError(`function *gen() { async function f(yield) {} }`); - -// AsyncFunctionExpression: -// async function BindingIdentifier[~Yield]opt ( FormalParameters[~Yield] ) { AsyncFunctionBody } -checkClassicNoSyntaxError(`function *gen() { (async function yield() {}) }`); -checkClassicNoSyntaxError(`function *gen() { (async function f(yield) {}) }`) -checkClassicNoSyntaxError(`function *gen() { (async function yield(yield) {}) }`); -checkClassicNoSyntaxError(`function *gen() { (async function(yield) {}) }`); - -// ArrowFunction[Yield]: -// ArrowParameters[?Yield] => ConciseBody -checkClassicSyntaxError(`function *gen() { let f = (yield) => {} }`, `SyntaxError: Cannot use 'yield' as a parameter name in a generator function.`); - -// ArrowFunction[Yield]: -// ArrowParameters[?Yield] => ConciseBody -checkClassicSyntaxError(`function *gen() { let f = (yield) => {} }`, `SyntaxError: Cannot use 'yield' as a parameter name in a generator function.`); - -// AsyncArrowFunction[Yield]: -// async AsyncArrowBindingIdentifier[?Yield] => AsyncConciseBody -checkClassicSyntaxError(`function *gen() { let f = async (yield) => {} }`, `SyntaxError: Cannot use 'yield' as a parameter name in a generator function.`); diff --git a/implementation-contributed/javascriptcore/stress/yield-star-throw-continue.js b/implementation-contributed/javascriptcore/stress/yield-star-throw-continue.js deleted file mode 100644 index 46efaa6e7c..0000000000 --- a/implementation-contributed/javascriptcore/stress/yield-star-throw-continue.js +++ /dev/null @@ -1,73 +0,0 @@ -function shouldBe(actual, expected) { - if (actual !== expected) - throw new Error(`bad value: ${String(actual)}`); -} - -function shouldThrow(func, errorMessage) { - var errorThrown = false; - var error = null; - try { - func(); - } catch (e) { - errorThrown = true; - error = e; - } - if (!errorThrown) - throw new Error("not thrown"); - if (String(error) !== errorMessage) - throw new Error(`bad error: ${String(error)}`); -} - -(function () { - function * generator() { - yield * (function * () { - try { - yield "foo"; - } catch(e) { - return; - } - }()); - // OK, continue executing. - yield "bar"; - } - var iter = generator(); - iter.next(); - shouldBe(iter["throw"]().value, "bar"); -}()); - -(function () { - function * generator() { - yield * (function * () { - try { - yield "foo"; - } catch (e) { - throw e; - } - }()); - // OK, continue executing. - yield "bar"; - } - var iter = generator(); - iter.next(); - shouldThrow(() => { - iter["throw"](new Error("NG")); - }, `Error: NG`); -}()); - -(function () { - function * generator() { - yield * (function * () { - try { - yield "foo"; - } catch (e) { - } - yield "cocoa"; - }()); - // OK, continue executing. - yield "bar"; - } - var iter = generator(); - iter.next(); - shouldBe(iter["throw"]().value, "cocoa"); - shouldBe(iter.next().value, "bar"); -}()); -- GitLab