| Index: src/objects.cc
|
| ===================================================================
|
| --- src/objects.cc (revision 19457)
|
| +++ src/objects.cc (working copy)
|
| @@ -10637,12 +10637,16 @@
|
| if (raw_info->IsTypeFeedbackInfo()) {
|
| FixedArray* feedback_vector =
|
| TypeFeedbackInfo::cast(raw_info)->feedback_vector();
|
| + Object* premonomorphic_sentinel =
|
| + TypeFeedbackInfo::RawPremonomorphicSentinel(heap);
|
| for (int i = 0; i < feedback_vector->length(); i++) {
|
| Object* obj = feedback_vector->get(i);
|
| - if (!obj->IsAllocationSite()) {
|
| - // TODO(mvstanton): Can't I avoid a write barrier for this sentinel?
|
| - feedback_vector->set(i,
|
| - TypeFeedbackInfo::RawUninitializedSentinel(heap));
|
| + // If the cache is monomorphic (non-arrays) or megamorphic we go
|
| + // back to premonomorphic.
|
| + ASSERT_EQ(*TypeFeedbackInfo::MegamorphicSentinel(heap->isolate()),
|
| + heap->undefined_value());
|
| + if (obj->IsUndefined() || obj->IsJSFunction()) {
|
| + feedback_vector->set(i, premonomorphic_sentinel, SKIP_WRITE_BARRIER);
|
| }
|
| }
|
| }
|
|
|