OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/heap/heap.h" | 5 #include "src/heap/heap.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/ast/context-slot-cache.h" | 9 #include "src/ast/context-slot-cache.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 2761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2772 | 2772 |
2773 // The symbol registry is initialized lazily. | 2773 // The symbol registry is initialized lazily. |
2774 set_symbol_registry(Smi::FromInt(0)); | 2774 set_symbol_registry(Smi::FromInt(0)); |
2775 | 2775 |
2776 // Microtask queue uses the empty fixed array as a sentinel for "empty". | 2776 // Microtask queue uses the empty fixed array as a sentinel for "empty". |
2777 // Number of queued microtasks stored in Isolate::pending_microtask_count(). | 2777 // Number of queued microtasks stored in Isolate::pending_microtask_count(). |
2778 set_microtask_queue(empty_fixed_array()); | 2778 set_microtask_queue(empty_fixed_array()); |
2779 | 2779 |
2780 { | 2780 { |
2781 StaticFeedbackVectorSpec spec; | 2781 StaticFeedbackVectorSpec spec; |
2782 FeedbackVectorSlot load_ic_slot = spec.AddLoadICSlot(); | 2782 FeedbackVectorSlot slot = spec.AddLoadICSlot(); |
2783 FeedbackVectorSlot keyed_load_ic_slot = spec.AddKeyedLoadICSlot(); | 2783 DCHECK_EQ(slot, FeedbackVectorSlot(TypeFeedbackVector::kDummyLoadICSlot)); |
2784 FeedbackVectorSlot store_ic_slot = spec.AddStoreICSlot(); | |
2785 FeedbackVectorSlot keyed_store_ic_slot = spec.AddKeyedStoreICSlot(); | |
2786 | 2784 |
2787 DCHECK_EQ(load_ic_slot, | 2785 slot = spec.AddKeyedLoadICSlot(); |
2788 FeedbackVectorSlot(TypeFeedbackVector::kDummyLoadICSlot)); | 2786 DCHECK_EQ(slot, |
2789 DCHECK_EQ(keyed_load_ic_slot, | |
2790 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); | 2787 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); |
2791 DCHECK_EQ(store_ic_slot, | 2788 |
2792 FeedbackVectorSlot(TypeFeedbackVector::kDummyStoreICSlot)); | 2789 slot = spec.AddStoreICSlot(); |
2793 DCHECK_EQ(keyed_store_ic_slot, | 2790 DCHECK_EQ(slot, FeedbackVectorSlot(TypeFeedbackVector::kDummyStoreICSlot)); |
| 2791 |
| 2792 slot = spec.AddKeyedStoreICSlot(); |
| 2793 DCHECK_EQ(slot, |
2794 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); | 2794 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
2795 | 2795 |
2796 Handle<TypeFeedbackMetadata> dummy_metadata = | 2796 Handle<TypeFeedbackMetadata> dummy_metadata = |
2797 TypeFeedbackMetadata::New(isolate(), &spec); | 2797 TypeFeedbackMetadata::New(isolate(), &spec); |
2798 Handle<TypeFeedbackVector> dummy_vector = | 2798 Handle<TypeFeedbackVector> dummy_vector = |
2799 TypeFeedbackVector::New(isolate(), dummy_metadata); | 2799 TypeFeedbackVector::New(isolate(), dummy_metadata); |
2800 | 2800 |
2801 Object* megamorphic = *TypeFeedbackVector::MegamorphicSentinel(isolate()); | 2801 set_dummy_vector(*dummy_vector); |
2802 dummy_vector->Set(load_ic_slot, megamorphic, SKIP_WRITE_BARRIER); | |
2803 dummy_vector->Set(keyed_load_ic_slot, megamorphic, SKIP_WRITE_BARRIER); | |
2804 dummy_vector->Set(store_ic_slot, megamorphic, SKIP_WRITE_BARRIER); | |
2805 dummy_vector->Set(keyed_store_ic_slot, megamorphic, SKIP_WRITE_BARRIER); | |
2806 | 2802 |
2807 set_dummy_vector(*dummy_vector); | 2803 // Now initialize dummy vector's entries. |
| 2804 LoadICNexus(isolate()).ConfigureMegamorphic(); |
| 2805 StoreICNexus(isolate()).ConfigureMegamorphic(); |
| 2806 KeyedLoadICNexus(isolate()).ConfigureMegamorphicKeyed(PROPERTY); |
| 2807 KeyedStoreICNexus(isolate()).ConfigureMegamorphicKeyed(PROPERTY); |
2808 } | 2808 } |
2809 | 2809 |
2810 { | 2810 { |
2811 // Create a canonical empty TypeFeedbackVector, which is shared by all | 2811 // Create a canonical empty TypeFeedbackVector, which is shared by all |
2812 // functions that don't need actual type feedback slots. Note however | 2812 // functions that don't need actual type feedback slots. Note however |
2813 // that all these functions will share the same invocation count, but | 2813 // that all these functions will share the same invocation count, but |
2814 // that shouldn't matter since we only use the invocation count to | 2814 // that shouldn't matter since we only use the invocation count to |
2815 // relativize the absolute call counts, but we can only have call counts | 2815 // relativize the absolute call counts, but we can only have call counts |
2816 // if we have actual feedback slots. | 2816 // if we have actual feedback slots. |
2817 Handle<FixedArray> empty_type_feedback_vector = factory->NewFixedArray( | 2817 Handle<FixedArray> empty_type_feedback_vector = factory->NewFixedArray( |
(...skipping 3722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6540 } | 6540 } |
6541 | 6541 |
6542 | 6542 |
6543 // static | 6543 // static |
6544 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6544 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6545 return StaticVisitorBase::GetVisitorId(map); | 6545 return StaticVisitorBase::GetVisitorId(map); |
6546 } | 6546 } |
6547 | 6547 |
6548 } // namespace internal | 6548 } // namespace internal |
6549 } // namespace v8 | 6549 } // namespace v8 |
OLD | NEW |