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

Side by Side Diff: src/spaces.cc

Issue 10974003: Make the speed of incrmental marking depend also on the rate (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 440
441 chunk->heap_ = heap; 441 chunk->heap_ = heap;
442 chunk->size_ = size; 442 chunk->size_ = size;
443 chunk->area_start_ = area_start; 443 chunk->area_start_ = area_start;
444 chunk->area_end_ = area_end; 444 chunk->area_end_ = area_end;
445 chunk->flags_ = 0; 445 chunk->flags_ = 0;
446 chunk->set_owner(owner); 446 chunk->set_owner(owner);
447 chunk->InitializeReservedMemory(); 447 chunk->InitializeReservedMemory();
448 chunk->slots_buffer_ = NULL; 448 chunk->slots_buffer_ = NULL;
449 chunk->skip_list_ = NULL; 449 chunk->skip_list_ = NULL;
450 chunk->write_barrier_counter_ = kWriteBarrierCounterGranularity;
450 chunk->ResetLiveBytes(); 451 chunk->ResetLiveBytes();
451 Bitmap::Clear(chunk); 452 Bitmap::Clear(chunk);
452 chunk->initialize_scan_on_scavenge(false); 453 chunk->initialize_scan_on_scavenge(false);
453 chunk->SetFlag(WAS_SWEPT_PRECISELY); 454 chunk->SetFlag(WAS_SWEPT_PRECISELY);
454 455
455 ASSERT(OFFSET_OF(MemoryChunk, flags_) == kFlagsOffset); 456 ASSERT(OFFSET_OF(MemoryChunk, flags_) == kFlagsOffset);
456 ASSERT(OFFSET_OF(MemoryChunk, live_byte_count_) == kLiveBytesOffset); 457 ASSERT(OFFSET_OF(MemoryChunk, live_byte_count_) == kLiveBytesOffset);
457 458
458 if (executable == EXECUTABLE) { 459 if (executable == EXECUTABLE) {
459 chunk->SetFlag(IS_EXECUTABLE); 460 chunk->SetFlag(IS_EXECUTABLE);
(...skipping 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after
2035 reinterpret_cast<Object**>(new_node->address())[i] = 2036 reinterpret_cast<Object**>(new_node->address())[i] =
2036 Smi::FromInt(kCodeZapValue); 2037 Smi::FromInt(kCodeZapValue);
2037 } 2038 }
2038 #endif 2039 #endif
2039 2040
2040 // The old-space-step might have finished sweeping and restarted marking. 2041 // The old-space-step might have finished sweeping and restarted marking.
2041 // Verify that it did not turn the page of the new node into an evacuation 2042 // Verify that it did not turn the page of the new node into an evacuation
2042 // candidate. 2043 // candidate.
2043 ASSERT(!MarkCompactCollector::IsOnEvacuationCandidate(new_node)); 2044 ASSERT(!MarkCompactCollector::IsOnEvacuationCandidate(new_node));
2044 2045
2045 const int kThreshold = IncrementalMarking::kAllocatedThreshold; 2046 const int kThreshold = IncrementalMarking::kIncrementalMarkingThreshold;
2046 2047
2047 // Memory in the linear allocation area is counted as allocated. We may free 2048 // Memory in the linear allocation area is counted as allocated. We may free
2048 // a little of this again immediately - see below. 2049 // a little of this again immediately - see below.
2049 owner_->Allocate(new_node_size); 2050 owner_->Allocate(new_node_size);
2050 2051
2051 if (bytes_left > kThreshold && 2052 if (bytes_left > kThreshold &&
2052 owner_->heap()->incremental_marking()->IsMarkingIncomplete() && 2053 owner_->heap()->incremental_marking()->IsMarkingIncomplete() &&
2053 FLAG_incremental_marking_steps) { 2054 FLAG_incremental_marking_steps) {
2054 int linear_size = owner_->RoundSizeDownToObjectAlignment(kThreshold); 2055 int linear_size = owner_->RoundSizeDownToObjectAlignment(kThreshold);
2055 // We don't want to give too large linear areas to the allocator while 2056 // We don't want to give too large linear areas to the allocator while
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
2887 object->ShortPrint(); 2888 object->ShortPrint();
2888 PrintF("\n"); 2889 PrintF("\n");
2889 } 2890 }
2890 printf(" --------------------------------------\n"); 2891 printf(" --------------------------------------\n");
2891 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 2892 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
2892 } 2893 }
2893 2894
2894 #endif // DEBUG 2895 #endif // DEBUG
2895 2896
2896 } } // namespace v8::internal 2897 } } // namespace v8::internal
OLDNEW
« src/incremental-marking.cc ('K') | « src/spaces.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698