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

Side by Side Diff: src/mark-compact.cc

Issue 62803008: Bugfix: make dependent code field in AllocationSite weak. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed nit. Created 7 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 | « src/heap.cc ('k') | src/objects.h » ('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 2523 matching lines...) Expand 10 before | Expand all | Expand 10 after
2534 // otherwise kept alive by strong references. 2534 // otherwise kept alive by strong references.
2535 HeapObjectIterator cell_iterator(heap_->property_cell_space()); 2535 HeapObjectIterator cell_iterator(heap_->property_cell_space());
2536 for (HeapObject* cell = cell_iterator.Next(); 2536 for (HeapObject* cell = cell_iterator.Next();
2537 cell != NULL; 2537 cell != NULL;
2538 cell = cell_iterator.Next()) { 2538 cell = cell_iterator.Next()) {
2539 if (IsMarked(cell)) { 2539 if (IsMarked(cell)) {
2540 ClearNonLiveDependentCode(PropertyCell::cast(cell)->dependent_code()); 2540 ClearNonLiveDependentCode(PropertyCell::cast(cell)->dependent_code());
2541 } 2541 }
2542 } 2542 }
2543 2543
2544 // Iterate over allocation sites, removing dependent code that is not
2545 // otherwise kept alive by strong references.
2546 Object* undefined = heap()->undefined_value();
2547 for (Object* site = heap()->allocation_sites_list();
2548 site != undefined;
2549 site = AllocationSite::cast(site)->weak_next()) {
2550 if (IsMarked(site)) {
2551 ClearNonLiveDependentCode(AllocationSite::cast(site)->dependent_code());
2552 }
2553 }
2554
2544 if (heap_->weak_object_to_code_table()->IsHashTable()) { 2555 if (heap_->weak_object_to_code_table()->IsHashTable()) {
2545 WeakHashTable* table = 2556 WeakHashTable* table =
2546 WeakHashTable::cast(heap_->weak_object_to_code_table()); 2557 WeakHashTable::cast(heap_->weak_object_to_code_table());
2547 uint32_t capacity = table->Capacity(); 2558 uint32_t capacity = table->Capacity();
2548 for (uint32_t i = 0; i < capacity; i++) { 2559 for (uint32_t i = 0; i < capacity; i++) {
2549 uint32_t key_index = table->EntryToIndex(i); 2560 uint32_t key_index = table->EntryToIndex(i);
2550 Object* key = table->get(key_index); 2561 Object* key = table->get(key_index);
2551 if (!table->IsKey(key)) continue; 2562 if (!table->IsKey(key)) continue;
2552 uint32_t value_index = table->EntryToValueIndex(i); 2563 uint32_t value_index = table->EntryToValueIndex(i);
2553 Object* value = table->get(value_index); 2564 Object* value = table->get(value_index);
(...skipping 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after
4351 while (buffer != NULL) { 4362 while (buffer != NULL) {
4352 SlotsBuffer* next_buffer = buffer->next(); 4363 SlotsBuffer* next_buffer = buffer->next();
4353 DeallocateBuffer(buffer); 4364 DeallocateBuffer(buffer);
4354 buffer = next_buffer; 4365 buffer = next_buffer;
4355 } 4366 }
4356 *buffer_address = NULL; 4367 *buffer_address = NULL;
4357 } 4368 }
4358 4369
4359 4370
4360 } } // namespace v8::internal 4371 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698