V8 developer is here. This question has no easy answer.
Most of the optimizations will come back (of course, due to the extra processor time). For example, optimized code that needs to be thrown away will eventually be recompiled.
Some optimizations will be disabled forever. For example, the V8 skips certain checks when (and until) it knows that the prototype chains have not been removed. If he sees that the application modifies the prototype chains, it is safe from now on.
To make things even more complex, the details can and will change over time. (That's why there is little point in listing more specific circumstances here, sorry.)
Background:
There are many places in JavaScript where code can do a certain thing that the JavaScript engine should check, but most code doesn't. (Take, for example, the inheritance of missing elements from an array prototype: ['a', ,'c'][1] Array.prototype[1] = 'b' ['a', ,'c'][1] almost always returns undefined , unless someone has made Array.prototype[1] = 'b' or Object.prototype[1] = 'b' .) Thus, when creating optimized code for a function, the engine should select two options:
(A) Always check the item in question (in the example: go through the array prototype chain and check each prototype to see if it has an element in this index). Suppose that the execution of this code takes 2 units of time.
(B) It is optimistic to assume that prototypes of arrays have no elements and pass the test (in the example: don't even look at prototypes, just return undefined ). Let them say that it brings runtime up to a unit of time (twice as fast, yay!). However, to be true, the engine must now closely monitor the prototype chains of all arrays, and if any elements appear anywhere, all code based on this assumption must be found and thrown away at the cost of 1000 units of time.
Given this compromise, it makes sense that the engine first follows a quick but risky strategy (B), but when it fails even once, it switches to a safer strategy (A) to avoid risking paying a fine for 1000 time units again.
You can argue whether "even once" is the best threshold, or whether the site should receive 2, 3, or even more free passes before giving up (B), but that will not change the fundamental compromise.