Commit 710baad4 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: [turbofan] First step towards sanitizing for-in and making it optimizable.

Port e2e47f30

Original commit message:
In a nutshell: The FILTER_KEY builtin is gone, and was replaced by a
simple runtime call to ForInFilter, which does everything and is even
cheaper (because FILTER_KEY used to call into the runtime anyway).
And ForInFilter returns either the name or undefined, which makes it
possible to remove the control flow construction from the AstGraphBuilder,
and thereby make both the initialization and the per-loop code of for-in
optimizable later (in typed lowering).

R=bmeurer@chromium.org, dstence@us.ibm.com, michael_dawson@ca.ibm.com
BUG=

Review URL: https://codereview.chromium.org/1160973004

Cr-Commit-Position: refs/heads/master@{#28734}
parent 1a23f031
......@@ -1232,10 +1232,11 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
// any more. If the property has been removed while iterating, we
// just skip it.
__ Push(r4, r6); // Enumerable and current entry.
__ InvokeBuiltin(Builtins::FILTER_KEY, CALL_FUNCTION);
__ CallRuntime(Runtime::kForInFilter, 2);
PrepareForBailoutForId(stmt->FilterId(), TOS_REG);
__ mr(r6, r3);
__ cmpi(r6, Operand::Zero());
__ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
__ cmp(r3, r0);
__ beq(loop_statement.continue_label());
// Update the 'each' property or variable from the possibly filtered
......
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