2 // If the structure check hoister is overzealous, it will hoist the structure check of
3 // S3 up to the assignment of o, where the structure is actually S1. Doing so will cause
4 // this function to OSR exit every time.
6 var o = {}; // This will create an object with structure S1.
7 o.f = 42; // This will check for S1, and then transition to S2.
8 o.g = 43; // This will check for S2, and then transition to S3.
9 for (var i = 0; i < 5; ++i)
10 o.g++; // This will have a structure check on structure S3, which the structure check hoister will want to hoist.
15 for (var i = 0; i < 100000; ++i)
18 if (result != 4800000)
19 throw ("Error: bad result: " + result);