Keep the inline caches for the builtins object monomorphic when

libraries are loaded lazily.

Review URL: http://codereview.chromium.org/2885

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@313 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
ager@chromium.org 2008-09-16 09:21:22 +00:00
parent 3f67d5b90f
commit ec5a24dd64

View File

@ -160,6 +160,19 @@ IC::State IC::StateFrom(Code* target, Object* receiver) {
return MONOMORPHIC_PROTOTYPE_FAILURE;
}
// The builtins object is special. It only changes when JavaScript
// builtins are loaded lazily. It is important to keep inline
// caches for the builtins object monomorphic. Therefore, if we get
// an inline cache miss for the builtins object after lazily loading
// JavaScript builtins, we clear the code cache and return
// uninitialized as the state to force the inline cache back to
// monomorphic state.
if (receiver->IsJSBuiltinsObject()) {
map->ClearCodeCache();
return UNINITIALIZED;
}
return MONOMORPHIC;
}