Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: src/heap/heap.cc

Issue 1478943003: Use WeakCells in the optimized code map rather than traversing in pause. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Patch One. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2750 matching lines...) Expand 10 before | Expand all | Expand 10 after
2761 Object* megamorphic = *TypeFeedbackVector::MegamorphicSentinel(isolate()); 2761 Object* megamorphic = *TypeFeedbackVector::MegamorphicSentinel(isolate());
2762 dummy_vector->Set(load_ic_slot, megamorphic, SKIP_WRITE_BARRIER); 2762 dummy_vector->Set(load_ic_slot, megamorphic, SKIP_WRITE_BARRIER);
2763 dummy_vector->Set(keyed_load_ic_slot, megamorphic, SKIP_WRITE_BARRIER); 2763 dummy_vector->Set(keyed_load_ic_slot, megamorphic, SKIP_WRITE_BARRIER);
2764 dummy_vector->Set(store_ic_slot, megamorphic, SKIP_WRITE_BARRIER); 2764 dummy_vector->Set(store_ic_slot, megamorphic, SKIP_WRITE_BARRIER);
2765 dummy_vector->Set(keyed_store_ic_slot, megamorphic, SKIP_WRITE_BARRIER); 2765 dummy_vector->Set(keyed_store_ic_slot, megamorphic, SKIP_WRITE_BARRIER);
2766 2766
2767 set_dummy_vector(*dummy_vector); 2767 set_dummy_vector(*dummy_vector);
2768 } 2768 }
2769 2769
2770 { 2770 {
2771 Handle<WeakCell> cell = factory->NewWeakCell(factory->undefined_value());
2772 cell->clear();
2773 set_empty_weak_cell(*cell);
2774
2771 Handle<FixedArray> cleared_optimized_code_map = 2775 Handle<FixedArray> cleared_optimized_code_map =
2772 factory->NewFixedArray(SharedFunctionInfo::kEntriesStart, TENURED); 2776 factory->NewFixedArray(SharedFunctionInfo::kEntriesStart, TENURED);
2777 cleared_optimized_code_map->set(SharedFunctionInfo::kSharedCodeIndex,
2778 *cell);
2773 STATIC_ASSERT(SharedFunctionInfo::kEntriesStart == 1 && 2779 STATIC_ASSERT(SharedFunctionInfo::kEntriesStart == 1 &&
2774 SharedFunctionInfo::kSharedCodeIndex == 0); 2780 SharedFunctionInfo::kSharedCodeIndex == 0);
2775 set_cleared_optimized_code_map(*cleared_optimized_code_map); 2781 set_cleared_optimized_code_map(*cleared_optimized_code_map);
2776 } 2782 }
2777 2783
2778 set_detached_contexts(empty_fixed_array()); 2784 set_detached_contexts(empty_fixed_array());
2779 set_retained_maps(ArrayList::cast(empty_fixed_array())); 2785 set_retained_maps(ArrayList::cast(empty_fixed_array()));
2780 2786
2781 set_weak_object_to_code_table( 2787 set_weak_object_to_code_table(
2782 *WeakHashTable::New(isolate(), 16, USE_DEFAULT_MINIMUM_CAPACITY, 2788 *WeakHashTable::New(isolate(), 16, USE_DEFAULT_MINIMUM_CAPACITY,
(...skipping 3387 matching lines...) Expand 10 before | Expand all | Expand 10 after
6170 } 6176 }
6171 6177
6172 6178
6173 // static 6179 // static
6174 int Heap::GetStaticVisitorIdForMap(Map* map) { 6180 int Heap::GetStaticVisitorIdForMap(Map* map) {
6175 return StaticVisitorBase::GetVisitorId(map); 6181 return StaticVisitorBase::GetVisitorId(map);
6176 } 6182 }
6177 6183
6178 } // namespace internal 6184 } // namespace internal
6179 } // namespace v8 6185 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698