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

Side by Side Diff: src/heap.cc

Issue 11271006: Fix code flusher to process weak function links. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Do true scavenge instead of weak object retention. Created 8 years, 1 month 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.h » ('j') | src/mark-compact.cc » ('J')
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 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 for (HeapObject* heap_object = cell_iterator.Next(); 1320 for (HeapObject* heap_object = cell_iterator.Next();
1321 heap_object != NULL; 1321 heap_object != NULL;
1322 heap_object = cell_iterator.Next()) { 1322 heap_object = cell_iterator.Next()) {
1323 if (heap_object->IsJSGlobalPropertyCell()) { 1323 if (heap_object->IsJSGlobalPropertyCell()) {
1324 JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(heap_object); 1324 JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(heap_object);
1325 Address value_address = cell->ValueAddress(); 1325 Address value_address = cell->ValueAddress();
1326 scavenge_visitor.VisitPointer(reinterpret_cast<Object**>(value_address)); 1326 scavenge_visitor.VisitPointer(reinterpret_cast<Object**>(value_address));
1327 } 1327 }
1328 } 1328 }
1329 1329
1330 // Copy objects reachable from the code flushing candidates list.
1331 MarkCompactCollector* collector = mark_compact_collector();
1332 if (collector->is_code_flushing_enabled()) {
1333 collector->code_flusher()->IteratePointersToFromSpace(&scavenge_visitor);
1334 }
1335
1330 // Scavenge object reachable from the native contexts list directly. 1336 // Scavenge object reachable from the native contexts list directly.
1331 scavenge_visitor.VisitPointer(BitCast<Object**>(&native_contexts_list_)); 1337 scavenge_visitor.VisitPointer(BitCast<Object**>(&native_contexts_list_));
1332 1338
1333 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); 1339 new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
1334 isolate_->global_handles()->IdentifyNewSpaceWeakIndependentHandles( 1340 isolate_->global_handles()->IdentifyNewSpaceWeakIndependentHandles(
1335 &IsUnscavengedHeapObject); 1341 &IsUnscavengedHeapObject);
1336 isolate_->global_handles()->IterateNewSpaceWeakIndependentRoots( 1342 isolate_->global_handles()->IterateNewSpaceWeakIndependentRoots(
1337 &scavenge_visitor); 1343 &scavenge_visitor);
1338 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); 1344 new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
1339 1345
(...skipping 4195 matching lines...) Expand 10 before | Expand all | Expand 10 after
5535 5541
5536 5542
5537 bool Heap::LookupSymbolIfExists(String* string, String** symbol) { 5543 bool Heap::LookupSymbolIfExists(String* string, String** symbol) {
5538 if (string->IsSymbol()) { 5544 if (string->IsSymbol()) {
5539 *symbol = string; 5545 *symbol = string;
5540 return true; 5546 return true;
5541 } 5547 }
5542 return symbol_table()->LookupSymbolIfExists(string, symbol); 5548 return symbol_table()->LookupSymbolIfExists(string, symbol);
5543 } 5549 }
5544 5550
5551
5545 void Heap::ZapFromSpace() { 5552 void Heap::ZapFromSpace() {
5546 NewSpacePageIterator it(new_space_.FromSpaceStart(), 5553 NewSpacePageIterator it(new_space_.FromSpaceStart(),
5547 new_space_.FromSpaceEnd()); 5554 new_space_.FromSpaceEnd());
5548 while (it.has_next()) { 5555 while (it.has_next()) {
5549 NewSpacePage* page = it.next(); 5556 NewSpacePage* page = it.next();
5550 for (Address cursor = page->area_start(), limit = page->area_end(); 5557 for (Address cursor = page->area_start(), limit = page->area_end();
5551 cursor < limit; 5558 cursor < limit;
5552 cursor += kPointerSize) { 5559 cursor += kPointerSize) {
5553 Memory::Address_at(cursor) = kFromSpaceZapValue; 5560 Memory::Address_at(cursor) = kFromSpaceZapValue;
5554 } 5561 }
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after
7360 static_cast<int>(object_sizes_last_time_[index])); 7367 static_cast<int>(object_sizes_last_time_[index]));
7361 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 7368 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
7362 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7369 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7363 7370
7364 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7371 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7365 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7372 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7366 ClearObjectStats(); 7373 ClearObjectStats();
7367 } 7374 }
7368 7375
7369 } } // namespace v8::internal 7376 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/mark-compact.h » ('j') | src/mark-compact.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698