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

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

Issue 8879057: Merge r10243 to 3.7 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.7
Patch Set: Created 9 years 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 | « src/heap.cc ('k') | src/version.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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 670
671 if (FLAG_cleanup_code_caches_at_gc) { 671 if (FLAG_cleanup_code_caches_at_gc) {
672 PolymorphicCodeCache* poly_cache = heap_->polymorphic_code_cache(); 672 PolymorphicCodeCache* poly_cache = heap_->polymorphic_code_cache();
673 Marking::GreyToBlack(Marking::MarkBitFrom(poly_cache)); 673 Marking::GreyToBlack(Marking::MarkBitFrom(poly_cache));
674 MemoryChunk::IncrementLiveBytes(poly_cache->address(), 674 MemoryChunk::IncrementLiveBytes(poly_cache->address(),
675 PolymorphicCodeCache::kSize); 675 PolymorphicCodeCache::kSize);
676 } 676 }
677 677
678 Object* context = heap_->global_contexts_list(); 678 Object* context = heap_->global_contexts_list();
679 while (!context->IsUndefined()) { 679 while (!context->IsUndefined()) {
680 NormalizedMapCache* cache = Context::cast(context)->normalized_map_cache(); 680 // GC can happen when the context is not fully initialized,
681 MarkBit mark_bit = Marking::MarkBitFrom(cache); 681 // so the cache can be undefined.
682 if (Marking::IsGrey(mark_bit)) { 682 HeapObject* cache = HeapObject::cast(
683 Marking::GreyToBlack(mark_bit); 683 Context::cast(context)->get(Context::NORMALIZED_MAP_CACHE_INDEX));
684 MemoryChunk::IncrementLiveBytes(cache->address(), cache->Size()); 684 if (!cache->IsUndefined()) {
685 MarkBit mark_bit = Marking::MarkBitFrom(cache);
686 if (Marking::IsGrey(mark_bit)) {
687 Marking::GreyToBlack(mark_bit);
688 MemoryChunk::IncrementLiveBytes(cache->address(), cache->Size());
689 }
685 } 690 }
686 context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK); 691 context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK);
687 } 692 }
688 } 693 }
689 694
690 695
691 void IncrementalMarking::Abort() { 696 void IncrementalMarking::Abort() {
692 if (IsStopped()) return; 697 if (IsStopped()) return;
693 if (FLAG_trace_incremental_marking) { 698 if (FLAG_trace_incremental_marking) {
694 PrintF("[IncrementalMarking] Aborting.\n"); 699 PrintF("[IncrementalMarking] Aborting.\n");
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 allocation_marking_factor_ = kInitialAllocationMarkingFactor; 915 allocation_marking_factor_ = kInitialAllocationMarkingFactor;
911 bytes_scanned_ = 0; 916 bytes_scanned_ = 0;
912 } 917 }
913 918
914 919
915 int64_t IncrementalMarking::SpaceLeftInOldSpace() { 920 int64_t IncrementalMarking::SpaceLeftInOldSpace() {
916 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize(); 921 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize();
917 } 922 }
918 923
919 } } // namespace v8::internal 924 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698