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

Unified Diff: src/heap/heap.cc

Issue 1034163002: Use atomic operation to read the length of a fixed array. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index f2ca0800adb96ccfd52820066a77ee4dac699902..78a77e233e54ec5cf0928ee7a6635e51420d7432 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -3497,7 +3497,7 @@ bool Heap::CanMoveObjectStart(HeapObject* object) {
void Heap::AdjustLiveBytes(Address address, int by, InvocationMode mode) {
if (incremental_marking()->IsMarking() &&
Marking::IsBlack(Marking::MarkBitFrom(address))) {
- if (mode == FROM_GC) {
+ if (mode == SWEEPING_IS_OFF) {
MemoryChunk::IncrementLiveBytesFromGC(address, by);
} else {
MemoryChunk::IncrementLiveBytesFromMutator(address, by);
@@ -3546,7 +3546,7 @@ FixedArrayBase* Heap::LeftTrimFixedArray(FixedArrayBase* object,
// Maintain consistency of live bytes during incremental marking
marking()->TransferMark(object->address(), new_start);
- AdjustLiveBytes(new_start, -bytes_to_trim, Heap::FROM_MUTATOR);
+ AdjustLiveBytes(new_start, -bytes_to_trim, Heap::SWEEPING_STARTED);
// Notify the heap profiler of change in object layout.
OnMoveEvent(new_object, object, new_object->Size());
@@ -3555,10 +3555,10 @@ FixedArrayBase* Heap::LeftTrimFixedArray(FixedArrayBase* object,
// Force instantiation of templatized method.
-template
-void Heap::RightTrimFixedArray<Heap::FROM_GC>(FixedArrayBase*, int);
-template
-void Heap::RightTrimFixedArray<Heap::FROM_MUTATOR>(FixedArrayBase*, int);
+template void Heap::RightTrimFixedArray<Heap::SWEEPING_IS_OFF>(FixedArrayBase*,
+ int);
+template void Heap::RightTrimFixedArray<Heap::SWEEPING_STARTED>(FixedArrayBase*,
+ int);
template<Heap::InvocationMode mode>
« src/heap/heap.h ('K') | « 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