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

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

Issue 1124583003: Don't perform marking barrier for weak cell values. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | 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 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after
1910 1910
1911 1911
1912 void WeakCell::clear() { 1912 void WeakCell::clear() {
1913 DCHECK(GetHeap()->gc_state() == Heap::MARK_COMPACT); 1913 DCHECK(GetHeap()->gc_state() == Heap::MARK_COMPACT);
1914 WRITE_FIELD(this, kValueOffset, Smi::FromInt(0)); 1914 WRITE_FIELD(this, kValueOffset, Smi::FromInt(0));
1915 } 1915 }
1916 1916
1917 1917
1918 void WeakCell::initialize(HeapObject* val) { 1918 void WeakCell::initialize(HeapObject* val) {
1919 WRITE_FIELD(this, kValueOffset, val); 1919 WRITE_FIELD(this, kValueOffset, val);
1920 WRITE_BARRIER(GetHeap(), this, kValueOffset, val); 1920 Heap* heap = GetHeap();
1921 // We just have to execute the generational barrier here because we never
1922 // mark through a weak cell and collect evacuation candidates when we process
1923 // all weak cells.
1924 if (heap->InNewSpace(val)) {
1925 heap->RecordWrite(address(), kValueOffset);
1926 }
1921 } 1927 }
1922 1928
1923 1929
1924 bool WeakCell::cleared() const { return value() == Smi::FromInt(0); } 1930 bool WeakCell::cleared() const { return value() == Smi::FromInt(0); }
1925 1931
1926 1932
1927 Object* WeakCell::next() const { return READ_FIELD(this, kNextOffset); } 1933 Object* WeakCell::next() const { return READ_FIELD(this, kNextOffset); }
1928 1934
1929 1935
1930 void WeakCell::set_next(Object* val, WriteBarrierMode mode) { 1936 void WeakCell::set_next(Object* val, WriteBarrierMode mode) {
(...skipping 5678 matching lines...) Expand 10 before | Expand all | Expand 10 after
7609 #undef READ_SHORT_FIELD 7615 #undef READ_SHORT_FIELD
7610 #undef WRITE_SHORT_FIELD 7616 #undef WRITE_SHORT_FIELD
7611 #undef READ_BYTE_FIELD 7617 #undef READ_BYTE_FIELD
7612 #undef WRITE_BYTE_FIELD 7618 #undef WRITE_BYTE_FIELD
7613 #undef NOBARRIER_READ_BYTE_FIELD 7619 #undef NOBARRIER_READ_BYTE_FIELD
7614 #undef NOBARRIER_WRITE_BYTE_FIELD 7620 #undef NOBARRIER_WRITE_BYTE_FIELD
7615 7621
7616 } } // namespace v8::internal 7622 } } // namespace v8::internal
7617 7623
7618 #endif // V8_OBJECTS_INL_H_ 7624 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698