Commit 368d04bd authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

Revert "[debug] Mark toLocaleString and TA#join builtins as side-effect free."

This reverts commit 660d8287.

Reason for revert: breaks no-i18n build:
https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20noi18n%20-%20debug/25919

Original change's description:
> [debug] Mark toLocaleString and TA#join builtins as side-effect free.
> 
> Bug: chromium:940373
> Change-Id: If5f90ff5f873f0687c6a6a4063e0d09d6bbbd556
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1533157
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Peter Wong <peter.wm.wong@gmail.com>
> Cr-Commit-Position: refs/heads/master@{#60440}

TBR=yangguo@chromium.org,peter.wm.wong@gmail.com,petermarshall@chromium.org,szuend@chromium.org

Change-Id: I5ee52f8f37bea83e80c53838d232332cb3486640
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:940373
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1538132Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60444}
parent bad7b827
...@@ -504,7 +504,6 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) { ...@@ -504,7 +504,6 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) {
case Builtins::kObjectPrototypeIsPrototypeOf: case Builtins::kObjectPrototypeIsPrototypeOf:
case Builtins::kObjectPrototypePropertyIsEnumerable: case Builtins::kObjectPrototypePropertyIsEnumerable:
case Builtins::kObjectPrototypeToString: case Builtins::kObjectPrototypeToString:
case Builtins::kObjectPrototypeToLocaleString:
// Array builtins. // Array builtins.
case Builtins::kArrayIsArray: case Builtins::kArrayIsArray:
case Builtins::kArrayConstructor: case Builtins::kArrayConstructor:
...@@ -547,14 +546,12 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) { ...@@ -547,14 +546,12 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) {
case Builtins::kTypedArrayPrototypeFind: case Builtins::kTypedArrayPrototypeFind:
case Builtins::kTypedArrayPrototypeFindIndex: case Builtins::kTypedArrayPrototypeFindIndex:
case Builtins::kTypedArrayPrototypeIncludes: case Builtins::kTypedArrayPrototypeIncludes:
case Builtins::kTypedArrayPrototypeJoin:
case Builtins::kTypedArrayPrototypeIndexOf: case Builtins::kTypedArrayPrototypeIndexOf:
case Builtins::kTypedArrayPrototypeLastIndexOf: case Builtins::kTypedArrayPrototypeLastIndexOf:
case Builtins::kTypedArrayPrototypeSlice: case Builtins::kTypedArrayPrototypeSlice:
case Builtins::kTypedArrayPrototypeSubArray: case Builtins::kTypedArrayPrototypeSubArray:
case Builtins::kTypedArrayPrototypeEvery: case Builtins::kTypedArrayPrototypeEvery:
case Builtins::kTypedArrayPrototypeSome: case Builtins::kTypedArrayPrototypeSome:
case Builtins::kTypedArrayPrototypeToLocaleString:
case Builtins::kTypedArrayPrototypeFilter: case Builtins::kTypedArrayPrototypeFilter:
case Builtins::kTypedArrayPrototypeMap: case Builtins::kTypedArrayPrototypeMap:
case Builtins::kTypedArrayPrototypeReduce: case Builtins::kTypedArrayPrototypeReduce:
...@@ -612,9 +609,6 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) { ...@@ -612,9 +609,6 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) {
case Builtins::kDatePrototypeToISOString: case Builtins::kDatePrototypeToISOString:
case Builtins::kDatePrototypeToUTCString: case Builtins::kDatePrototypeToUTCString:
case Builtins::kDatePrototypeToString: case Builtins::kDatePrototypeToString:
case Builtins::kDatePrototypeToLocaleString:
case Builtins::kDatePrototypeToLocaleDateString:
case Builtins::kDatePrototypeToLocaleTimeString:
case Builtins::kDatePrototypeToTimeString: case Builtins::kDatePrototypeToTimeString:
case Builtins::kDatePrototypeToJson: case Builtins::kDatePrototypeToJson:
case Builtins::kDatePrototypeToPrimitive: case Builtins::kDatePrototypeToPrimitive:
...@@ -680,7 +674,6 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) { ...@@ -680,7 +674,6 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) {
case Builtins::kNumberPrototypeToFixed: case Builtins::kNumberPrototypeToFixed:
case Builtins::kNumberPrototypeToPrecision: case Builtins::kNumberPrototypeToPrecision:
case Builtins::kNumberPrototypeToString: case Builtins::kNumberPrototypeToString:
case Builtins::kNumberPrototypeToLocaleString:
case Builtins::kNumberPrototypeValueOf: case Builtins::kNumberPrototypeValueOf:
// BigInt builtins. // BigInt builtins.
case Builtins::kBigIntConstructor: case Builtins::kBigIntConstructor:
...@@ -984,8 +977,6 @@ static bool TransitivelyCalledBuiltinHasNoSideEffect(Builtins::Name caller, ...@@ -984,8 +977,6 @@ static bool TransitivelyCalledBuiltinHasNoSideEffect(Builtins::Name caller,
switch (caller) { switch (caller) {
case Builtins::kArrayPrototypeJoin: case Builtins::kArrayPrototypeJoin:
case Builtins::kArrayPrototypeToLocaleString: case Builtins::kArrayPrototypeToLocaleString:
case Builtins::kTypedArrayPrototypeJoin:
case Builtins::kTypedArrayPrototypeToLocaleString:
return true; return true;
default: default:
return false; return false;
......
...@@ -45,10 +45,11 @@ function listener(event, exec_state, event_data, data) { ...@@ -45,10 +45,11 @@ function listener(event, exec_state, event_data, data) {
if (typeof Date.prototype[f] === "function") { if (typeof Date.prototype[f] === "function") {
if (f.startsWith("set")) { if (f.startsWith("set")) {
fail(`date.${f}(5);`, true); fail(`date.${f}(5);`, true);
} else if (f.startsWith("toLocale") && typeof Intl === "undefined") { } else if (f.startsWith("toLocale")) {
continue; if (typeof Intl === "undefined") continue;
fail(`date.${f}();`, true);
} else { } else {
success(undefined, `date.${f}();`); success(undefined, `date.${f}();`, true);
} }
} }
} }
......
...@@ -59,7 +59,6 @@ function listener(event, exec_state, event_data, data) { ...@@ -59,7 +59,6 @@ function listener(event, exec_state, event_data, data) {
success(true, `Object.prototype.isPrototypeOf({})`); success(true, `Object.prototype.isPrototypeOf({})`);
success(true, `({a:1}).propertyIsEnumerable("a")`); success(true, `({a:1}).propertyIsEnumerable("a")`);
success("[object Object]", `({a:1}).toString()`); success("[object Object]", `({a:1}).toString()`);
success("[object Object]", `({a:1}).toLocaleString()`);
success("string", `(object_with_callbacks).toString()`); success("string", `(object_with_callbacks).toString()`);
success(3, `(object_with_callbacks).valueOf()`); success(3, `(object_with_callbacks).valueOf()`);
...@@ -74,8 +73,8 @@ function listener(event, exec_state, event_data, data) { ...@@ -74,8 +73,8 @@ function listener(event, exec_state, event_data, data) {
"flatMap", "forEach", "every", "some", "reduce", "reduceRight", "find", "flatMap", "forEach", "every", "some", "reduce", "reduceRight", "find",
"filter", "map", "findIndex" "filter", "map", "findIndex"
]; ];
var fails = ["pop", "push", "reverse", "shift", "unshift", "splice", var fails = ["toLocaleString", "pop", "push", "reverse", "shift", "unshift",
"sort", "copyWithin", "fill"]; "splice", "sort", "copyWithin", "fill"];
for (f of Object.getOwnPropertyNames(Array.prototype)) { for (f of Object.getOwnPropertyNames(Array.prototype)) {
if (typeof Array.prototype[f] === "function") { if (typeof Array.prototype[f] === "function") {
if (fails.includes(f)) { if (fails.includes(f)) {
...@@ -124,7 +123,8 @@ function listener(event, exec_state, event_data, data) { ...@@ -124,7 +123,8 @@ function listener(event, exec_state, event_data, data) {
"forEach", "every", "some", "reduce", "reduceRight", "find", "filter", "forEach", "every", "some", "reduce", "reduceRight", "find", "filter",
"map", "findIndex" "map", "findIndex"
]; ];
fails = ["reverse", "sort", "copyWithin", "fill", "set"]; fails = ["toString", "join", "toLocaleString", "reverse", "sort",
"copyWithin", "fill", "set"];
var typed_proto_proto = Object.getPrototypeOf(Object.getPrototypeOf(new Uint8Array())); var typed_proto_proto = Object.getPrototypeOf(Object.getPrototypeOf(new Uint8Array()));
for (f of Object.getOwnPropertyNames(typed_proto_proto)) { for (f of Object.getOwnPropertyNames(typed_proto_proto)) {
if (typeof typed_array[f] === "function" && f !== "constructor") { if (typeof typed_array[f] === "function" && f !== "constructor") {
...@@ -160,7 +160,7 @@ function listener(event, exec_state, event_data, data) { ...@@ -160,7 +160,7 @@ function listener(event, exec_state, event_data, data) {
} }
for (f of Object.getOwnPropertyNames(Number.prototype)) { for (f of Object.getOwnPropertyNames(Number.prototype)) {
if (typeof Number.prototype[f] === "function") { if (typeof Number.prototype[f] === "function") {
if (f == "toLocaleString" && typeof Intl === "undefined") continue; if (f == "toLocaleString") continue;
success(Number(0.5)[f](5), `Number(0.5).${f}(5);`); success(Number(0.5)[f](5), `Number(0.5).${f}(5);`);
} }
} }
......
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