| Auto-Submit | +1 |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
Nice! LGTM % forcing ReduceResult
ValueNode* length) -> MaybeReduceResult {ReduceResult
ValueNode* length) -> MaybeReduceResult {ReduceResult
return Reducer(elements_kind, elements, length);Let's restrict Reducer to return a ReduceResult, not a MaybeReduceResult. Because, by this point we have already inserted map checks and emitted loads, we should not fail the reduction.
We can either do:
```
ReduceResult result = Reducer(elements_kind, elements, length);
return result;
```
or we can change the typename ReducerCb to base::FunctionRef<ReduceResult(...args...)
Up to you.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +2 |
Nice! LGTM % forcing ReduceResult
Done
ValueNode* length) -> MaybeReduceResult {Olivier FlückigerReduceResult
Done
ValueNode* length) -> MaybeReduceResult {Olivier FlückigerReduceResult
Done
Let's restrict Reducer to return a ReduceResult, not a MaybeReduceResult. Because, by this point we have already inserted map checks and emitted loads, we should not fail the reduction.
We can either do:
```
ReduceResult result = Reducer(elements_kind, elements, length);
return result;
```or we can change the typename ReducerCb to base::FunctionRef<ReduceResult(...args...)
Up to you.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
4 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: src/maglev/maglev-reducer-inl.h
Insertions: 4, Deletions: 5.
@@ -927,7 +927,8 @@
ValueNode* elements;
GET_VALUE_OR_ABORT(elements, BuildLoadElements(receiver, elements_kind));
- return Reducer(elements_kind, elements, length);
+ ReduceResult res = Reducer(elements_kind, elements, length);
+ return res;
}
template <typename BaseT>
@@ -936,8 +937,7 @@
const char* builtin_name, CallArguments& args, ReducerCb Reducer) {
return TryWithFastArrayElements(
builtin_name, args,
- [&](ElementsKind elements_kind, ValueNode* elements,
- ValueNode* length) -> MaybeReduceResult {
+ [&](ElementsKind elements_kind, ValueNode* elements, ValueNode* length) {
ValueNode* search_element =
args.count() > 0 ? args[0]
: GetRootConstant(RootIndex::kUndefinedValue);
@@ -1128,8 +1128,7 @@
compiler::JSFunctionRef target, CallArguments& args) {
return TryWithFastArrayElements(
"Array.prototype.at", args,
- [&](ElementsKind elements_kind, ValueNode* elements,
- ValueNode* length) -> MaybeReduceResult {
+ [&](ElementsKind elements_kind, ValueNode* elements, ValueNode* length) {
ValueNode* index = nullptr;
if (args.count() == 0) {
// Index is the undefined object. ToIntegerOrInfinity(undefined) = 0.
```
[maglev] Refactor TryWithArrayIterationArgs into layered helpers
Extract TryWithFastArrayElements as a standalone foundational base
helper in MaglevReducer to handle fast array iteration checks and
operations.
Re-implement TryWithArrayIterationArgs to build directly on top of
TryWithFastArrayElements, separating argument search element extraction
and fromIndex clamping logic from core array setup.
Refactor TryReduceArrayPrototypeAt to use TryWithFastArrayElements,
eliminating its unconditional NoElementsProtector dependency on packed
arrays, ensuring IsArrayLength::kYes is passed when loading length,
and deduplicating initial receiver check boilerplate.
Bug: 42204525
TAG=agy
CONV=c99a500e-d220-44f7-a578-b5242feca754
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |