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

Side by Side Diff: src/objects.cc

Issue 179733004: Re-evaluate marking bits of a descriptor array when it gets replaced. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 2561 matching lines...) Expand 10 before | Expand all | Expand 10 after
2572 if (transition != TransitionArray::kNotFound) { 2572 if (transition != TransitionArray::kNotFound) {
2573 transitions->GetTarget(transition)->DeprecateTransitionTree(); 2573 transitions->GetTarget(transition)->DeprecateTransitionTree();
2574 } 2574 }
2575 } 2575 }
2576 2576
2577 // Don't overwrite the empty descriptor array. 2577 // Don't overwrite the empty descriptor array.
2578 if (NumberOfOwnDescriptors() == 0) return; 2578 if (NumberOfOwnDescriptors() == 0) return;
2579 2579
2580 DescriptorArray* to_replace = instance_descriptors(); 2580 DescriptorArray* to_replace = instance_descriptors();
2581 Map* current = this; 2581 Map* current = this;
2582 GetHeap()->incremental_marking()->RecordWrites(to_replace);
2582 while (current->instance_descriptors() == to_replace) { 2583 while (current->instance_descriptors() == to_replace) {
2583 current->SetEnumLength(kInvalidEnumCacheSentinel); 2584 current->SetEnumLength(kInvalidEnumCacheSentinel);
2584 current->set_instance_descriptors(new_descriptors); 2585 current->set_instance_descriptors(new_descriptors);
2585 Object* next = current->GetBackPointer(); 2586 Object* next = current->GetBackPointer();
2586 if (next->IsUndefined()) break; 2587 if (next->IsUndefined()) break;
2587 current = Map::cast(next); 2588 current = Map::cast(next);
2588 } 2589 }
2589 2590
2590 set_owns_descriptors(false); 2591 set_owns_descriptors(false);
2591 } 2592 }
(...skipping 4215 matching lines...) Expand 10 before | Expand all | Expand 10 after
6807 // that the maps to which we push the new descriptor array back can rely 6808 // that the maps to which we push the new descriptor array back can rely
6808 // on a cache always being available once it is set. If the map has more 6809 // on a cache always being available once it is set. If the map has more
6809 // enumerated descriptors than available in the original cache, the cache 6810 // enumerated descriptors than available in the original cache, the cache
6810 // will be lazily replaced by the extended cache when needed. 6811 // will be lazily replaced by the extended cache when needed.
6811 if (descriptors->HasEnumCache()) { 6812 if (descriptors->HasEnumCache()) {
6812 new_descriptors->CopyEnumCacheFrom(descriptors); 6813 new_descriptors->CopyEnumCacheFrom(descriptors);
6813 } 6814 }
6814 6815
6815 Map* map; 6816 Map* map;
6816 // Replace descriptors by new_descriptors in all maps that share it. 6817 // Replace descriptors by new_descriptors in all maps that share it.
6818
6819 GetHeap()->incremental_marking()->RecordWrites(descriptors);
6817 for (Object* current = GetBackPointer(); 6820 for (Object* current = GetBackPointer();
6818 !current->IsUndefined(); 6821 !current->IsUndefined();
6819 current = map->GetBackPointer()) { 6822 current = map->GetBackPointer()) {
6820 map = Map::cast(current); 6823 map = Map::cast(current);
6821 if (map->instance_descriptors() != descriptors) break; 6824 if (map->instance_descriptors() != descriptors) break;
6822 map->set_instance_descriptors(new_descriptors); 6825 map->set_instance_descriptors(new_descriptors);
6823 } 6826 }
6824 6827
6825 set_instance_descriptors(new_descriptors); 6828 set_instance_descriptors(new_descriptors);
6826 } 6829 }
(...skipping 9654 matching lines...) Expand 10 before | Expand all | Expand 10 after
16481 #define ERROR_MESSAGES_TEXTS(C, T) T, 16484 #define ERROR_MESSAGES_TEXTS(C, T) T,
16482 static const char* error_messages_[] = { 16485 static const char* error_messages_[] = {
16483 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16486 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16484 }; 16487 };
16485 #undef ERROR_MESSAGES_TEXTS 16488 #undef ERROR_MESSAGES_TEXTS
16486 return error_messages_[reason]; 16489 return error_messages_[reason];
16487 } 16490 }
16488 16491
16489 16492
16490 } } // namespace v8::internal 16493 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698