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

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

Issue 1169743002: Reland "Replace ad-hoc weakness in prototype transitions with WeakCell." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing slots recording Created 5 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
« no previous file with comments | « no previous file | src/heap/objects-visiting-inl.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/base/atomicops.h" 7 #include "src/base/atomicops.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compilation-cache.h" 10 #include "src/compilation-cache.h"
(...skipping 2386 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 2397
2398 void MarkCompactCollector::ClearNonLivePrototypeTransitions(Map* map) { 2398 void MarkCompactCollector::ClearNonLivePrototypeTransitions(Map* map) {
2399 FixedArray* prototype_transitions = 2399 FixedArray* prototype_transitions =
2400 TransitionArray::GetPrototypeTransitions(map); 2400 TransitionArray::GetPrototypeTransitions(map);
2401 int number_of_transitions = 2401 int number_of_transitions =
2402 TransitionArray::NumberOfPrototypeTransitions(prototype_transitions); 2402 TransitionArray::NumberOfPrototypeTransitions(prototype_transitions);
2403 2403
2404 const int header = TransitionArray::kProtoTransitionHeaderSize; 2404 const int header = TransitionArray::kProtoTransitionHeaderSize;
2405 int new_number_of_transitions = 0; 2405 int new_number_of_transitions = 0;
2406 for (int i = 0; i < number_of_transitions; i++) { 2406 for (int i = 0; i < number_of_transitions; i++) {
2407 Object* cached_map = prototype_transitions->get(header + i); 2407 Object* cell = prototype_transitions->get(header + i);
2408 if (IsMarked(cached_map)) { 2408 if (!WeakCell::cast(cell)->cleared()) {
2409 if (new_number_of_transitions != i) { 2409 if (new_number_of_transitions != i) {
2410 prototype_transitions->set(header + new_number_of_transitions, 2410 prototype_transitions->set(header + new_number_of_transitions, cell);
2411 cached_map, SKIP_WRITE_BARRIER); 2411 Object** slot = prototype_transitions->RawFieldOfElementAt(
2412 header + new_number_of_transitions);
2413 RecordSlot(slot, slot, cell);
2412 } 2414 }
2413 new_number_of_transitions++; 2415 new_number_of_transitions++;
2414 } 2416 }
2415 } 2417 }
2416 2418
2417 if (new_number_of_transitions != number_of_transitions) { 2419 if (new_number_of_transitions != number_of_transitions) {
2418 TransitionArray::SetNumberOfPrototypeTransitions(prototype_transitions, 2420 TransitionArray::SetNumberOfPrototypeTransitions(prototype_transitions,
2419 new_number_of_transitions); 2421 new_number_of_transitions);
2420 } 2422 }
2421 2423
(...skipping 2308 matching lines...) Expand 10 before | Expand all | Expand 10 after
4730 SlotsBuffer* buffer = *buffer_address; 4732 SlotsBuffer* buffer = *buffer_address;
4731 while (buffer != NULL) { 4733 while (buffer != NULL) {
4732 SlotsBuffer* next_buffer = buffer->next(); 4734 SlotsBuffer* next_buffer = buffer->next();
4733 DeallocateBuffer(buffer); 4735 DeallocateBuffer(buffer);
4734 buffer = next_buffer; 4736 buffer = next_buffer;
4735 } 4737 }
4736 *buffer_address = NULL; 4738 *buffer_address = NULL;
4737 } 4739 }
4738 } // namespace internal 4740 } // namespace internal
4739 } // namespace v8 4741 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/objects-visiting-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698