On Wed, Nov 26, 2014 at 2:11 PM, Deguo Meng <mengde...@gmail.com> wrote: > Hello , > Could anybody help me to explain the difference between > "Uninitialized" state & "Pre-monomorphic" state. I get a description as > following : > " > > Uninitialized: this is a generic stub. > > We're in this state when we've never seen any object at a property access > site (which is just another way of saying: when this particular property > access at this particular code location has never been exercised). This stub > does a dynamic lookup; once that lookup is complete, this stub rewrites the > call to the inline cache stub to be a call to a different stub, the > pre-monomorphic one. > > Pre-monomorphic: this is a generic stub. > > This also performs a run-time lookup then rewrites the call to be to a > different stub: a customized monomorphic one, which is written just in time. > Why even bother with this state? Because in JS, lots of code is executed > exactly once (setup, initialization). Don't want to go to the trouble of > generating customized, optimized code (the monomorphic stub) for a property > access if it only occurs once. > > " > > "Uninitialized" do a dynamic look up & "Pre-monomorphic" do run-time lookup > ? what's the difference ? Could any body show some detailed information ?
I don't believe there is a difference, they both do dynamic lookups. This may have changed with the addition of TurboFan but in older V8 versions, the same code stub is used for uninitialized and pre-monomorphic ICs. The pre-monomorphic case is simply to avoid creating a "heavyweight" IC for code that executes only once because that would be pointless. -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.