Commit d65e5e23 authored by Shu-yu Guo's avatar Shu-yu Guo Committed by V8 LUCI CQ

Ship findLast and findLastIndex

I2S:
https://groups.google.com/a/chromium.org/g/blink-dev/c/r6yl8pfmf9s/m/ApOmYIuNBgAJ

Also adds findLast and findLastIndex to the list of no-side-effect
builtins for the debugger.

Bug: v8:11990
Change-Id: I285bf499afc2632ffb4e22cf2ea13c978e21e979
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3217757Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77328}
parent 9ffb4829
......@@ -563,6 +563,8 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtin id) {
case Builtin::kArrayPrototypeFill:
case Builtin::kArrayPrototypeFind:
case Builtin::kArrayPrototypeFindIndex:
case Builtin::kArrayPrototypeFindLast:
case Builtin::kArrayPrototypeFindLastIndex:
case Builtin::kArrayPrototypeFlat:
case Builtin::kArrayPrototypeFlatMap:
case Builtin::kArrayPrototypeJoin:
......@@ -595,6 +597,8 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtin id) {
case Builtin::kTypedArrayPrototypeValues:
case Builtin::kTypedArrayPrototypeFind:
case Builtin::kTypedArrayPrototypeFindIndex:
case Builtin::kTypedArrayPrototypeFindLast:
case Builtin::kTypedArrayPrototypeFindLastIndex:
case Builtin::kTypedArrayPrototypeIncludes:
case Builtin::kTypedArrayPrototypeJoin:
case Builtin::kTypedArrayPrototypeIndexOf:
......@@ -1049,6 +1053,8 @@ static bool TransitivelyCalledBuiltinHasNoSideEffect(Builtin caller,
case Builtin::kArrayFilterLoopContinuation:
case Builtin::kArrayFindIndexLoopContinuation:
case Builtin::kArrayFindLoopContinuation:
case Builtin::kArrayFindLastIndexLoopContinuation:
case Builtin::kArrayFindLastLoopContinuation:
case Builtin::kArrayForEachLoopContinuation:
case Builtin::kArrayIncludesHoleyDoubles:
case Builtin::kArrayIncludesPackedDoubles:
......
......@@ -313,8 +313,7 @@ DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features")
#endif
// Features that are complete (but still behind --harmony/es-staging flag).
#define HARMONY_STAGED_BASE(V) \
V(harmony_array_find_last, "harmony array find last helpers")
#define HARMONY_STAGED_BASE(V)
#ifdef V8_INTL_SUPPORT
#define HARMONY_STAGED(V) \
......@@ -335,7 +334,8 @@ DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features")
V(harmony_relative_indexing_methods, "harmony relative indexing methods") \
V(harmony_error_cause, "harmony error cause property") \
V(harmony_object_has_own, "harmony Object.hasOwn") \
V(harmony_class_static_blocks, "harmony static initializer blocks")
V(harmony_class_static_blocks, "harmony static initializer blocks") \
V(harmony_array_find_last, "harmony array find last helpers")
#ifdef V8_INTL_SUPPORT
#define HARMONY_SHIPPING(V) \
......
......@@ -74,7 +74,7 @@ function listener(event, exec_state, event_data, data) {
fail(`Array.of(1, 2, 3)`);
var function_param = [
"flatMap", "forEach", "every", "some", "reduce", "reduceRight", "find",
"filter", "map", "findIndex"
"filter", "map", "findIndex", "findLast", "findLastIndex"
];
var fails = ["pop", "push", "reverse", "shift", "unshift", "splice",
"sort", "copyWithin", "fill"];
......@@ -124,7 +124,7 @@ function listener(event, exec_state, event_data, data) {
success({0: 1, 1: 2}, `Uint8Array.of(1, 2)`);
function_param = [
"forEach", "every", "some", "reduce", "reduceRight", "find", "filter",
"map", "findIndex"
"map", "findIndex", "findLast", "findLastIndex",
];
fails = ["reverse", "sort", "copyWithin", "fill", "set"];
var typed_proto_proto = Object.getPrototypeOf(Object.getPrototypeOf(new Uint8Array()));
......
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