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

Side by Side Diff: src/incremental-marking.cc

Issue 8537014: Simplify the write barrier. Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/mark-compact.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 MarkObject(obj); 216 MarkObject(obj);
217 } 217 }
218 } 218 }
219 } 219 }
220 220
221 private: 221 private:
222 // Mark object pointed to by p. 222 // Mark object pointed to by p.
223 INLINE(void MarkObject(Object* obj)) { 223 INLINE(void MarkObject(Object* obj)) {
224 HeapObject* heap_object = HeapObject::cast(obj); 224 HeapObject* heap_object = HeapObject::cast(obj);
225 MarkBit mark_bit = Marking::MarkBitFrom(heap_object); 225 MarkBit mark_bit = Marking::MarkBitFrom(heap_object);
226 if (mark_bit.data_only()) { 226 if (Marking::IsWhite(mark_bit)) {
227 if (incremental_marking_->MarkBlackOrKeepGrey(mark_bit)) {
228 MemoryChunk::IncrementLiveBytes(heap_object->address(),
229 heap_object->Size());
230 }
231 } else if (Marking::IsWhite(mark_bit)) {
232 incremental_marking_->WhiteToGreyAndPush(heap_object, mark_bit); 227 incremental_marking_->WhiteToGreyAndPush(heap_object, mark_bit);
233 } 228 }
234 } 229 }
235 230
236 Heap* heap_; 231 Heap* heap_;
237 IncrementalMarking* incremental_marking_; 232 IncrementalMarking* incremental_marking_;
238 }; 233 };
239 234
240 235
241 class IncrementalMarkingRootMarkingVisitor : public ObjectVisitor { 236 class IncrementalMarkingRootMarkingVisitor : public ObjectVisitor {
(...skipping 12 matching lines...) Expand all
254 for (Object** p = start; p < end; p++) MarkObjectByPointer(p); 249 for (Object** p = start; p < end; p++) MarkObjectByPointer(p);
255 } 250 }
256 251
257 private: 252 private:
258 void MarkObjectByPointer(Object** p) { 253 void MarkObjectByPointer(Object** p) {
259 Object* obj = *p; 254 Object* obj = *p;
260 if (!obj->IsHeapObject()) return; 255 if (!obj->IsHeapObject()) return;
261 256
262 HeapObject* heap_object = HeapObject::cast(obj); 257 HeapObject* heap_object = HeapObject::cast(obj);
263 MarkBit mark_bit = Marking::MarkBitFrom(heap_object); 258 MarkBit mark_bit = Marking::MarkBitFrom(heap_object);
264 if (mark_bit.data_only()) { 259 if (Marking::IsWhite(mark_bit)) {
265 if (incremental_marking_->MarkBlackOrKeepGrey(mark_bit)) { 260 incremental_marking_->WhiteToGreyAndPush(heap_object, mark_bit);
266 MemoryChunk::IncrementLiveBytes(heap_object->address(),
267 heap_object->Size());
268 }
269 } else {
270 if (Marking::IsWhite(mark_bit)) {
271 incremental_marking_->WhiteToGreyAndPush(heap_object, mark_bit);
272 }
273 } 261 }
274 } 262 }
275 263
276 Heap* heap_; 264 Heap* heap_;
277 IncrementalMarking* incremental_marking_; 265 IncrementalMarking* incremental_marking_;
278 }; 266 };
279 267
280 268
281 void IncrementalMarking::SetOldSpacePageFlags(MemoryChunk* chunk, 269 void IncrementalMarking::SetOldSpacePageFlags(MemoryChunk* chunk,
282 bool is_marking, 270 bool is_marking,
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 allocation_marking_factor_ = kInitialAllocationMarkingFactor; 899 allocation_marking_factor_ = kInitialAllocationMarkingFactor;
912 bytes_scanned_ = 0; 900 bytes_scanned_ = 0;
913 } 901 }
914 902
915 903
916 int64_t IncrementalMarking::SpaceLeftInOldSpace() { 904 int64_t IncrementalMarking::SpaceLeftInOldSpace() {
917 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize(); 905 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize();
918 } 906 }
919 907
920 } } // namespace v8::internal 908 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698