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

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

Issue 7864025: Fix two bugs in the code compaction: (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 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
« no previous file with comments | « src/heap.cc ('k') | 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 Object** slot, 79 Object** slot,
80 Isolate* isolate) { 80 Isolate* isolate) {
81 IncrementalMarking* marking = isolate->heap()->incremental_marking(); 81 IncrementalMarking* marking = isolate->heap()->incremental_marking();
82 ASSERT(marking->is_compacting_); 82 ASSERT(marking->is_compacting_);
83 marking->RecordWrite(obj, slot, *slot); 83 marking->RecordWrite(obj, slot, *slot);
84 } 84 }
85 85
86 86
87 void IncrementalMarking::RecordCodeTargetPatch(Address pc, HeapObject* value) { 87 void IncrementalMarking::RecordCodeTargetPatch(Address pc, HeapObject* value) {
88 if (IsMarking()) { 88 if (IsMarking()) {
89 ASSERT(!MarkCompactCollector::IsOnEvacuationCandidate(value)); 89 Code* host =
90 90 heap_->isolate()->pc_to_code_cache()->GcSafeFindCodeForPc(pc);
91 MarkBit value_bit = Marking::MarkBitFrom(value); 91 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, NULL, host);
92 if (Marking::IsWhite(value_bit)) { 92 RecordWriteIntoCode(host, &rinfo, value);
93 WhiteToGreyAndPush(value, value_bit);
94 RestartIfNotMarking();
95 }
96
97
98 if (is_compacting_) {
99 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, NULL, NULL);
100 heap_->mark_compact_collector()->RecordRelocSlot(&rinfo,
101 Code::cast(value));
102 }
103 } 93 }
104 } 94 }
105 95
106 96
107 void IncrementalMarking::RecordWriteOfCodeEntry(JSFunction* host, 97 void IncrementalMarking::RecordWriteOfCodeEntry(JSFunction* host,
108 Object** slot, 98 Object** slot,
109 Code* value) { 99 Code* value) {
110 if (BaseRecordWrite(host, slot, value) && is_compacting_) { 100 if (BaseRecordWrite(host, slot, value) && is_compacting_) {
111 ASSERT(slot != NULL); 101 ASSERT(slot != NULL);
112 heap_->mark_compact_collector()-> 102 heap_->mark_compact_collector()->
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 bytes_rescanned_ = 0; 690 bytes_rescanned_ = 0;
701 allocation_marking_factor_ = kInitialAllocationMarkingFactor; 691 allocation_marking_factor_ = kInitialAllocationMarkingFactor;
702 } 692 }
703 693
704 694
705 int64_t IncrementalMarking::SpaceLeftInOldSpace() { 695 int64_t IncrementalMarking::SpaceLeftInOldSpace() {
706 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize(); 696 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize();
707 } 697 }
708 698
709 } } // namespace v8::internal 699 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698