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

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

Issue 1632913003: [heap] Move to page lookups for SemiSpace, NewSpace, and Heap containment methods (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mips ports Created 4 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/mips64/simulator-mips64.cc ('k') | src/snapshot/serialize.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 // 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 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 #define RELEASE_WRITE_FIELD(p, offset, value) \ 1231 #define RELEASE_WRITE_FIELD(p, offset, value) \
1232 base::Release_Store( \ 1232 base::Release_Store( \
1233 reinterpret_cast<base::AtomicWord*>(FIELD_ADDR(p, offset)), \ 1233 reinterpret_cast<base::AtomicWord*>(FIELD_ADDR(p, offset)), \
1234 reinterpret_cast<base::AtomicWord>(value)); 1234 reinterpret_cast<base::AtomicWord>(value));
1235 1235
1236 #define NOBARRIER_WRITE_FIELD(p, offset, value) \ 1236 #define NOBARRIER_WRITE_FIELD(p, offset, value) \
1237 base::NoBarrier_Store( \ 1237 base::NoBarrier_Store( \
1238 reinterpret_cast<base::AtomicWord*>(FIELD_ADDR(p, offset)), \ 1238 reinterpret_cast<base::AtomicWord*>(FIELD_ADDR(p, offset)), \
1239 reinterpret_cast<base::AtomicWord>(value)); 1239 reinterpret_cast<base::AtomicWord>(value));
1240 1240
1241 #define WRITE_BARRIER(heap, object, offset, value) \ 1241 #define WRITE_BARRIER(heap, object, offset, value) \
1242 heap->incremental_marking()->RecordWrite( \ 1242 heap->incremental_marking()->RecordWrite( \
1243 object, HeapObject::RawField(object, offset), value); \ 1243 object, HeapObject::RawField(object, offset), value); \
1244 if (heap->InNewSpace(value)) { \ 1244 heap->RecordWrite(object, offset, value);
1245 heap->RecordWrite(object->address(), offset); \
1246 }
1247 1245
1248 #define CONDITIONAL_WRITE_BARRIER(heap, object, offset, value, mode) \ 1246 #define CONDITIONAL_WRITE_BARRIER(heap, object, offset, value, mode) \
1249 if (mode != SKIP_WRITE_BARRIER) { \ 1247 if (mode != SKIP_WRITE_BARRIER) { \
1250 if (mode == UPDATE_WRITE_BARRIER) { \ 1248 if (mode == UPDATE_WRITE_BARRIER) { \
1251 heap->incremental_marking()->RecordWrite( \ 1249 heap->incremental_marking()->RecordWrite( \
1252 object, HeapObject::RawField(object, offset), value); \ 1250 object, HeapObject::RawField(object, offset), value); \
1253 } \ 1251 } \
1254 if (heap->InNewSpace(value)) { \ 1252 heap->RecordWrite(object, offset, value); \
1255 heap->RecordWrite(object->address(), offset); \
1256 } \
1257 } 1253 }
1258 1254
1259 #define READ_DOUBLE_FIELD(p, offset) \ 1255 #define READ_DOUBLE_FIELD(p, offset) \
1260 ReadDoubleValue(FIELD_ADDR_CONST(p, offset)) 1256 ReadDoubleValue(FIELD_ADDR_CONST(p, offset))
1261 1257
1262 #define WRITE_DOUBLE_FIELD(p, offset, value) \ 1258 #define WRITE_DOUBLE_FIELD(p, offset, value) \
1263 WriteDoubleValue(FIELD_ADDR(p, offset), value) 1259 WriteDoubleValue(FIELD_ADDR(p, offset), value)
1264 1260
1265 #define READ_INT_FIELD(p, offset) \ 1261 #define READ_INT_FIELD(p, offset) \
1266 (*reinterpret_cast<const int*>(FIELD_ADDR_CONST(p, offset))) 1262 (*reinterpret_cast<const int*>(FIELD_ADDR_CONST(p, offset)))
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 WRITE_FIELD(this, kValueOffset, Smi::FromInt(0)); 2030 WRITE_FIELD(this, kValueOffset, Smi::FromInt(0));
2035 } 2031 }
2036 2032
2037 2033
2038 void WeakCell::initialize(HeapObject* val) { 2034 void WeakCell::initialize(HeapObject* val) {
2039 WRITE_FIELD(this, kValueOffset, val); 2035 WRITE_FIELD(this, kValueOffset, val);
2040 Heap* heap = GetHeap(); 2036 Heap* heap = GetHeap();
2041 // We just have to execute the generational barrier here because we never 2037 // We just have to execute the generational barrier here because we never
2042 // mark through a weak cell and collect evacuation candidates when we process 2038 // mark through a weak cell and collect evacuation candidates when we process
2043 // all weak cells. 2039 // all weak cells.
2044 if (heap->InNewSpace(val)) { 2040 heap->RecordWrite(this, kValueOffset, val);
2045 heap->RecordWrite(address(), kValueOffset);
2046 }
2047 } 2041 }
2048 2042
2049 2043
2050 bool WeakCell::cleared() const { return value() == Smi::FromInt(0); } 2044 bool WeakCell::cleared() const { return value() == Smi::FromInt(0); }
2051 2045
2052 2046
2053 Object* WeakCell::next() const { return READ_FIELD(this, kNextOffset); } 2047 Object* WeakCell::next() const { return READ_FIELD(this, kNextOffset); }
2054 2048
2055 2049
2056 void WeakCell::set_next(Object* val, WriteBarrierMode mode) { 2050 void WeakCell::set_next(Object* val, WriteBarrierMode mode) {
(...skipping 5776 matching lines...) Expand 10 before | Expand all | Expand 10 after
7833 #undef WRITE_INT64_FIELD 7827 #undef WRITE_INT64_FIELD
7834 #undef READ_BYTE_FIELD 7828 #undef READ_BYTE_FIELD
7835 #undef WRITE_BYTE_FIELD 7829 #undef WRITE_BYTE_FIELD
7836 #undef NOBARRIER_READ_BYTE_FIELD 7830 #undef NOBARRIER_READ_BYTE_FIELD
7837 #undef NOBARRIER_WRITE_BYTE_FIELD 7831 #undef NOBARRIER_WRITE_BYTE_FIELD
7838 7832
7839 } // namespace internal 7833 } // namespace internal
7840 } // namespace v8 7834 } // namespace v8
7841 7835
7842 #endif // V8_OBJECTS_INL_H_ 7836 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/mips64/simulator-mips64.cc ('k') | src/snapshot/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698