OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1655 if (map->IsMarked() && map->attached_to_shared_function_info()) { | 1655 if (map->IsMarked() && map->attached_to_shared_function_info()) { |
1656 // This map is used for inobject slack tracking and has been detached | 1656 // This map is used for inobject slack tracking and has been detached |
1657 // from SharedFunctionInfo during the mark phase. | 1657 // from SharedFunctionInfo during the mark phase. |
1658 // Since it survived the GC, reattach it now. | 1658 // Since it survived the GC, reattach it now. |
1659 map->unchecked_constructor()->unchecked_shared()->AttachInitialMap(map); | 1659 map->unchecked_constructor()->unchecked_shared()->AttachInitialMap(map); |
1660 } | 1660 } |
1661 | 1661 |
1662 // Clear dead prototype transitions. | 1662 // Clear dead prototype transitions. |
1663 int number_of_transitions = map->NumberOfProtoTransitions(); | 1663 int number_of_transitions = map->NumberOfProtoTransitions(); |
1664 if (number_of_transitions > 0) { | 1664 if (number_of_transitions > 0) { |
1665 FixedArray* prototype_transitions = map->unchecked_prototype_transitions()
; | 1665 FixedArray* prototype_transitions = |
| 1666 map->unchecked_prototype_transitions(); |
1666 int new_number_of_transitions = 0; | 1667 int new_number_of_transitions = 0; |
1667 const int header = Map::kProtoTransitionHeaderSize; | 1668 const int header = Map::kProtoTransitionHeaderSize; |
1668 const int proto_offset = | 1669 const int proto_offset = |
1669 header + Map::kProtoTransitionPrototypeOffset; | 1670 header + Map::kProtoTransitionPrototypeOffset; |
1670 const int map_offset = header + Map::kProtoTransitionMapOffset; | 1671 const int map_offset = header + Map::kProtoTransitionMapOffset; |
1671 const int step = Map::kProtoTransitionElementsPerEntry; | 1672 const int step = Map::kProtoTransitionElementsPerEntry; |
1672 for (int i = 0; i < number_of_transitions; i++) { | 1673 for (int i = 0; i < number_of_transitions; i++) { |
1673 Object* prototype = prototype_transitions->get(proto_offset + i * step); | 1674 Object* prototype = prototype_transitions->get(proto_offset + i * step); |
1674 Object* cached_map = prototype_transitions->get(map_offset + i * step); | 1675 Object* cached_map = prototype_transitions->get(map_offset + i * step); |
1675 if (HeapObject::cast(prototype)->IsMarked() && | 1676 if (HeapObject::cast(prototype)->IsMarked() && |
(...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3270 } | 3271 } |
3271 | 3272 |
3272 | 3273 |
3273 void MarkCompactCollector::Initialize() { | 3274 void MarkCompactCollector::Initialize() { |
3274 StaticPointersToNewGenUpdatingVisitor::Initialize(); | 3275 StaticPointersToNewGenUpdatingVisitor::Initialize(); |
3275 StaticMarkingVisitor::Initialize(); | 3276 StaticMarkingVisitor::Initialize(); |
3276 } | 3277 } |
3277 | 3278 |
3278 | 3279 |
3279 } } // namespace v8::internal | 3280 } } // namespace v8::internal |
OLD | NEW |