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

Side by Side Diff: src/objects-visiting-inl.h

Issue 223533002: Don't overwrite transition array map while iterating over the transition tree. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 | « src/objects-inl.h ('k') | src/transitions.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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 Heap* heap, Map* map) { 608 Heap* heap, Map* map) {
609 // Make sure that the back pointer stored either in the map itself or 609 // Make sure that the back pointer stored either in the map itself or
610 // inside its transitions array is marked. Skip recording the back 610 // inside its transitions array is marked. Skip recording the back
611 // pointer slot since map space is not compacted. 611 // pointer slot since map space is not compacted.
612 StaticVisitor::MarkObject(heap, HeapObject::cast(map->GetBackPointer())); 612 StaticVisitor::MarkObject(heap, HeapObject::cast(map->GetBackPointer()));
613 613
614 // Treat pointers in the transitions array as weak and also mark that 614 // Treat pointers in the transitions array as weak and also mark that
615 // array to prevent visiting it later. Skip recording the transition 615 // array to prevent visiting it later. Skip recording the transition
616 // array slot, since it will be implicitly recorded when the pointer 616 // array slot, since it will be implicitly recorded when the pointer
617 // fields of this map are visited. 617 // fields of this map are visited.
618 TransitionArray* transitions = map->unchecked_transition_array(); 618 if (map->HasTransitionArray()) {
619 if (transitions->IsTransitionArray()) { 619 TransitionArray* transitions = map->transitions();
620 MarkTransitionArray(heap, transitions); 620 MarkTransitionArray(heap, transitions);
621 } else {
622 // Already marked by marking map->GetBackPointer() above.
623 ASSERT(transitions->IsMap() || transitions->IsUndefined());
624 } 621 }
625 622
626 // Since descriptor arrays are potentially shared, ensure that only the 623 // Since descriptor arrays are potentially shared, ensure that only the
627 // descriptors that belong to this map are marked. The first time a 624 // descriptors that belong to this map are marked. The first time a
628 // non-empty descriptor array is marked, its header is also visited. The slot 625 // non-empty descriptor array is marked, its header is also visited. The slot
629 // holding the descriptor array will be implicitly recorded when the pointer 626 // holding the descriptor array will be implicitly recorded when the pointer
630 // fields of this map are visited. 627 // fields of this map are visited.
631 DescriptorArray* descriptors = map->instance_descriptors(); 628 DescriptorArray* descriptors = map->instance_descriptors();
632 if (StaticVisitor::MarkObjectWithoutPush(heap, descriptors) && 629 if (StaticVisitor::MarkObjectWithoutPush(heap, descriptors) &&
633 descriptors->length() > 0) { 630 descriptors->length() > 0) {
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 RelocIterator it(this, mode_mask); 942 RelocIterator it(this, mode_mask);
946 for (; !it.done(); it.next()) { 943 for (; !it.done(); it.next()) {
947 it.rinfo()->template Visit<StaticVisitor>(heap); 944 it.rinfo()->template Visit<StaticVisitor>(heap);
948 } 945 }
949 } 946 }
950 947
951 948
952 } } // namespace v8::internal 949 } } // namespace v8::internal
953 950
954 #endif // V8_OBJECTS_VISITING_INL_H_ 951 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/transitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698