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

Side by Side Diff: src/spaces.cc

Issue 7044082: Minor cleanup of StoreBuffer related heap iteration methods. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 6 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 2129 matching lines...) Expand 10 before | Expand all | Expand 10 after
2140 chunk = chunk->next_page()) { 2140 chunk = chunk->next_page()) {
2141 Address chunk_address = chunk->address(); 2141 Address chunk_address = chunk->address();
2142 if (chunk_address <= pc && pc < chunk_address + chunk->size()) { 2142 if (chunk_address <= pc && pc < chunk_address + chunk->size()) {
2143 return chunk; 2143 return chunk;
2144 } 2144 }
2145 } 2145 }
2146 return NULL; 2146 return NULL;
2147 } 2147 }
2148 2148
2149 2149
2150 void LargeObjectSpace::IteratePointersToNewSpace(
2151 ObjectSlotCallback copy_object) {
2152 LargeObjectIterator it(this);
2153 for (HeapObject* object = it.Next(); object != NULL; object = it.Next()) {
2154 // We only have code, sequential strings, or fixed arrays in large
2155 // object space, and only fixed arrays can possibly contain pointers to
2156 // the young generation.
2157 if (object->IsFixedArray()) {
2158 // TODO(gc): we can no longer assume that LargePage is bigger than normal
2159 // page.
2160
2161 Address start = object->address();
2162 Address object_end = start + object->Size();
2163 heap()->IteratePointersToNewSpace(heap(), start, object_end, copy_object);
2164 }
2165 }
2166 }
2167
2168
2169 void LargeObjectSpace::FreeUnmarkedObjects() { 2150 void LargeObjectSpace::FreeUnmarkedObjects() {
2170 LargePage* previous = NULL; 2151 LargePage* previous = NULL;
2171 LargePage* current = first_page_; 2152 LargePage* current = first_page_;
2172 while (current != NULL) { 2153 while (current != NULL) {
2173 HeapObject* object = current->GetObject(); 2154 HeapObject* object = current->GetObject();
2174 MarkBit mark_bit = Marking::MarkBitFrom(object); 2155 MarkBit mark_bit = Marking::MarkBitFrom(object);
2175 if (mark_bit.Get()) { 2156 if (mark_bit.Get()) {
2176 mark_bit.Clear(); 2157 mark_bit.Clear();
2177 heap()->mark_compact_collector()->tracer()->decrement_marked_count(); 2158 heap()->mark_compact_collector()->tracer()->decrement_marked_count();
2178 previous = current; 2159 previous = current;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
2293 for (HeapObject* obj = obj_it.Next(); obj != NULL; obj = obj_it.Next()) { 2274 for (HeapObject* obj = obj_it.Next(); obj != NULL; obj = obj_it.Next()) {
2294 if (obj->IsCode()) { 2275 if (obj->IsCode()) {
2295 Code* code = Code::cast(obj); 2276 Code* code = Code::cast(obj);
2296 isolate->code_kind_statistics()[code->kind()] += code->Size(); 2277 isolate->code_kind_statistics()[code->kind()] += code->Size();
2297 } 2278 }
2298 } 2279 }
2299 } 2280 }
2300 #endif // DEBUG 2281 #endif // DEBUG
2301 2282
2302 } } // namespace v8::internal 2283 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/spaces.h ('k') | src/store-buffer.h » ('j') | src/store-buffer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698