Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1.9>master] [1.8>1.9] [MERGE #4627 @meg-gupta] Fix missed copyprop o…
…pportunity due to unhandled InitFld case Merge pull request #4627 from meg-gupta:fixopt ```var num = 50; function inlineCall(tnum) { return {x : tnum}; // InitFld } function foo (obj) { var tnum = num; var sum = 0; while (tnum >= 0) { var retObj = inlineCall(tnum); if (tnum > 10) { sum += retObj.x; // missed copy prop opportunity } tnum--; } return sum; } var obj = {}; foo(obj); foo(obj); foo(obj) ``` We were not setting a property initialized from InitFld instruction on the liveFields bit vector, this led to returning null valueInfo when we queried through GlobOptBlockData::FindPropertyValue, because that function checks if the property is live first and then queries its valauenumber from the symToValue map. This pattern comes up in forof on array iterators, the constructor returns an object literal and we miss copy proping "done" and "value" fields of the iterator object.
- Loading branch information