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

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

Issue 893073006: Add map-based read barrier to WeakCell Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix merge Created 5 years, 10 months 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
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/v8.h" 5 #include "src/v8.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 2684 matching lines...) Expand 10 before | Expand all | Expand 10 after
2695 2695
2696 TYPED_ARRAYS(ALLOCATE_FIXED_TYPED_ARRAY_MAP) 2696 TYPED_ARRAYS(ALLOCATE_FIXED_TYPED_ARRAY_MAP)
2697 #undef ALLOCATE_FIXED_TYPED_ARRAY_MAP 2697 #undef ALLOCATE_FIXED_TYPED_ARRAY_MAP
2698 2698
2699 ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, sloppy_arguments_elements) 2699 ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, sloppy_arguments_elements)
2700 2700
2701 ALLOCATE_VARSIZE_MAP(CODE_TYPE, code) 2701 ALLOCATE_VARSIZE_MAP(CODE_TYPE, code)
2702 2702
2703 ALLOCATE_MAP(CELL_TYPE, Cell::kSize, cell) 2703 ALLOCATE_MAP(CELL_TYPE, Cell::kSize, cell)
2704 ALLOCATE_MAP(PROPERTY_CELL_TYPE, PropertyCell::kSize, global_property_cell) 2704 ALLOCATE_MAP(PROPERTY_CELL_TYPE, PropertyCell::kSize, global_property_cell)
2705 ALLOCATE_MAP(WEAK_CELL_TYPE, WeakCell::kSize, weak_cell) 2705 ALLOCATE_MAP(WEAK_CELL_TYPE, WeakCell::kSize, used_weak_cell)
2706 ALLOCATE_MAP(WEAK_CELL_TYPE, WeakCell::kSize, unused_weak_cell)
2706 ALLOCATE_MAP(FILLER_TYPE, kPointerSize, one_pointer_filler) 2707 ALLOCATE_MAP(FILLER_TYPE, kPointerSize, one_pointer_filler)
2707 ALLOCATE_MAP(FILLER_TYPE, 2 * kPointerSize, two_pointer_filler) 2708 ALLOCATE_MAP(FILLER_TYPE, 2 * kPointerSize, two_pointer_filler)
2708 2709
2709 2710
2710 for (unsigned i = 0; i < arraysize(struct_table); i++) { 2711 for (unsigned i = 0; i < arraysize(struct_table); i++) {
2711 const StructTable& entry = struct_table[i]; 2712 const StructTable& entry = struct_table[i];
2712 Map* map; 2713 Map* map;
2713 if (!AllocateMap(entry.type, entry.size).To(&map)) return false; 2714 if (!AllocateMap(entry.type, entry.size).To(&map)) return false;
2714 roots_[entry.index] = map; 2715 roots_[entry.index] = map;
2715 } 2716 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
2832 2833
2833 AllocationResult Heap::AllocateWeakCell(HeapObject* value) { 2834 AllocationResult Heap::AllocateWeakCell(HeapObject* value) {
2834 int size = WeakCell::kSize; 2835 int size = WeakCell::kSize;
2835 STATIC_ASSERT(WeakCell::kSize <= Page::kMaxRegularHeapObjectSize); 2836 STATIC_ASSERT(WeakCell::kSize <= Page::kMaxRegularHeapObjectSize);
2836 HeapObject* result; 2837 HeapObject* result;
2837 { 2838 {
2838 AllocationResult allocation = 2839 AllocationResult allocation =
2839 AllocateRaw(size, OLD_POINTER_SPACE, OLD_POINTER_SPACE); 2840 AllocateRaw(size, OLD_POINTER_SPACE, OLD_POINTER_SPACE);
2840 if (!allocation.To(&result)) return allocation; 2841 if (!allocation.To(&result)) return allocation;
2841 } 2842 }
2842 result->set_map_no_write_barrier(weak_cell_map()); 2843 result->set_map_no_write_barrier(used_weak_cell_map());
2843 WeakCell::cast(result)->initialize(value); 2844 WeakCell::cast(result)->initialize(value);
2844 WeakCell::cast(result)->set_next(undefined_value(), SKIP_WRITE_BARRIER); 2845 WeakCell::cast(result)->set_next(undefined_value(), SKIP_WRITE_BARRIER);
2845 return result; 2846 return result;
2846 } 2847 }
2847 2848
2848 2849
2849 void Heap::CreateApiObjects() { 2850 void Heap::CreateApiObjects() {
2850 HandleScope scope(isolate()); 2851 HandleScope scope(isolate());
2851 Factory* factory = isolate()->factory(); 2852 Factory* factory = isolate()->factory();
2852 Handle<Map> new_neander_map = 2853 Handle<Map> new_neander_map =
(...skipping 3635 matching lines...) Expand 10 before | Expand all | Expand 10 after
6488 static_cast<int>(object_sizes_last_time_[index])); 6489 static_cast<int>(object_sizes_last_time_[index]));
6489 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6490 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6490 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6491 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6491 6492
6492 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6493 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6493 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6494 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6494 ClearObjectStats(); 6495 ClearObjectStats();
6495 } 6496 }
6496 } 6497 }
6497 } // namespace v8::internal 6498 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698