From b4ccb16a979eca94be735691d736287b3715f736 Mon Sep 17 00:00:00 2001 From: bjaideep Date: Sun, 13 Nov 2016 19:18:28 -0800 Subject: [PATCH] PPC/s390: [turbofan] Remove special JSForInStep and JSForInDone. Port 1915762cc8caea42727daebfe738bfcdca8ac859 Original commit message: These JavaScript operators were special hacks to ensure that we always operate on Smis for the magic for-in index variable, but this never really worked in the OSR case, because the OsrValue for the index variable didn't have the proper information (that we have for the JSForInPrepare in the non-OSR case). Now that we have loop induction variable analysis and binary operation hints, we can just use JSLessThan and JSAdd instead with appropriate Smi hints, which handle the OSR case by inserting Smi checks (that are always true). Thanks to OSR deconstruction and loop peeling these Smi checks will be hoisted so they don't hurt the OSR case too much. Drive-by-change: Rename the ForInDone bytecode to ForInContinue, since we have to lower it to JSLessThan to get the loop induction variable goodness. R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com BUG= LOG=N Review-Url: https://codereview.chromium.org/2502503002 Cr-Commit-Position: refs/heads/master@{#40947} --- src/full-codegen/ppc/full-codegen-ppc.cc | 1 + src/full-codegen/s390/full-codegen-s390.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/src/full-codegen/ppc/full-codegen-ppc.cc b/src/full-codegen/ppc/full-codegen-ppc.cc index a973ba6f73c8..85d198da2f59 100644 --- a/src/full-codegen/ppc/full-codegen-ppc.cc +++ b/src/full-codegen/ppc/full-codegen-ppc.cc @@ -1116,6 +1116,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { // Generate code for the going to the next element by incrementing // the index (smi) stored on top of the stack. __ bind(loop_statement.continue_label()); + PrepareForBailoutForId(stmt->IncrementId(), BailoutState::NO_REGISTERS); __ pop(r3); __ AddSmiLiteral(r3, r3, Smi::FromInt(1), r0); __ push(r3); diff --git a/src/full-codegen/s390/full-codegen-s390.cc b/src/full-codegen/s390/full-codegen-s390.cc index 47755895b994..91fa86de809b 100644 --- a/src/full-codegen/s390/full-codegen-s390.cc +++ b/src/full-codegen/s390/full-codegen-s390.cc @@ -1085,6 +1085,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { // Generate code for the going to the next element by incrementing // the index (smi) stored on top of the stack. __ bind(loop_statement.continue_label()); + PrepareForBailoutForId(stmt->IncrementId(), BailoutState::NO_REGISTERS); __ pop(r2); __ AddSmiLiteral(r2, r2, Smi::FromInt(1), r0); __ push(r2);