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

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

Issue 10826079: Refactor marking to share embedded pointer visitor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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 | « 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 static void Initialize() { 168 static void Initialize() {
169 StaticMarkingVisitor<IncrementalMarkingMarkingVisitor>::Initialize(); 169 StaticMarkingVisitor<IncrementalMarkingMarkingVisitor>::Initialize();
170 170
171 table_.Register(kVisitSharedFunctionInfo, &VisitSharedFunctionInfo); 171 table_.Register(kVisitSharedFunctionInfo, &VisitSharedFunctionInfo);
172 172
173 table_.Register(kVisitJSFunction, &VisitJSFunction); 173 table_.Register(kVisitJSFunction, &VisitJSFunction);
174 174
175 table_.Register(kVisitJSRegExp, &VisitJSRegExp); 175 table_.Register(kVisitJSRegExp, &VisitJSRegExp);
176 } 176 }
177 177
178 static inline void VisitEmbeddedPointer(Heap* heap, RelocInfo* rinfo) {
179 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT);
180 Object* target = rinfo->target_object();
181 if (target->NonFailureIsHeapObject()) {
182 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target);
183 MarkObject(heap, target);
184 }
185 }
186
187 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { 178 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) {
188 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); 179 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode()));
189 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); 180 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address());
190 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() 181 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub()
191 && (target->ic_age() != heap->global_ic_age())) { 182 && (target->ic_age() != heap->global_ic_age())) {
192 IC::Clear(rinfo->pc()); 183 IC::Clear(rinfo->pc());
193 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); 184 target = Code::GetCodeFromTargetAddress(rinfo->target_address());
194 } 185 }
195 heap->mark_compact_collector()->RecordRelocSlot(rinfo, Code::cast(target)); 186 heap->mark_compact_collector()->RecordRelocSlot(rinfo, Code::cast(target));
196 MarkObject(heap, target); 187 MarkObject(heap, target);
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 allocation_marking_factor_ = kInitialAllocationMarkingFactor; 962 allocation_marking_factor_ = kInitialAllocationMarkingFactor;
972 bytes_scanned_ = 0; 963 bytes_scanned_ = 0;
973 } 964 }
974 965
975 966
976 int64_t IncrementalMarking::SpaceLeftInOldSpace() { 967 int64_t IncrementalMarking::SpaceLeftInOldSpace() {
977 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); 968 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects();
978 } 969 }
979 970
980 } } // namespace v8::internal 971 } } // 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