| "Tests what happens when the first attempt to cache an access goes down the unset route and then subsequently it tries to cache using a proto (less warmup)." |
| // Get foo into the LLInt |
| for (var i = 0; i < 10; ++i) |
| // Warm up foo()'s p=true path and make it as polymorphic as possible. |
| for (var i = 0; i < 3; ++i) { |
| // Force compilation by going down p=false. |
| while (!dfgCompiled({f:foo})) |
| for (var j = 0; j < 1; ++j) { |
| for (var i = 0; i < 1000; ++i) |
| shouldBe("foo(true, o)", "42"); |
| // Hit the prototype case. |
| shouldBe("foo(true, new Blah())", "23"); |