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

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

Issue 2872443003: [heap] Make object field write atomic if concurrent marking is enabled. (Closed)
Patch Set: Created 3 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 | « src/heap/concurrent-marking.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 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 (*reinterpret_cast<Object* const*>(FIELD_ADDR_CONST(p, offset))) 1296 (*reinterpret_cast<Object* const*>(FIELD_ADDR_CONST(p, offset)))
1297 1297
1298 #define ACQUIRE_READ_FIELD(p, offset) \ 1298 #define ACQUIRE_READ_FIELD(p, offset) \
1299 reinterpret_cast<Object*>(base::Acquire_Load( \ 1299 reinterpret_cast<Object*>(base::Acquire_Load( \
1300 reinterpret_cast<const base::AtomicWord*>(FIELD_ADDR_CONST(p, offset)))) 1300 reinterpret_cast<const base::AtomicWord*>(FIELD_ADDR_CONST(p, offset))))
1301 1301
1302 #define NOBARRIER_READ_FIELD(p, offset) \ 1302 #define NOBARRIER_READ_FIELD(p, offset) \
1303 reinterpret_cast<Object*>(base::NoBarrier_Load( \ 1303 reinterpret_cast<Object*>(base::NoBarrier_Load( \
1304 reinterpret_cast<const base::AtomicWord*>(FIELD_ADDR_CONST(p, offset)))) 1304 reinterpret_cast<const base::AtomicWord*>(FIELD_ADDR_CONST(p, offset))))
1305 1305
1306 #if V8_CONCURRENT_MARKING
1307 #define WRITE_FIELD(p, offset, value) \
1308 base::NoBarrier_Store( \
1309 reinterpret_cast<base::AtomicWord*>(FIELD_ADDR(p, offset)), \
1310 reinterpret_cast<base::AtomicWord>(value));
1311 #else
1306 #define WRITE_FIELD(p, offset, value) \ 1312 #define WRITE_FIELD(p, offset, value) \
1307 (*reinterpret_cast<Object**>(FIELD_ADDR(p, offset)) = value) 1313 (*reinterpret_cast<Object**>(FIELD_ADDR(p, offset)) = value)
1314 #endif
1308 1315
1309 #define RELEASE_WRITE_FIELD(p, offset, value) \ 1316 #define RELEASE_WRITE_FIELD(p, offset, value) \
1310 base::Release_Store( \ 1317 base::Release_Store( \
1311 reinterpret_cast<base::AtomicWord*>(FIELD_ADDR(p, offset)), \ 1318 reinterpret_cast<base::AtomicWord*>(FIELD_ADDR(p, offset)), \
1312 reinterpret_cast<base::AtomicWord>(value)); 1319 reinterpret_cast<base::AtomicWord>(value));
1313 1320
1314 #define NOBARRIER_WRITE_FIELD(p, offset, value) \ 1321 #define NOBARRIER_WRITE_FIELD(p, offset, value) \
1315 base::NoBarrier_Store( \ 1322 base::NoBarrier_Store( \
1316 reinterpret_cast<base::AtomicWord*>(FIELD_ADDR(p, offset)), \ 1323 reinterpret_cast<base::AtomicWord*>(FIELD_ADDR(p, offset)), \
1317 reinterpret_cast<base::AtomicWord>(value)); 1324 reinterpret_cast<base::AtomicWord>(value));
(...skipping 6936 matching lines...) Expand 10 before | Expand all | Expand 10 after
8254 #undef WRITE_BYTE_FIELD 8261 #undef WRITE_BYTE_FIELD
8255 #undef NOBARRIER_READ_BYTE_FIELD 8262 #undef NOBARRIER_READ_BYTE_FIELD
8256 #undef NOBARRIER_WRITE_BYTE_FIELD 8263 #undef NOBARRIER_WRITE_BYTE_FIELD
8257 8264
8258 } // namespace internal 8265 } // namespace internal
8259 } // namespace v8 8266 } // namespace v8
8260 8267
8261 #include "src/objects/object-macros-undef.h" 8268 #include "src/objects/object-macros-undef.h"
8262 8269
8263 #endif // V8_OBJECTS_INL_H_ 8270 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/heap/concurrent-marking.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698