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

Side by Side Diff: src/objects-inl.h

Issue 1493393002: Revert "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: 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
« no previous file with comments | « src/objects.cc ('k') | no next file » | 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 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 2012 matching lines...) Expand 10 before | Expand all | Expand 10 after
2023 2023
2024 void PropertyCell::set_property_details(PropertyDetails details) { 2024 void PropertyCell::set_property_details(PropertyDetails details) {
2025 set_property_details_raw(details.AsSmi()); 2025 set_property_details_raw(details.AsSmi());
2026 } 2026 }
2027 2027
2028 2028
2029 Object* WeakCell::value() const { return READ_FIELD(this, kValueOffset); } 2029 Object* WeakCell::value() const { return READ_FIELD(this, kValueOffset); }
2030 2030
2031 2031
2032 void WeakCell::clear() { 2032 void WeakCell::clear() {
2033 // Either the garbage collector is clearing the cell or we are simply 2033 DCHECK(GetHeap()->gc_state() == Heap::MARK_COMPACT);
2034 // initializing the root empty weak cell.
2035 DCHECK(GetHeap()->gc_state() == Heap::MARK_COMPACT ||
2036 this == GetHeap()->empty_weak_cell());
2037 WRITE_FIELD(this, kValueOffset, Smi::FromInt(0)); 2034 WRITE_FIELD(this, kValueOffset, Smi::FromInt(0));
2038 } 2035 }
2039 2036
2040 2037
2041 void WeakCell::initialize(HeapObject* val) { 2038 void WeakCell::initialize(HeapObject* val) {
2042 WRITE_FIELD(this, kValueOffset, val); 2039 WRITE_FIELD(this, kValueOffset, val);
2043 Heap* heap = GetHeap(); 2040 Heap* heap = GetHeap();
2044 // We just have to execute the generational barrier here because we never 2041 // We just have to execute the generational barrier here because we never
2045 // mark through a weak cell and collect evacuation candidates when we process 2042 // mark through a weak cell and collect evacuation candidates when we process
2046 // all weak cells. 2043 // all weak cells.
(...skipping 5827 matching lines...) Expand 10 before | Expand all | Expand 10 after
7874 #undef WRITE_INT64_FIELD 7871 #undef WRITE_INT64_FIELD
7875 #undef READ_BYTE_FIELD 7872 #undef READ_BYTE_FIELD
7876 #undef WRITE_BYTE_FIELD 7873 #undef WRITE_BYTE_FIELD
7877 #undef NOBARRIER_READ_BYTE_FIELD 7874 #undef NOBARRIER_READ_BYTE_FIELD
7878 #undef NOBARRIER_WRITE_BYTE_FIELD 7875 #undef NOBARRIER_WRITE_BYTE_FIELD
7879 7876
7880 } // namespace internal 7877 } // namespace internal
7881 } // namespace v8 7878 } // namespace v8
7882 7879
7883 #endif // V8_OBJECTS_INL_H_ 7880 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698