Commit afba7942 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

Revert "[mjsunit] Add test that calls functions on prototypes with no arguments"

This reverts commit 5fbc5015.

Reason for revert: Fails on noi18n: https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20noi18n%20-%20debug/26006

Original change's description:
> [mjsunit] Add test that calls functions on prototypes with no arguments
> 
> Change-Id: I0ede9f309b89cfa878a325e3f68327b1682d4ced
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1538123
> Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60541}

TBR=jarin@chromium.org,sigurds@chromium.org

Change-Id: I4b9c747e6d73dd3ff01af81c3d1e6143dcab6ecd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1547652Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60544}
parent f7440702
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
const types = [
[Object, "{}"],
[String, "\"abc\""],
[RegExp, "/abc/"],
[WeakMap, "(new WeakMap())"],
[WeakSet, "(new WeakSet())"],
[Map, "(new Map())"],
[Set, "(new Set())"],
[Function, "(function f() {return 1})"],
[Array, "[1,2,3, {}]"],
[Boolean, "(new Boolean())"],
[Symbol, "(new Symbol())"],
[BigInt, "(new BigInt(42))"],
[Math, "Math"],
[Date, "(new Date())"],
[Promise, "(new Promise())"],
[Reflect, "Reflect"],
[Proxy, "(new Proxy({}, {}))"],
[Intl, "Intl"],
[Intl.Collator, "Intl.Collator"],
[Intl.ListFormat, "Intl.ListFormat"],
[Intl.NumberFormat, "Intl.NumberFormat"],
[Intl.PluralRules, "Intl.PluralRules"],
[Intl.RelativeTimeFormat, "Intl.RelativeTimeFormat"],
];
const callTemplate = () => {
function f() {
return constr_exp.propCall(args)
}
%PrepareFunctionForOptimization(f);
try { f(); } catch (e) {}
try { f(); } catch (e) {}
%OptimizeFunctionOnNextCall(f);
try { f(); } catch (e) {}
}
const mkCall = (constr_exp, propCall) => {
const arrowFunction = callTemplate.toString().replace("constr_exp", constr_exp).replace("propCall", propCall).replace("args", "");
return `(${arrowFunction})();`;
}
for ([type, constr_exp, blacklist] of types) {
const proto = type.prototype || type;
for (const f of Object.getOwnPropertyNames(proto)) {
const d = Object.getOwnPropertyDescriptor(proto, f);
if (d.get || d.set || (typeof proto[f]) != "function") continue;
const source = mkCall(constr_exp, f);
try {
eval(source);
} catch (err) {
// Exceptions are OK.
console.log(`EXN ${err} for ${type.toString()} ${f}`)
console.log(source);
continue;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment