| 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/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 2702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2713 | 2713 |
| 2714 // Allocate object to hold object observation state. | 2714 // Allocate object to hold object observation state. |
| 2715 set_observation_state(*factory->NewJSObjectFromMap( | 2715 set_observation_state(*factory->NewJSObjectFromMap( |
| 2716 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize))); | 2716 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize))); |
| 2717 | 2717 |
| 2718 // Microtask queue uses the empty fixed array as a sentinel for "empty". | 2718 // Microtask queue uses the empty fixed array as a sentinel for "empty". |
| 2719 // Number of queued microtasks stored in Isolate::pending_microtask_count(). | 2719 // Number of queued microtasks stored in Isolate::pending_microtask_count(). |
| 2720 set_microtask_queue(empty_fixed_array()); | 2720 set_microtask_queue(empty_fixed_array()); |
| 2721 | 2721 |
| 2722 { | 2722 { |
| 2723 FeedbackVectorSlotKind kinds[] = {FeedbackVectorSlotKind::LOAD_IC, | 2723 StaticFeedbackVectorSpec spec; |
| 2724 FeedbackVectorSlotKind::KEYED_LOAD_IC, | 2724 FeedbackVectorSlot load_ic_slot = spec.AddLoadICSlot(); |
| 2725 FeedbackVectorSlotKind::STORE_IC, | 2725 FeedbackVectorSlot keyed_load_ic_slot = spec.AddKeyedLoadICSlot(); |
| 2726 FeedbackVectorSlotKind::KEYED_STORE_IC}; | 2726 FeedbackVectorSlot store_ic_slot = spec.AddStoreICSlot(); |
| 2727 StaticFeedbackVectorSpec spec(0, 4, kinds); | 2727 FeedbackVectorSlot keyed_store_ic_slot = spec.AddKeyedStoreICSlot(); |
| 2728 |
| 2729 DCHECK_EQ(load_ic_slot, |
| 2730 FeedbackVectorSlot(TypeFeedbackVector::kDummyLoadICSlot)); |
| 2731 DCHECK_EQ(keyed_load_ic_slot, |
| 2732 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); |
| 2733 DCHECK_EQ(store_ic_slot, |
| 2734 FeedbackVectorSlot(TypeFeedbackVector::kDummyStoreICSlot)); |
| 2735 DCHECK_EQ(keyed_store_ic_slot, |
| 2736 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
| 2737 |
| 2728 Handle<TypeFeedbackVector> dummy_vector = | 2738 Handle<TypeFeedbackVector> dummy_vector = |
| 2729 factory->NewTypeFeedbackVector(&spec); | 2739 TypeFeedbackVector::New(isolate(), &spec); |
| 2730 for (int i = 0; i < 4; i++) { | 2740 |
| 2731 dummy_vector->Set(FeedbackVectorICSlot(0), | 2741 Object* megamorphic = *TypeFeedbackVector::MegamorphicSentinel(isolate()); |
| 2732 *TypeFeedbackVector::MegamorphicSentinel(isolate()), | 2742 dummy_vector->Set(load_ic_slot, megamorphic, SKIP_WRITE_BARRIER); |
| 2733 SKIP_WRITE_BARRIER); | 2743 dummy_vector->Set(keyed_load_ic_slot, megamorphic, SKIP_WRITE_BARRIER); |
| 2734 } | 2744 dummy_vector->Set(store_ic_slot, megamorphic, SKIP_WRITE_BARRIER); |
| 2745 dummy_vector->Set(keyed_store_ic_slot, megamorphic, SKIP_WRITE_BARRIER); |
| 2746 |
| 2735 set_dummy_vector(*dummy_vector); | 2747 set_dummy_vector(*dummy_vector); |
| 2736 } | 2748 } |
| 2737 | 2749 |
| 2738 set_detached_contexts(empty_fixed_array()); | 2750 set_detached_contexts(empty_fixed_array()); |
| 2739 set_retained_maps(ArrayList::cast(empty_fixed_array())); | 2751 set_retained_maps(ArrayList::cast(empty_fixed_array())); |
| 2740 | 2752 |
| 2741 set_weak_object_to_code_table( | 2753 set_weak_object_to_code_table( |
| 2742 *WeakHashTable::New(isolate(), 16, USE_DEFAULT_MINIMUM_CAPACITY, | 2754 *WeakHashTable::New(isolate(), 16, USE_DEFAULT_MINIMUM_CAPACITY, |
| 2743 TENURED)); | 2755 TENURED)); |
| 2744 | 2756 |
| (...skipping 3340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6085 } | 6097 } |
| 6086 | 6098 |
| 6087 | 6099 |
| 6088 // static | 6100 // static |
| 6089 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6101 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6090 return StaticVisitorBase::GetVisitorId(map); | 6102 return StaticVisitorBase::GetVisitorId(map); |
| 6091 } | 6103 } |
| 6092 | 6104 |
| 6093 } // namespace internal | 6105 } // namespace internal |
| 6094 } // namespace v8 | 6106 } // namespace v8 |
| OLD | NEW |